Commit 3634ac5e authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent f57408b4
......@@ -75,8 +75,7 @@
namespace KIPIFlickrExportPlugin
{
FlickrWindow::FlickrWindow(Interface* const interface, const QString& tmpFolder,
QWidget* const /*parent*/, const QString& serviceName)
FlickrWindow::FlickrWindow(const QString& tmpFolder, QWidget* const /*parent*/, const QString& serviceName)
: KPToolDialog(0)
{
m_serviceName = serviceName;
......@@ -99,7 +98,6 @@ FlickrWindow::FlickrWindow(Interface* const interface, const QString& tmpFolder,
}
m_tmp = tmpFolder;
m_interface = interface;
m_uploadCount = 0;
m_uploadTotal = 0;
// m_wallet = 0;
......@@ -269,7 +267,6 @@ void FlickrWindow::slotClose()
m_widget->progressBar()->hide();
m_widget->progressBar()->progressCompleted();
}
}
void FlickrWindow::slotAddPhotoCancelAndClose()
......@@ -317,7 +314,7 @@ void FlickrWindow::readSettings()
m_stripSpaceTagsCheckBox->setChecked(grp.readEntry("Strip Space From Tags", false));
m_stripSpaceTagsCheckBox->setEnabled(m_exportHostTagsCheckBox->isChecked());
if (!m_interface->hasFeature(KIPI::HostSupportsTags))
if (!iface()->hasFeature(KIPI::HostSupportsTags))
{
m_exportHostTagsCheckBox->setEnabled(false);
m_stripSpaceTagsCheckBox->setEnabled(false);
......
......@@ -90,8 +90,7 @@ class FlickrWindow : public KPToolDialog
public:
FlickrWindow(Interface* const interface, const QString& tmpFolder,
QWidget* const parent, const QString& serviceName);
FlickrWindow(const QString& tmpFolder, QWidget* const parent, const QString& serviceName);
~FlickrWindow();
/**
......@@ -183,8 +182,6 @@ private:
FlickrWidget* m_widget;
FlickrTalker* m_talker;
Interface* m_interface;
FlickrList* m_imglst;
};
......
......@@ -131,21 +131,13 @@ Plugin_FlickrExport::~Plugin_FlickrExport()
void Plugin_FlickrExport::slotActivateFlickr()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-flickrexportplugin-") + QString::number(getpid()) + QString("/"));
if (!m_dlgFlickr)
{
// We clean it up in the close button
m_dlgFlickr = new FlickrWindow(interface, tmp, kapp->activeWindow(), "Flickr");
m_dlgFlickr = new FlickrWindow(tmp, kapp->activeWindow(), "Flickr");
}
else
{
......@@ -162,21 +154,13 @@ void Plugin_FlickrExport::slotActivateFlickr()
void Plugin_FlickrExport::slotActivate23()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-23exportplugin-") + QString::number(getpid()) + QString("/"));
if (!m_dlg23)
{
// We clean it up in the close button
m_dlg23 = new FlickrWindow(interface, tmp, kapp->activeWindow(), "23");
m_dlg23 = new FlickrWindow(tmp, kapp->activeWindow(), "23");
}
else
{
......@@ -193,21 +177,13 @@ void Plugin_FlickrExport::slotActivate23()
void Plugin_FlickrExport::slotActivateZooomr()
{
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
KStandardDirs dir;
QString tmp = dir.saveLocation("tmp", QString("kipi-Zooomrexportplugin-") + QString::number(getpid()) + QString("/"));
if (!m_dlgZooomr)
{
// We clean it up in the close button
m_dlgZooomr = new FlickrWindow(interface, tmp, kapp->activeWindow(), "Zooomr");
m_dlgZooomr = new FlickrWindow(tmp, kapp->activeWindow(), "Zooomr");
}
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