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

factoring

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