[Marble-commits] KDE/kdeedu/marble/src
Bastian Holst
bastianholst at gmx.de
Tue Apr 6 11:07:02 CEST 2010
SVN commit 1111614 by bholst:
Fixing marble krazy2 issues:
* fix crashy usage of modal dialogs
* using single quotes for setting a one char QString
* fixing foreach loop issues
* changing the name of some include guard defines to match the class name
M +8 -6 QtMainWindow.cpp
M +2 -2 lib/graphicsview/MarbleGraphicsItem.cpp
M +2 -2 lib/routing/OrsRoutingProvider.cpp
M +3 -3 lib/routing/RoutingInputWidget.h
M +3 -3 lib/routing/RoutingProxyModel.h
M +0 -1 lib/routing/RoutingWidget.cpp
M +3 -3 lib/routing/RoutingWidget.h
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1111613:1111614
@@ -427,12 +427,13 @@
{
#ifndef QT_NO_PRINTER
QPrinter printer( QPrinter::HighResolution );
- QPrintDialog printDialog( &printer, this );
+ QPointer<QPrintDialog> printDialog = new QPrintDialog( &printer, this );
- if (printDialog.exec() == QDialog::Accepted) {
+ if (printDialog->exec() == QDialog::Accepted) {
QPixmap mapPixmap = m_controlView->mapScreenShot();
printPixmap( &printer, mapPixmap );
}
+ delete printDialog;
#endif
}
@@ -463,10 +464,11 @@
#ifndef QT_NO_PRINTER
QPrinter printer( QPrinter::HighResolution );
- QPrintPreviewDialog preview( &printer, this );
- preview.setWindowFlags ( Qt::Window );
- connect( &preview, SIGNAL( paintRequested( QPrinter * ) ), SLOT( paintPrintPreview( QPrinter * ) ) );
- preview.exec();
+ QPointer<QPrintPreviewDialog> preview = new QPrintPreviewDialog( &printer, this );
+ preview->setWindowFlags ( Qt::Window );
+ connect( preview, SIGNAL( paintRequested( QPrinter * ) ), SLOT( paintPrintPreview( QPrinter * ) ) );
+ preview->exec();
+ delete preview;
#endif
}
--- trunk/KDE/kdeedu/marble/src/lib/graphicsview/MarbleGraphicsItem.cpp #1111613:1111614
@@ -286,14 +286,14 @@
if( p()->m_children ) {
QList<QPointF> absolutePositions = p()->absolutePositions();
- foreach( QPointF absolutePosition, absolutePositions ) {
+ foreach( const QPointF& absolutePosition, absolutePositions ) {
QPoint shiftedPos = event->pos() - absolutePosition.toPoint();
if ( QRect( QPoint( 0, 0 ), size().toSize() ).contains( shiftedPos ) ) {
foreach( MarbleGraphicsItem *child, *p()->m_children ) {
QList<QRectF> childRects = child->boundingRects();
- foreach( QRectF childRect, childRects ) {
+ foreach( const QRectF& childRect, childRects ) {
if( childRect.toRect().contains( shiftedPos ) ) {
if( child->eventFilter( object, e ) ) {
return true;
--- trunk/KDE/kdeedu/marble/src/lib/routing/OrsRoutingProvider.cpp #1111613:1111614
@@ -50,11 +50,11 @@
preference = "Shortest";
break;
case RouteSkeleton::Bicycle:
- unit = "M";
+ unit = 'M';
preference = "Bicycle";
break;
case RouteSkeleton::Pedestrian:
- unit = "M";
+ unit = 'M';
preference = "Pedestrian";
break;
}
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingInputWidget.h #1111613:1111614
@@ -8,8 +8,8 @@
// Copyright 2010 Dennis Nienhüser <earthwings at gentoo.org>
//
-#ifndef MARBLE_ROUTING_TARGET_INPUT_WIDGET_H
-#define MARBLE_ROUTING_TARGET_INPUT_WIDGET_H
+#ifndef ROUTINGINPUTWIDGET_H
+#define ROUTINGINPUTWIDGET_H
#include "GeoDataCoordinates.h"
@@ -143,4 +143,4 @@
} // namespace Marble
-#endif // MARBLE_ROUTING_TARGET_INPUT_WIDGET_H
+#endif // ROUTINGINPUTWIDGET_H
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingProxyModel.h #1111613:1111614
@@ -8,8 +8,8 @@
// Copyright 2010 Dennis Nienhüser <earthwings at gentoo.org>
//
-#ifndef MARBLE_ROUTING_DIRECTION_MODEL_H
-#define MARBLE_ROUTING_DIRECTION_MODEL_H
+#ifndef ROUTINGPROXYMODEL_H
+#define ROUTINGPROXYMODEL_H
#include <QtGui/QSortFilterProxyModel>
@@ -37,4 +37,4 @@
} // namespace Marble
-#endif // MARBLE_ROUTING_DIRECTION_MODEL_H
+#endif // ROUTINGPROXYMODEL_H
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.cpp #1111613:1111614
@@ -20,7 +20,6 @@
#include "RoutingModel.h"
#include "RoutingManager.h"
#include "RoutingLayer.h"
-#include "RoutingModel.h"
#include "RoutingProxyModel.h"
#include "RoutingInputWidget.h"
#include "RouteSkeleton.h"
--- trunk/KDE/kdeedu/marble/src/lib/routing/RoutingWidget.h #1111613:1111614
@@ -8,8 +8,8 @@
// Copyright 2010 Dennis Nienhüser <earthwings at gentoo.org>
//
-#ifndef MARBLE_ROUTING_WIDGET_H
-#define MARBLE_ROUTING_WIDGET_H
+#ifndef ROUTINGWIDGET_H
+#define ROUTINGWIDGET_H
#include "GeoDataCoordinates.h"
#include "GeoDataLineString.h"
@@ -95,4 +95,4 @@
} // namespace Marble
-#endif // MARBLE_ROUTING_WIDGET_H
+#endif // ROUTINGWIDGET_H
More information about the Marble-commits
mailing list