summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-11 12:32:29 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-11 12:32:29 +0200
commit8e7ae730edbbe3643b3549b5fb35be5c278a714b (patch)
treecf25ae2fe1bb7fc3eba92b30218413b5981149e4 /src/mainwindow.cpp
parentImproved "Clear Private Data" dialog appearance (diff)
downloadrekonq-8e7ae730edbbe3643b3549b5fb35be5c278a714b.tar.xz
Removing overkilling WeakPointer from data clean dialog and fixing a
memory leak there..
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index c8794664..56b69cc6 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1169,20 +1169,20 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status)
void MainWindow::clearPrivateData()
{
- QWeakPointer<KDialog> dialog = new KDialog(this);
- dialog.data()->setCaption(i18n("Clear Private Data"));
- dialog.data()->setButtons(KDialog::Ok | KDialog::Cancel);
+ QPointer<KDialog> dialog = new KDialog(this);
+ dialog->setCaption(i18n("Clear Private Data"));
+ dialog->setButtons(KDialog::Ok | KDialog::Cancel);
- dialog.data()->button(KDialog::Ok)->setIcon(KIcon("edit-clear"));
- dialog.data()->button(KDialog::Ok)->setText(i18n("Clear"));
+ dialog->button(KDialog::Ok)->setIcon(KIcon("edit-clear"));
+ dialog->button(KDialog::Ok)->setText(i18n("Clear"));
Ui::ClearDataWidget clearWidget;
QWidget widget;
clearWidget.setupUi(&widget);
- dialog.data()->setMainWidget(&widget);
+ dialog->setMainWidget(&widget);
- if (dialog.data()->exec() == KDialog::Accepted)
+ if (dialog->exec() == KDialog::Ok)
{
if(clearWidget.clearHistory->isChecked())
{
@@ -1223,6 +1223,8 @@ void MainWindow::clearPrivateData()
}
}
}
+
+ dialog->deleteLater();
}