From 8e7ae730edbbe3643b3549b5fb35be5c278a714b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 11 Apr 2010 12:32:29 +0200 Subject: Removing overkilling WeakPointer from data clean dialog and fixing a memory leak there.. --- src/mainwindow.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') 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 dialog = new KDialog(this); - dialog.data()->setCaption(i18n("Clear Private Data")); - dialog.data()->setButtons(KDialog::Ok | KDialog::Cancel); + QPointer 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(); } -- cgit v1.2.1