Commit 83acce17 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent 81facfaa
...@@ -97,8 +97,6 @@ public: ...@@ -97,8 +97,6 @@ public:
KUrlLabel* logo; KUrlLabel* logo;
Interface* interface;
PiwigoTalker* talker; PiwigoTalker* talker;
Piwigo* pPiwigo; Piwigo* pPiwigo;
...@@ -223,11 +221,10 @@ PiwigoWindow::Private::Private(PiwigoWindow* const parent) ...@@ -223,11 +221,10 @@ PiwigoWindow::Private::Private(PiwigoWindow* const parent)
// -------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------
PiwigoWindow::PiwigoWindow(Interface* const interface, QWidget* const parent, Piwigo* const pPiwigo) PiwigoWindow::PiwigoWindow(QWidget* const parent, Piwigo* const pPiwigo)
: KPToolDialog(parent), : KPToolDialog(parent),
d(new Private(this)) d(new Private(this))
{ {
d->interface = interface;
d->pPiwigo = pPiwigo; d->pPiwigo = pPiwigo;
setWindowTitle( i18n("Piwigo Export") ); setWindowTitle( i18n("Piwigo Export") );
...@@ -538,7 +535,7 @@ void PiwigoWindow::slotAlbumSelected() ...@@ -538,7 +535,7 @@ void PiwigoWindow::slotAlbumSelected()
void PiwigoWindow::slotAddPhoto() void PiwigoWindow::slotAddPhoto()
{ {
const KUrl::List urls(d->interface->currentSelection().images()); const KUrl::List urls(iface()->currentSelection().images());
if ( urls.isEmpty()) if ( urls.isEmpty())
{ {
......
...@@ -55,7 +55,7 @@ class PiwigoWindow : public KPToolDialog ...@@ -55,7 +55,7 @@ class PiwigoWindow : public KPToolDialog
public: public:
PiwigoWindow(Interface* const interface, QWidget* const parent, Piwigo* const pPiwigo); PiwigoWindow(QWidget* const parent, Piwigo* const pPiwigo);
~PiwigoWindow(); ~PiwigoWindow();
private: private:
......
...@@ -99,25 +99,17 @@ Plugin_PiwigoExport::~Plugin_PiwigoExport() ...@@ -99,25 +99,17 @@ Plugin_PiwigoExport::~Plugin_PiwigoExport()
// this slot uses PiwigoWindow Class // this slot uses PiwigoWindow Class
void Plugin_PiwigoExport::slotSync() void Plugin_PiwigoExport::slotSync()
{ {
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
QPointer<PiwigoEdit> configDlg; QPointer<PiwigoEdit> configDlg;
QPointer<PiwigoWindow> dlg; QPointer<PiwigoWindow> dlg;
KConfig config("kipirc"); KConfig config("kipirc");
if (!config.hasGroup("Piwigo Settings") ) if (!config.hasGroup("Piwigo Settings") )
{ {
configDlg = new PiwigoEdit(kapp->activeWindow(), configDlg = new PiwigoEdit(kapp->activeWindow(), m_pPiwigo, i18n("Edit Piwigo Data") );
m_pPiwigo, i18n("Edit Piwigo Data") );
configDlg->exec(); configDlg->exec();
} }
dlg = new PiwigoWindow(interface, kapp->activeWindow(), m_pPiwigo); dlg = new PiwigoWindow(kapp->activeWindow(), m_pPiwigo);
dlg->exec(); dlg->exec();
delete configDlg; delete configDlg;
......
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