[qlandkartegt/f15] fix crash with 3D map if no map is selected (#641545)

Dan Horák sharkcz at fedoraproject.org
Wed Jun 15 13:48:44 UTC 2011


commit 9dbefd25b22218e9d1221d13f24ecc29d3425fea
Author: Dan Horák <dan at danny.cz>
Date:   Wed Jun 15 15:48:31 2011 +0200

    fix crash with 3D map if no map is selected (#641545)

 qlandkartegt-1.1.2-3dmap-crash.patch |   62 ++++++++++++++++++++++++++++++++++
 qlandkartegt.spec                    |    8 ++++-
 2 files changed, 69 insertions(+), 1 deletions(-)
---
diff --git a/qlandkartegt-1.1.2-3dmap-crash.patch b/qlandkartegt-1.1.2-3dmap-crash.patch
new file mode 100644
index 0000000..7e7edad
--- /dev/null
+++ b/qlandkartegt-1.1.2-3dmap-crash.patch
@@ -0,0 +1,62 @@
+From 79b703ae007d5315cc882790e7d3b6fe25b187cd Mon Sep 17 00:00:00 2001
+From: kiozen <kiozen at 0913f4f3-0441-0410-8e4e-9da9205379dc>
+Date: Wed, 15 Jun 2011 13:09:07 +0000
+Subject: [PATCH] fix crash with 3D map if no map is selected
+
+git-svn-id: https://qlandkartegt.svn.sourceforge.net/svnroot/qlandkartegt/QLandkarteGT/trunk@2831 0913f4f3-0441-0410-8e4e-9da9205379dc
+---
+ src/CMapDB.cpp |   17 +++++++++++------
+ 1 files changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/src/CMapDB.cpp b/src/CMapDB.cpp
+index b844cf1..a573aca 100644
+--- a/src/CMapDB.cpp
++++ b/src/CMapDB.cpp
+@@ -70,6 +70,8 @@ CMapDB::CMapDB(QTabWidget * tb, QObject * parent)
+     m.type              = IMap::eTile;
+     knownMaps[m.key]    = m;
+ 
++    theMap = defaultMap;
++
+     QSettings cfg;
+     QString map;
+     QStringList maps = cfg.value("maps/knownMaps","").toString().split("|",QString::SkipEmptyParts);
+@@ -310,8 +312,8 @@ void CMapDB::openMap(const QString& filename, bool asRaster, CCanvas& canvas)
+     if(!fileDEM.isEmpty()) openDEM(fileDEM);
+ 
+ #ifdef PLOT_3D_NEW
+-    CMap3D * map3D = new CMap3D(theMap, theMainWindow->getCanvas());
+-    theMainWindow->getCanvasTab()->addTab(map3D, tr("Map 3D..."));
++//    CMap3D * map3D = new CMap3D(theMap, theMainWindow->getCanvas());
++//    theMainWindow->getCanvasTab()->addTab(map3D, tr("Map 3D..."));
+ #endif
+ 
+     emit sigChanged();
+@@ -387,8 +389,8 @@ void CMapDB::openMap(const QString& key)
+     }
+ 
+ #ifdef PLOT_3D_NEW
+-    CMap3D * map3D = new CMap3D(theMap, theMainWindow->getCanvas());
+-    theMainWindow->getCanvasTab()->addTab(map3D, tr("Map 3D..."));
++//    CMap3D * map3D = new CMap3D(theMap, theMainWindow->getCanvas());
++//    theMainWindow->getCanvasTab()->addTab(map3D, tr("Map 3D..."));
+ #endif
+ 
+     emit sigChanged();
+@@ -779,8 +781,11 @@ void CMapDB::show3DMap(bool show)
+ {
+     if(map3D.isNull() && show)
+     {
+-        map3D = new CMap3D(theMap, theMainWindow->getCanvas());
+-        theMainWindow->getCanvasTab()->addTab(map3D, tr("Map 3D..."));
++        if(!theMap.isNull())
++        {
++            map3D = new CMap3D(theMap, theMainWindow->getCanvas());
++            theMainWindow->getCanvasTab()->addTab(map3D, tr("Map 3D..."));
++        }
+     }
+     else if(!map3D.isNull() && !show)
+     {
+-- 
+1.7.4.4
+
diff --git a/qlandkartegt.spec b/qlandkartegt.spec
index d369770..e44ebf1 100644
--- a/qlandkartegt.spec
+++ b/qlandkartegt.spec
@@ -1,12 +1,14 @@
 Name: qlandkartegt
 Version: 1.1.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: GPS device mapping tool
 
 Group: Applications/Communications
 License: GPLv2+
 URL: http://www.qlandkarte.org/
 Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+# https://bugzilla.redhat.com/show_bug.cgi?id=641545
+Patch0: %{name}-1.1.2-3dmap-crash.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: garmindev(interface) = 1.18
 Requires: gpsbabel
@@ -45,6 +47,7 @@ GDAL tools, but it will simplify their use to the demands of most users.
 
 %prep
 %setup -q
+%patch0 -p1 -b .3dmap-crash
 
 # create build direcotory
 mkdir build
@@ -80,6 +83,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Wed Jun 15 2011 Dan Horák <dan[at]danny.cz> 1.1.2-2
+- fix crash with 3D map if no map is selected (#641545)
+
 * Mon May 23 2011 Dan Horák <dan[at]danny.cz> 1.1.2-1
 - update to 1.1.2
 


More information about the scm-commits mailing list