summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authoradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-12 17:14:09 +0000
committeradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-12 17:14:09 +0000
commite3ded2f37091e1fc8c8f988fb98c21020fee2261 (patch)
tree64ec1c62ea19b679de294844f23a052001f9765f /src/mainwindow.cpp
parentupdated CMakeLists.txt (diff)
downloadrekonq-e3ded2f37091e1fc8c8f988fb98c21020fee2261.tar.xz
Last krazy issues fixed
git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@967142 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5ffaa208..adc6fc87 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -68,6 +68,7 @@
#include <QtCore/QRect>
#include <QtCore/QSize>
#include <QtCore/QList>
+#include <QtCore/QPointer>
#include <QtGui/QWidget>
#include <QtGui/QVBoxLayout>
@@ -497,12 +498,13 @@ void MainWindow::slotPreferences()
return;
// we didn't find an instance of this dialog, so lets create it
- SettingsDialog *s = new SettingsDialog(this);
+ QPointer<SettingsDialog> s = new SettingsDialog(this);
// keep us informed when the user changes settings
connect(s, SIGNAL(settingsChanged(const QString&)), this, SLOT(slotUpdateBrowser()));
s->exec();
+ delete s;
}
@@ -571,9 +573,13 @@ void MainWindow::printRequested(QWebFrame *frame)
{
QPrinter printer;
- QPrintDialog *dialog = KdePrint::createPrintDialog(&printer, this);
+ QPointer<QPrintDialog> dialog = KdePrint::createPrintDialog(&printer, this);
if (dialog->exec() != QDialog::Accepted)
+ {
+ delete dialog;
return;
+ }
+ delete dialog;
frame->print(&printer);
}
@@ -946,4 +952,3 @@ QAction *MainWindow::actionByName(const QString name)
return new QAction(this); // return empty object instead of NULL pointer
}
-