Commit 26beacbc authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent 3fd48e73
......@@ -101,20 +101,13 @@ Plugin_WikiMedia::~Plugin_WikiMedia()
void Plugin_WikiMedia::slotExport()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-mediawiki-") + QString::number(getpid()) + QString("/"));
if (!m_dlgExport)
{
// We clean it up in the close button
m_dlgExport = new WMWindow(interface, tmp, kapp->activeWindow());
m_dlgExport = new WMWindow(tmp, kapp->activeWindow());
}
else
{
......@@ -125,7 +118,7 @@ void Plugin_WikiMedia::slotExport()
}
}
Category Plugin_WikiMedia::category( KAction* action ) const
Category Plugin_WikiMedia::category(KAction* action) const
{
if (action == m_actionExport)
return ExportPlugin;
......
......@@ -62,12 +62,11 @@
namespace KIPIWikiMediaPlugin
{
WMWindow::WMWindow(Interface* const interface, const QString& tmpFolder, QWidget* const /*parent*/)
WMWindow::WMWindow(const QString& tmpFolder, QWidget* const /*parent*/)
: KPToolDialog(0)
{
m_tmpPath.clear();
m_tmpDir = tmpFolder;
m_interface = interface;
m_widget = new WmWidget(this);
m_uploadJob = 0;
m_login = QString();
......@@ -174,7 +173,7 @@ void WMWindow::slotClose()
void WMWindow::slotStartTransfer()
{
saveSettings();
KUrl::List urls = m_interface->currentSelection().images();
KUrl::List urls = iface()->currentSelection().images();
QList<QMap<QString, QString> > imageDesc;
QString author = m_widget->author();
......@@ -262,7 +261,7 @@ int WMWindow::slotLoginHandle(KJob* loginJob)
}
else
{
m_uploadJob = new WikiMediaJob(m_interface, m_mediawiki, this);
m_uploadJob = new WikiMediaJob(iface(), m_mediawiki, this);
enableButton(User1, true);
m_widget->invertAccountLoginBox();
m_widget->updateLabels(m_login, m_wiki.toString());
......
......@@ -58,7 +58,7 @@ class WMWindow : public KPToolDialog
public:
WMWindow(Interface* const interface, const QString& tmpFolder, QWidget* const parent);
WMWindow(const QString& tmpFolder, QWidget* const parent);
~WMWindow();
void reactivate();
......@@ -89,7 +89,6 @@ private:
WmWidget* m_widget;
MediaWiki* m_mediawiki;
Interface* m_interface;
WmLogin* m_dlgLoginExport;
WikiMediaJob* m_uploadJob;
};
......
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