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

factoring

parent 0f33e238
...@@ -58,11 +58,11 @@ public: ...@@ -58,11 +58,11 @@ public:
ImgurWidget* widget; ImgurWidget* widget;
}; };
ImgurWindow::ImgurWindow(Interface* const interface, QWidget* const /*parent*/) ImgurWindow::ImgurWindow(QWidget* const /*parent*/)
: KPToolDialog(0), d(new ImgurWindowPriv) : KPToolDialog(0), d(new ImgurWindowPriv)
{ {
d->widget = new ImgurWidget(this); d->widget = new ImgurWidget(this);
d->webService = new ImgurTalker(interface, this); d->webService = new ImgurTalker(iface(), this);
setMainWidget(d->widget); setMainWidget(d->widget);
setWindowIcon(KIcon("imgur")); setWindowIcon(KIcon("imgur"));
......
...@@ -60,7 +60,7 @@ class ImgurWindow : public KPToolDialog ...@@ -60,7 +60,7 @@ class ImgurWindow : public KPToolDialog
public: public:
ImgurWindow(Interface* const interface, QWidget* const parent = 0); ImgurWindow(QWidget* const parent = 0);
~ImgurWindow(); ~ImgurWindow();
void reactivate(); void reactivate();
......
...@@ -108,17 +108,10 @@ void Plugin_ImgurExport::setup(QWidget* widget) ...@@ -108,17 +108,10 @@ void Plugin_ImgurExport::setup(QWidget* widget)
void Plugin_ImgurExport::slotActivate() void Plugin_ImgurExport::slotActivate()
{ {
Interface* interface = dynamic_cast<Interface*>(parent());
if (!interface)
{
kError() << "Kipi interface is null!" ;
return;
}
if (!d->winExport) if (!d->winExport)
{ {
// We clean it up in the close button // We clean it up in the close button
d->winExport = new ImgurWindow(interface, kapp->activeWindow()); d->winExport = new ImgurWindow(kapp->activeWindow());
} }
else 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