[QGIS Commit] r12711 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Jan 8 15:45:30 EST 2010


Author: timlinux
Date: 2010-01-08 15:45:28 -0500 (Fri, 08 Jan 2010)
New Revision: 12711

Modified:
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/app/qgisapp.h
Log:
Fix issue where gps tracker was not being restored properly on subsequent qgis launches. Also wrapped some more conditional qwt bits

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2010-01-08 19:25:30 UTC (rev 12710)
+++ trunk/qgis/src/app/qgisapp.cpp	2010-01-08 20:45:28 UTC (rev 12711)
@@ -330,8 +330,11 @@
     : QMainWindow( parent, fl ),
     mSplash( splash ),
     mPythonConsole( NULL ),
-    mPythonUtils( NULL ),
+    mPythonUtils( NULL )
+#ifdef HAVE_QWT
+    ,
     mpGpsWidget( NULL )
+#endif
 {
   if ( smInstance )
   {
@@ -2080,15 +2083,7 @@
   // Persist the list
   settings.setValue( "/UI/recentProjectsList", mRecentProjectPaths );
 
-  // Persist state of GPS Tracker
-  if ( mpGpsWidget )
-  {
-    settings.setValue( "/gps/widgetEnabled", true );
-  }
-  else
-  {
-    settings.setValue( "/gps/widgetEnabled", false );
-  }
+
   // Update menu list of paths
   updateRecentProjectPaths();
 
@@ -2104,6 +2099,19 @@
   // store window geometry
   settings.setValue( "/UI/geometry", saveGeometry() );
 
+#if HAVE_QWT
+  // Persist state of GPS Tracker
+  if ( mpGpsWidget )
+  {
+    settings.setValue( "/gps/widgetEnabled", true );
+    delete mpGpsWidget;
+  }
+  else
+  {
+    settings.setValue( "/gps/widgetEnabled", false );
+  }
+#endif
+
   QgsPluginRegistry::instance()->unloadAll();
 }
 
@@ -2134,18 +2142,6 @@
     QgsDebugMsg( "restore of UI geometry failed" );
   }
 
-#ifdef HAVE_QWT
-  // Persist state of GPS Tracker
-  if ( mpGpsWidget )
-  {
-    settings.setValue( "/gps/widgetEnabled", true );
-    delete mpGpsWidget;
-  }
-  else
-  {
-    settings.setValue( "/gps/widgetEnabled", false );
-  }
-#endif
 }
 ///////////// END OF GUI SETUP ROUTINES ///////////////
 

Modified: trunk/qgis/src/app/qgisapp.h
===================================================================
--- trunk/qgis/src/app/qgisapp.h	2010-01-08 19:25:30 UTC (rev 12710)
+++ trunk/qgis/src/app/qgisapp.h	2010-01-08 20:45:28 UTC (rev 12711)
@@ -70,7 +70,9 @@
 #include "qgsconfig.h"
 #include "qgsfeature.h"
 #include "qgspoint.h"
+#ifdef HAVE_QWT
 class QgsGPSInformationWidget;
+#endif
 
 /*! \class QgisApp
  * \brief Main window for the Qgis application
@@ -902,7 +904,9 @@
     // docks ------------------------------------------
     QDockWidget *mLegendDock;
     QDockWidget *mOverviewDock;
+#ifdef HAVE_QWT
     QDockWidget *mpGpsDock;
+#endif
 
 #ifdef Q_WS_MAC
     //! Window menu action to select this window
@@ -1050,9 +1054,10 @@
 
     int mLastComposerId;
 
+#ifdef HAVE_QWT
     //! Persistent GPS toolbox
     QgsGPSInformationWidget * mpGpsWidget;
-
+#endif
     //! project changed
     void projectChanged( const QDomDocument & );
 };



More information about the QGIS-commit mailing list