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

factoring

parent b5a8547e
...@@ -119,20 +119,13 @@ Plugin_Smug::~Plugin_Smug() ...@@ -119,20 +119,13 @@ Plugin_Smug::~Plugin_Smug()
void Plugin_Smug::slotExport() void Plugin_Smug::slotExport()
{ {
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir; KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-smug-") + QString::number(getpid()) + QString("/")); QString tmp = dir.saveLocation("tmp", QString("kipi-smug-") + QString::number(getpid()) + QString("/"));
if (!m_dlgExport) if (!m_dlgExport)
{ {
// We clean it up in the close button // We clean it up in the close button
m_dlgExport = new SmugWindow(interface, tmp, false, kapp->activeWindow()); m_dlgExport = new SmugWindow(tmp, false, kapp->activeWindow());
} }
else else
{ {
...@@ -147,20 +140,13 @@ void Plugin_Smug::slotExport() ...@@ -147,20 +140,13 @@ void Plugin_Smug::slotExport()
void Plugin_Smug::slotImport() void Plugin_Smug::slotImport()
{ {
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir; KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-smug-") + QString::number(getpid()) + QString("/")); QString tmp = dir.saveLocation("tmp", QString("kipi-smug-") + QString::number(getpid()) + QString("/"));
if (!m_dlgImport) if (!m_dlgImport)
{ {
// We clean it up in the close button // We clean it up in the close button
m_dlgImport = new SmugWindow(interface, tmp, true, kapp->activeWindow()); m_dlgImport = new SmugWindow(tmp, true, kapp->activeWindow());
} }
else else
{ {
......
...@@ -73,17 +73,15 @@ ...@@ -73,17 +73,15 @@
namespace KIPISmugPlugin namespace KIPISmugPlugin
{ {
SmugWindow::SmugWindow(Interface* const interface, const QString& tmpFolder, SmugWindow::SmugWindow(const QString& tmpFolder, bool import, QWidget* const /*parent*/)
bool import, QWidget* const /*parent*/)
: KPToolDialog(0) : KPToolDialog(0)
{ {
m_tmpPath.clear(); m_tmpPath.clear();
m_tmpDir = tmpFolder; m_tmpDir = tmpFolder;
m_interface = interface;
m_import = import; m_import = import;
m_imagesCount = 0; m_imagesCount = 0;
m_imagesTotal = 0; m_imagesTotal = 0;
m_widget = new SmugWidget(this, interface, import); m_widget = new SmugWidget(this, iface(), import);
setMainWidget(m_widget); setMainWidget(m_widget);
setWindowIcon(KIcon("smugmug")); setWindowIcon(KIcon("smugmug"));
......
...@@ -61,8 +61,7 @@ class SmugWindow : public KPToolDialog ...@@ -61,8 +61,7 @@ class SmugWindow : public KPToolDialog
public: public:
SmugWindow(Interface* const interface, const QString& tmpFolder, SmugWindow(const QString& tmpFolder, bool import, QWidget* const parent);
bool import, QWidget* const parent);
~SmugWindow(); ~SmugWindow();
/** /**
...@@ -135,8 +134,6 @@ private: ...@@ -135,8 +134,6 @@ private:
SmugTalker* m_talker; SmugTalker* m_talker;
SmugWidget* m_widget; SmugWidget* m_widget;
SmugNewAlbum* m_albumDlg; SmugNewAlbum* m_albumDlg;
Interface* m_interface;
}; };
} // namespace KIPISmugPlugin } // namespace KIPISmugPlugin
......
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