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

factoring

parent c5b47c16
...@@ -101,20 +101,11 @@ void Plugin_Vkontakte::slotImport() ...@@ -101,20 +101,11 @@ void Plugin_Vkontakte::slotImport()
void Plugin_Vkontakte::slotExport() void Plugin_Vkontakte::slotExport()
{ {
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!" ;
return;
}
if (!m_dlgExport) if (!m_dlgExport)
{ {
// This object will live forever, we will reuse it on future accesses // This object will live forever, we will reuse it on future accesses
// to the plugin. // to the plugin.
m_dlgExport = new VkontakteWindow(interface, m_dlgExport = new VkontakteWindow(false, kapp->activeWindow());
false, kapp->activeWindow());
} }
else else
{ {
...@@ -139,4 +130,3 @@ Category Plugin_Vkontakte::category(KAction* action) const ...@@ -139,4 +130,3 @@ Category Plugin_Vkontakte::category(KAction* action) const
} }
} // namespace KIPIVkontaktePlugin } // namespace KIPIVkontaktePlugin
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
namespace KIPIVkontaktePlugin namespace KIPIVkontaktePlugin
{ {
VkontakteWindow::VkontakteWindow(Interface* const interface, bool import, QWidget* const parent) VkontakteWindow::VkontakteWindow(bool import, QWidget* const parent)
: KPToolDialog(parent) : KPToolDialog(parent)
{ {
m_authenticated = false; m_authenticated = false;
...@@ -117,13 +117,10 @@ VkontakteWindow::VkontakteWindow(Interface* const interface, bool import, QWidge ...@@ -117,13 +117,10 @@ VkontakteWindow::VkontakteWindow(Interface* const interface, bool import, QWidge
connect(this, SIGNAL(finished()), connect(this, SIGNAL(finished()),
this, SLOT(slotFinished())); this, SLOT(slotFinished()));
m_interface = interface; m_import = import;
m_import = import;
m_mainWidget = new QWidget(this); m_mainWidget = new QWidget(this);
QHBoxLayout* mainLayout = new QHBoxLayout(m_mainWidget); QHBoxLayout* mainLayout = new QHBoxLayout(m_mainWidget);
m_imgList = new KPImagesList(this);
m_imgList = new KPImagesList(this);
m_imgList->setControlButtonsPlacement(KPImagesList::ControlButtonsBelow); m_imgList->setControlButtonsPlacement(KPImagesList::ControlButtonsBelow);
m_imgList->setAllowRAW(false); // TODO: implement conversion m_imgList->setAllowRAW(false); // TODO: implement conversion
m_imgList->loadImagesFromCurrentSelection(); m_imgList->loadImagesFromCurrentSelection();
...@@ -226,7 +223,7 @@ VkontakteWindow::VkontakteWindow(Interface* const interface, bool import, QWidge ...@@ -226,7 +223,7 @@ VkontakteWindow::VkontakteWindow(Interface* const interface, bool import, QWidge
QGroupBox* uploadBox = new QGroupBox(i18n("Destination"), settingsBox); QGroupBox* uploadBox = new QGroupBox(i18n("Destination"), settingsBox);
uploadBox->setWhatsThis(i18n("This is the location where VKontakte images will be downloaded.")); uploadBox->setWhatsThis(i18n("This is the location where VKontakte images will be downloaded."));
QVBoxLayout* uploadBoxLayout = new QVBoxLayout(uploadBox); QVBoxLayout* uploadBoxLayout = new QVBoxLayout(uploadBox);
m_uploadWidget = interface->uploadWidget(uploadBox); m_uploadWidget = iface()->uploadWidget(uploadBox);
uploadBoxLayout->addWidget(m_uploadWidget); uploadBoxLayout->addWidget(m_uploadWidget);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
......
...@@ -76,8 +76,7 @@ class VkontakteWindow : public KPToolDialog ...@@ -76,8 +76,7 @@ class VkontakteWindow : public KPToolDialog
public: public:
VkontakteWindow(Interface* const interface, VkontakteWindow(bool import, QWidget* const parent);
bool import, QWidget* const parent);
~VkontakteWindow(); ~VkontakteWindow();
/** /**
...@@ -152,7 +151,6 @@ protected: ...@@ -152,7 +151,6 @@ protected:
/// Plugin /// Plugin
bool m_import; bool m_import;
Interface* m_interface;
/// User interface /// User interface
QWidget* m_mainWidget; QWidget* m_mainWidget;
......
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