diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-11 12:32:29 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-11 12:32:29 +0200 |
commit | 8e7ae730edbbe3643b3549b5fb35be5c278a714b (patch) | |
tree | cf25ae2fe1bb7fc3eba92b30218413b5981149e4 | |
parent | Improved "Clear Private Data" dialog appearance (diff) | |
download | rekonq-8e7ae730edbbe3643b3549b5fb35be5c278a714b.tar.xz |
Removing overkilling WeakPointer from data clean dialog and fixing a
memory leak there..
-rw-r--r-- | src/mainwindow.cpp | 16 |
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(); } |