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

factoring

parent e4015fa1
...@@ -87,15 +87,7 @@ Plugin_RemoveRedEyes::~Plugin_RemoveRedEyes() ...@@ -87,15 +87,7 @@ Plugin_RemoveRedEyes::~Plugin_RemoveRedEyes()
void Plugin_RemoveRedEyes::activate() void Plugin_RemoveRedEyes::activate()
{ {
Interface* interface = dynamic_cast<Interface*> (parent()); RemoveRedEyesWindow* window = new RemoveRedEyesWindow();
if (!interface)
{
kError() << "Kipi interface is null!";
return;
}
RemoveRedEyesWindow* window = new RemoveRedEyesWindow(interface);
window->show(); window->show();
} }
......
...@@ -92,8 +92,7 @@ public: ...@@ -92,8 +92,7 @@ public:
unprocessedSettingsBox(0), unprocessedSettingsBox(0),
storageSettingsBox(0), storageSettingsBox(0),
locator(0), locator(0),
saveMethod(0), saveMethod(0)
interface(0)
{} {}
static const QString configGroupName; static const QString configGroupName;
...@@ -138,8 +137,6 @@ public: ...@@ -138,8 +137,6 @@ public:
Locator* locator; Locator* locator;
SaveMethod* saveMethod; SaveMethod* saveMethod;
Interface* interface;
}; };
const QString RemoveRedEyesWindow::RemoveRedEyesWindowPriv::configGroupName("RemoveRedEyes Settings"); const QString RemoveRedEyesWindow::RemoveRedEyesWindowPriv::configGroupName("RemoveRedEyes Settings");
const QString RemoveRedEyesWindow::RemoveRedEyesWindowPriv::configStorageModeEntry("Storage Mode"); const QString RemoveRedEyesWindow::RemoveRedEyesWindowPriv::configStorageModeEntry("Storage Mode");
...@@ -152,7 +149,7 @@ const QString RemoveRedEyesWindow::RemoveRedEyesWindowPriv::configLocatorDefault ...@@ -152,7 +149,7 @@ const QString RemoveRedEyesWindow::RemoveRedEyesWindowPriv::configLocatorDefault
// -------------------------------------------------------- // --------------------------------------------------------
RemoveRedEyesWindow::RemoveRedEyesWindow(Interface* const interface) RemoveRedEyesWindow::RemoveRedEyesWindow()
: KPToolDialog(0), d(new RemoveRedEyesWindowPriv) : KPToolDialog(0), d(new RemoveRedEyesWindowPriv)
{ {
setWindowTitle(i18n("Automatic Red-Eye Removal")); setWindowTitle(i18n("Automatic Red-Eye Removal"));
...@@ -160,7 +157,6 @@ RemoveRedEyesWindow::RemoveRedEyesWindow(Interface* const interface) ...@@ -160,7 +157,6 @@ RemoveRedEyesWindow::RemoveRedEyesWindow(Interface* const interface)
setDefaultButton(Close); setDefaultButton(Close);
setModal(false); setModal(false);
d->interface = interface;
KPHostSettings hSettings; KPHostSettings hSettings;
d->thread = new WorkerThread(this, hSettings.metadataSettings().updateFileTimeStamp); d->thread = new WorkerThread(this, hSettings.metadataSettings().updateFileTimeStamp);
d->runtype = WorkerThread::Testrun; d->runtype = WorkerThread::Testrun;
...@@ -313,7 +309,7 @@ RemoveRedEyesWindow::RemoveRedEyesWindow(Interface* const interface) ...@@ -313,7 +309,7 @@ RemoveRedEyesWindow::RemoveRedEyesWindow(Interface* const interface)
// ---------------------------------------------------------- // ----------------------------------------------------------
ImageCollection images = interface->currentSelection(); ImageCollection images = iface()->currentSelection();
if (images.isValid()) if (images.isValid())
{ {
......
...@@ -28,11 +28,6 @@ ...@@ -28,11 +28,6 @@
#include "kptooldialog.h" #include "kptooldialog.h"
namespace KIPI
{
class Interface;
}
using namespace KIPI; using namespace KIPI;
using namespace KIPIPlugins; using namespace KIPIPlugins;
...@@ -56,7 +51,7 @@ public: ...@@ -56,7 +51,7 @@ public:
public: public:
RemoveRedEyesWindow(Interface* const interface); RemoveRedEyesWindow();
~RemoveRedEyesWindow(); ~RemoveRedEyesWindow();
Q_SIGNALS: Q_SIGNALS:
......
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