Commit 3fd48e73 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

factoring

parent 1d3a7920
......@@ -55,14 +55,9 @@ const QString KioExportWindow::TARGET_URL_PROPERTY = "targetUrl";
const QString KioExportWindow::HISTORY_URL_PROPERTY = "historyUrls";
const QString KioExportWindow::CONFIG_GROUP = "KioExport";
KioExportWindow::KioExportWindow(QWidget* const /*parent*/, Interface* const interface)
: KPToolDialog(0), m_interface(interface)
KioExportWindow::KioExportWindow(QWidget* const /*parent*/)
: KPToolDialog(0)
{
if (!interface)
{
kFatal() << "Interface is empty";
}
m_exportWidget = new KioExportWidget(this);
setMainWidget(m_exportWidget);
......
......@@ -60,9 +60,8 @@ public:
* Constructor.
*
* @param parent parent QWidget
* @param interface pointer to the KIPI interface to use. Must not be null.
*/
KioExportWindow(QWidget* const parent, Interface* const interface);
KioExportWindow(QWidget* const parent);
/**
* Destructor.
......@@ -140,8 +139,6 @@ private:
private:
Interface* m_interface;
KioExportWidget* m_exportWidget;
};
......
......@@ -54,15 +54,10 @@
namespace KIPIKioExportPlugin
{
KioImportWindow::KioImportWindow(QWidget* const /*parent*/, Interface* const interface)
: KPToolDialog(0), m_interface(interface)
KioImportWindow::KioImportWindow(QWidget* const /*parent*/)
: KPToolDialog(0)
{
if (!interface)
{
kFatal() << "Interface is empty";
}
m_importWidget = new KioImportWidget(this, interface);
m_importWidget = new KioImportWidget(this, iface());
setMainWidget(m_importWidget);
// window setup
......
......@@ -60,7 +60,7 @@ public:
*
* @param parent parent widget
*/
KioImportWindow(QWidget* const parent, Interface* const interface);
KioImportWindow(QWidget* const parent);
/**
* Destructor.
......@@ -94,8 +94,6 @@ private slots:
private:
Interface* m_interface;
KioImportWidget* m_importWidget;
};
......
......@@ -104,17 +104,10 @@ void Plugin_KioExportImport::slotActivateExport()
{
kDebug() << "Starting KIO export";
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Interface empty";
return;
}
if (!m_dlgExport)
{
// We clean it up in the close button
m_dlgExport = new KioExportWindow(kapp->activeWindow(), interface);
m_dlgExport = new KioExportWindow(kapp->activeWindow());
}
else
{
......@@ -131,17 +124,10 @@ void Plugin_KioExportImport::slotActivateImport()
{
kDebug() << "Starting KIO import";
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Interface empty";
return;
}
if (!m_dlgImport)
{
// We clean it up in the close button
m_dlgImport = new KioImportWindow(kapp->activeWindow(), interface);
m_dlgImport = new KioImportWindow(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