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

factoring

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