[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Sat Dec 19 00:16:02 CET 2009
SVN commit 1063635 by jmhoffmann:
krazy fixes: use QPointer when showing modal dialogs via exec as
discussed in http://www.kdedevelopers.org/node/3919.
M +11 -8 MarbleModel.cpp
M +5 -3 MarbleWidgetPopupMenu.cpp
M +5 -4 TinyWebBrowser.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1063634:1063635
@@ -16,6 +16,7 @@
#include <cmath>
#include <QtCore/QAtomicInt>
+#include <QtCore/QPointer>
#include <QtCore/QTime>
#include <QtCore/QTimer>
#include <QtCore/QAbstractItemModel>
@@ -355,11 +356,12 @@
installMap,
(role == "dem") ? "true" : "false" );
- TileCreatorDialog tileCreatorDlg( tileCreator, 0 );
- tileCreatorDlg.setSummary( d->m_mapTheme->head()->name(),
- d->m_mapTheme->head()->description() );
- tileCreatorDlg.exec();
+ QPointer<TileCreatorDialog> tileCreatorDlg = new TileCreatorDialog( tileCreator, 0 );
+ tileCreatorDlg->setSummary( d->m_mapTheme->head()->name(),
+ d->m_mapTheme->head()->description() );
+ tileCreatorDlg->exec();
qDebug("Tile creation completed");
+ delete tileCreatorDlg;
}
d->m_tileLoader->setLayer( layer );
}
@@ -826,11 +828,12 @@
installMap,
(role == "dem") ? "true" : "false" );
- TileCreatorDialog tileCreatorDlg( tileCreator, 0 );
- tileCreatorDlg.setSummary( d->m_mapTheme->head()->name(),
- d->m_mapTheme->head()->description() );
- tileCreatorDlg.exec();
+ QPointer<TileCreatorDialog> tileCreatorDlg = new TileCreatorDialog( tileCreator, 0 );
+ tileCreatorDlg->setSummary( d->m_mapTheme->head()->name(),
+ d->m_mapTheme->head()->description() );
+ tileCreatorDlg->exec();
qDebug("Tile creation completed");
+ delete tileCreatorDlg;
}
}
}
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidgetPopupMenu.cpp #1063634:1063635
@@ -24,6 +24,7 @@
// Qt
#include <QtCore/QMimeData>
+#include <QtCore/QPointer>
#include <QtGui/QAction>
#include <QtGui/QClipboard>
#include <QtGui/QMenu>
@@ -161,9 +162,10 @@
if ( actionidx > 0 ) {
QModelIndex index = m_featurelist.at( actionidx -1 );
- PlacemarkInfoDialog dialog( index, m_widget );
- dialog.setWindowModality( Qt::WindowModal );
- dialog.exec();
+ QPointer<PlacemarkInfoDialog> dialog = new PlacemarkInfoDialog( index, m_widget );
+ dialog->setWindowModality( Qt::WindowModal );
+ dialog->exec();
+ delete dialog;
}
}
--- trunk/KDE/kdeedu/marble/src/lib/TinyWebBrowser.cpp #1063634:1063635
@@ -79,11 +79,12 @@
void TinyWebBrowser::print()
{
#ifndef QT_NO_PRINTER
- QPrinter printer;
+ QPrinter printer;
- QPrintDialog dlg( &printer, this );
- if ( dlg.exec() )
- QWebView::print( &printer );
+ QPointer<QPrintDialog> dlg = new QPrintDialog( &printer, this );
+ if ( dlg->exec() )
+ QWebView::print( &printer );
+ delete dlg;
#endif
}
More information about the Marble-commits
mailing list