Commit 56599be2 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent c16d405e
......@@ -63,7 +63,6 @@ void Plugin_YandexFotki::setup(QWidget* widget)
KIconLoader::global()->addAppDir("kipiplugin_yandexfotki");
m_actionExport = actionCollection()->addAction("Yandex.Fotki");
m_actionExport->setText(i18n("Export to &Yandex.Fotki..."));
// TODO: icon file
......@@ -101,19 +100,11 @@ void Plugin_YandexFotki::slotImport()
void Plugin_YandexFotki::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 YandexFotkiWindow(interface, false, kapp->activeWindow());
m_dlgExport = new YandexFotkiWindow(false, kapp->activeWindow());
}
else
{
......
......@@ -108,11 +108,9 @@ namespace KIPIYandexFotkiPlugin
*/
const char* YandexFotkiWindow::XMP_SERVICE_ID = "Xmp.kipi.yandexGPhotoId";
YandexFotkiWindow::YandexFotkiWindow(Interface* const interface,
bool import, QWidget* const parent)
YandexFotkiWindow::YandexFotkiWindow(bool import, QWidget* const parent)
: KPToolDialog(parent)
{
m_interface = interface;
m_import = import;
KStandardDirs dir;
......@@ -198,7 +196,7 @@ YandexFotkiWindow::YandexFotkiWindow(Interface* const interface,
uploadBox->setWhatsThis(
i18n("This is the location where Yandex.Fotki images will be downloaded."));
QVBoxLayout* uploadBoxLayout = new QVBoxLayout(uploadBox);
m_uploadWidget = interface->uploadWidget(uploadBox);
m_uploadWidget = iface()->uploadWidget(uploadBox);
uploadBoxLayout->addWidget(m_uploadWidget);
// ------------------------------------------------------------------------
......@@ -208,7 +206,7 @@ YandexFotkiWindow::YandexFotkiWindow(Interface* const interface,
i18n("These are options that will be applied to images before upload."));
QGridLayout* optionsBoxLayout = new QGridLayout(optionsBox);
m_resizeCheck = new QCheckBox(optionsBox);
m_resizeCheck = new QCheckBox(optionsBox);
m_resizeCheck->setText(i18n("Resize photos before uploading"));
m_resizeCheck->setChecked(false);
......
......@@ -55,7 +55,6 @@ class KLineEdit;
namespace KIPI
{
class Interface;
class UploadWidget;
}
......@@ -76,8 +75,7 @@ class YandexFotkiWindow : public KPToolDialog
public:
YandexFotkiWindow(Interface* const interface,
bool import, QWidget* const parent);
YandexFotkiWindow(bool import, QWidget* const parent);
~YandexFotkiWindow();
/**
......@@ -141,7 +139,6 @@ protected:
*/
bool m_import;
Interface* m_interface;
/*
* User interface
......
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