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

factoring

parent ed89e10c
......@@ -66,17 +66,15 @@
namespace KIPIFacebookPlugin
{
FbWindow::FbWindow(Interface* const interface, const QString& tmpFolder,
bool import, QWidget* const /*parent*/)
FbWindow::FbWindow(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 FbWidget(this, interface, import);
m_widget = new FbWidget(this, iface(), import);
setMainWidget(m_widget);
setWindowIcon(KIcon("facebook"));
......
......@@ -70,8 +70,7 @@ class FbWindow : public KPToolDialog
public:
FbWindow(Interface* const interface, const QString& tmpFolder,
bool import, QWidget* const parent);
FbWindow(const QString& tmpFolder, bool import, QWidget* const parent);
~FbWindow();
/**
......@@ -145,8 +144,6 @@ private:
FbTalker* m_talker;
FbWidget* m_widget;
FbNewAlbum* m_albumDlg;
Interface* m_interface;
};
} // namespace KIPIFacebookPlugin
......
......@@ -116,20 +116,13 @@ Plugin_Facebook::~Plugin_Facebook()
void Plugin_Facebook::slotExport()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-fb-") + QString::number(getpid()) + QString("/"));
if (!m_dlgExport)
{
// We clean it up in the close button
m_dlgExport = new FbWindow(interface, tmp, false, kapp->activeWindow());
m_dlgExport = new FbWindow(tmp, false, kapp->activeWindow());
}
else
{
......@@ -144,20 +137,13 @@ void Plugin_Facebook::slotExport()
void Plugin_Facebook::slotImport()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-fb-") + QString::number(getpid()) + QString("/"));
if (!m_dlgImport)
{
// We clean it up in the close button
m_dlgImport = new FbWindow(interface, tmp, true, kapp->activeWindow());
m_dlgImport = new FbWindow(tmp, true, kapp->activeWindow());
}
else
{
......
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