Commit 81facfaa authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent ef71969a
......@@ -75,17 +75,15 @@
namespace KIPIPicasawebExportPlugin
{
PicasawebWindow::PicasawebWindow(Interface* const interface, const QString& tmpFolder,
bool import, QWidget* /*parent*/)
PicasawebWindow::PicasawebWindow(const QString& tmpFolder, bool import, QWidget* /*parent*/)
: KPToolDialog(0)
{
m_tmpPath.clear();
m_tmpDir = tmpFolder;
m_interface = interface;
m_import = import;
m_imagesCount = 0;
m_imagesTotal = 0;
m_widget = new PicasawebWidget(this, interface, import);
m_widget = new PicasawebWidget(this, iface(), import);
setMainWidget(m_widget);
setWindowIcon(KIcon("picasa"));
......
......@@ -66,8 +66,7 @@ class PicasawebWindow : public KPToolDialog
public:
PicasawebWindow(Interface* const interface, const QString& tmpFolder,
bool import, QWidget *parent);
PicasawebWindow(const QString& tmpFolder, bool import, QWidget* parent);
~PicasawebWindow();
/**
......
......@@ -116,20 +116,13 @@ Plugin_PicasawebExport::~Plugin_PicasawebExport()
void Plugin_PicasawebExport::slotExport()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!" ;
return;
}
KStandardDirs dir;
QString Tmp = dir.saveLocation("tmp", "kipi-picasawebexportplugin-" + QString::number(getpid()) + '/');
QString tmp = dir.saveLocation("tmp", "kipi-picasawebexportplugin-" + QString::number(getpid()) + '/');
if (!m_dlgExport)
{
// We clean it up in the close button
m_dlgExport = new PicasawebWindow(interface, Tmp, false, kapp->activeWindow());
m_dlgExport = new PicasawebWindow(tmp, false, kapp->activeWindow());
}
else
{
......@@ -144,20 +137,13 @@ void Plugin_PicasawebExport::slotExport()
void Plugin_PicasawebExport::slotImport()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-picasawebexportplugin-") + QString::number(getpid()) + QString("/"));
if (!m_dlgImport)
{
// We clean it up in the close button
m_dlgImport = new PicasawebWindow(interface, tmp, true, kapp->activeWindow());
m_dlgImport = new PicasawebWindow(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