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

factoring

parent 3b433922
...@@ -88,20 +88,13 @@ void Plugin_RajceExport::setup(QWidget* widget) ...@@ -88,20 +88,13 @@ void Plugin_RajceExport::setup(QWidget* widget)
void Plugin_RajceExport::slotExport() void Plugin_RajceExport::slotExport()
{ {
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!" ;
return;
}
KStandardDirs dir; KStandardDirs dir;
QString Tmp = dir.saveLocation("tmp", "kipi-rajceexportplugin-" + QString::number(getpid()) + '/'); QString tmp = dir.saveLocation("tmp", "kipi-rajceexportplugin-" + QString::number(getpid()) + '/');
if (!m_dlgExport) if (!m_dlgExport)
{ {
// We clean it up in the close button // We clean it up in the close button
m_dlgExport = new RajceWindow(interface, Tmp, kapp->activeWindow()); m_dlgExport = new RajceWindow(tmp, kapp->activeWindow());
} }
else else
{ {
......
...@@ -40,11 +40,10 @@ ...@@ -40,11 +40,10 @@
namespace KIPIRajceExportPlugin namespace KIPIRajceExportPlugin
{ {
RajceWindow::RajceWindow(Interface* const interface, const QString& tmpFolder, RajceWindow::RajceWindow(const QString& tmpFolder, QWidget* const /*parent*/, Qt::WFlags /*flags*/)
QWidget* const /*parent*/, Qt::WFlags /*flags*/) : KPToolDialog(0)
: KPToolDialog(0), m_interface(interface)
{ {
m_widget = new RajceWidget(interface, tmpFolder, this); m_widget = new RajceWidget(iface(), tmpFolder, this);
m_widget->readSettings(); m_widget->readSettings();
setMainWidget(m_widget); setMainWidget(m_widget);
......
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
#ifndef RAJCEWINDOW_H #ifndef RAJCEWINDOW_H
#define RAJCEWINDOW_H #define RAJCEWINDOW_H
// Libkipi includes
#include <libkipi/interface.h>
// Local includes // Local includes
#include "kptooldialog.h" #include "kptooldialog.h"
...@@ -45,7 +41,7 @@ class RajceWindow : public KPToolDialog ...@@ -45,7 +41,7 @@ class RajceWindow : public KPToolDialog
public: public:
explicit RajceWindow(Interface* const interface, const QString& tmpFolder, QWidget* const parent = 0, Qt::WFlags flags = 0); explicit RajceWindow(const QString& tmpFolder, QWidget* const parent = 0, Qt::WFlags flags = 0);
~RajceWindow(); ~RajceWindow();
void reactivate(); void reactivate();
...@@ -57,7 +53,6 @@ private Q_SLOTS: ...@@ -57,7 +53,6 @@ private Q_SLOTS:
private: private:
Interface* m_interface;
RajceWidget* m_widget; RajceWidget* m_widget;
}; };
......
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