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

polish

Fix memory leak
parent f9739b2b
......@@ -44,12 +44,12 @@ namespace KIPIRajceExportPlugin
RajceWindow::RajceWindow(KIPI::Interface* interface, const QString& tmpFolder,
QWidget* /*parent*/, Qt::WFlags /*flags*/)
: KDialog(0), _interface(interface)
: KDialog(0), m_interface(interface)
{
_widget = new RajceWidget(interface, tmpFolder, this);
_widget->readSettings();
m_widget = new RajceWidget(interface, tmpFolder, this);
m_widget->readSettings();
setMainWidget(_widget);
setMainWidget(m_widget);
setWindowIcon(KIcon("rajce"));
setButtons(Help|User1|Close);
setDefaultButton(Close);
......@@ -58,28 +58,28 @@ RajceWindow::RajceWindow(KIPI::Interface* interface, const QString& tmpFolder,
setWindowTitle(i18n("Export to Rajce.net"));
setButtonGuiItem(User1, KGuiItem(i18n("Start Upload"), "network-workgroup",
i18n("Start upload to Rajce.net")));
_widget->setMinimumSize(700, 500);
m_widget->setMinimumSize(700, 500);
connect(this, SIGNAL(user1Clicked()),
_widget, SLOT(startUpload()));
m_widget, SLOT(startUpload()));
connect(this, SIGNAL(closeClicked()),
this, SLOT(slotClose()));
connect(_widget, SIGNAL(loginStatusChanged(bool)),
connect(m_widget, SIGNAL(loginStatusChanged(bool)),
this, SLOT(slotSetUploadButtonEnabled(bool)));
//--------------------------------------------------------------------
m_about = new KIPIPlugins::KPAboutData(ki18n("Rajce.net Export"),
0,
KAboutData::License_GPL,
ki18n("A Kipi plugin to export image collections to "
"Rajce.net."),
ki18n( "(c) 2011, Lukas Krejci" ));
0,
KAboutData::License_GPL,
ki18n("A Kipi plugin to export image collections to "
"Rajce.net."),
ki18n( "(c) 2011, Lukas Krejci" ));
m_about->addAuthor(ki18n( "Lukas Krejci" ), ki18n("Author and maintainer"),
"metlosh at gmail dot com");
m_about->addAuthor(ki18n( "Lukas Krejci" ), ki18n("Author and maintainer"),
"metlosh at gmail dot com");
disconnect(this, SIGNAL( helpClicked() ),
this, SLOT( showHelp()) );
......@@ -95,9 +95,14 @@ RajceWindow::RajceWindow(KIPI::Interface* interface, const QString& tmpFolder,
button(User1)->setEnabled(false);
}
RajceWindow::~RajceWindow()
{
delete m_about;
}
void RajceWindow::reactivate()
{
_widget->reactivate();
m_widget->reactivate();
show();
}
......@@ -113,8 +118,8 @@ void RajceWindow::slotSetUploadButtonEnabled(bool enabled)
void RajceWindow::slotClose()
{
_widget->cancelUpload();
_widget->writeSettings();
m_widget->cancelUpload();
m_widget->writeSettings();
}
} //namespace KIPIRajceExportPlugin
......@@ -48,6 +48,7 @@ class RajceWindow : public KDialog
public:
explicit RajceWindow(KIPI::Interface* interface, const QString& tmpFolder, QWidget* parent = 0, Qt::WFlags flags = 0);
~RajceWindow();
void reactivate();
......@@ -59,8 +60,8 @@ private Q_SLOTS:
private:
KIPI::Interface* _interface;
RajceWidget* _widget;
KIPI::Interface* m_interface;
RajceWidget* m_widget;
KIPIPlugins::KPAboutData* m_about;
};
......
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