Commit dbf053c3 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent 89fa44ae
......@@ -31,7 +31,7 @@
// Qt includes
#include <qtconcurrentmap.h>
#include <QtConcurrentMap>
#include <QButtonGroup>
#include <QCheckBox>
#include <QCloseEvent>
......@@ -166,7 +166,6 @@ public:
GPSSyncDialogPriv()
{
// TODO: initialize in the initializer list
interface = 0;
mapWidget = 0;
uiEnabled = true;
splitterSize = 0;
......@@ -175,7 +174,6 @@ public:
}
// General things
Interface *interface;
KipiImageModel *imageModel;
QItemSelectionModel *selectionModel;
bool uiEnabled;
......@@ -232,17 +230,15 @@ public:
QMenu *sortMenu;
};
GPSSyncDialog::GPSSyncDialog(Interface* const interface, QWidget* const parent)
GPSSyncDialog::GPSSyncDialog(QWidget* const parent)
: KPToolDialog(parent), d(new GPSSyncDialogPriv)
{
d->interface = interface;
setAttribute(Qt::WA_DeleteOnClose, true);
setButtons(0);
setCaption(i18n("Geolocation"));
// setModal(true);
setMinimumSize(300,400);
// setModal(true);
d->imageModel = new KipiImageModel(this);
d->selectionModel = new QItemSelectionModel(d->imageModel);
......@@ -255,7 +251,7 @@ GPSSyncDialog::GPSSyncDialog(Interface* const interface, QWidget* const parent)
d->stackedWidget = new QStackedWidget();
d->searchWidget = new SearchWidget(d->bookmarkOwner, d->imageModel, d->selectionModel, d->stackedWidget);
d->imageModel->setKipiInterface(d->interface);
d->imageModel->setKipiInterface(iface());
KipiImageItem::setHeaderData(d->imageModel);
d->imageModel->setSupportedDragActions(Qt::CopyAction);
d->mapModelHelper = new GPSSyncKGeoMapModelHelper(d->imageModel, d->selectionModel, this);
......@@ -346,7 +342,7 @@ GPSSyncDialog::GPSSyncDialog(Interface* const interface, QWidget* const parent)
d->mapSplitter->addWidget(mapVBox);
d->VSplitter->addWidget(d->mapSplitter);
d->treeView = new KipiImageList(d->interface, this);
d->treeView = new KipiImageList(iface(), this);
d->treeView->setModelAndSelectionModel(d->imageModel, d->selectionModel);
d->treeView->setDragDropHandler(new GPSImageListDragDropHandler(this));
d->treeView->setDragEnabled(true);
......@@ -390,7 +386,7 @@ GPSSyncDialog::GPSSyncDialog(Interface* const interface, QWidget* const parent)
d->undoView = new QUndoView(d->undoStack, d->stackedWidget);
d->stackedWidget->addWidget(d->undoView);
d->rgWidget = new GPSReverseGeocodingWidget(d->interface, d->imageModel, d->selectionModel, d->stackedWidget);
d->rgWidget = new GPSReverseGeocodingWidget(iface(), d->imageModel, d->selectionModel, d->stackedWidget);
d->stackedWidget->addWidget(d->rgWidget);
d->stackedWidget->addWidget(d->searchWidget);
......@@ -574,7 +570,7 @@ void GPSSyncDialog::setImages(const KUrl::List& images)
{
for ( KUrl::List::ConstIterator it = images.begin(); it != images.end(); ++it )
{
KipiImageItem* const newItem = new KipiImageItem(d->interface, *it);
KipiImageItem* const newItem = new KipiImageItem(iface(), *it);
newItem->loadImageData(true, false);
d->imageModel->addItem(newItem);
}
......
......@@ -110,7 +110,7 @@ class GPSSyncDialog : public KPToolDialog
public:
GPSSyncDialog(Interface* const interface, QWidget* const parent);
GPSSyncDialog(QWidget* const parent);
~GPSSyncDialog();
void setImages(const KUrl::List& images);
......
......@@ -99,7 +99,7 @@ void Plugin_GPSSync::slotGPSSync()
if ( !images.isValid() || images.images().isEmpty() )
return;
GPSSyncDialog* dialog = new GPSSyncDialog(m_interface, kapp->activeWindow());
GPSSyncDialog* dialog = new GPSSyncDialog(kapp->activeWindow());
dialog->setImages( images.images() );
dialog->show();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment