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

factoring

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