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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Aug 21 03:11:51 EDT 2008


Author: telwertowski
Date: 2008-08-21 03:11:49 -0400 (Thu, 21 Aug 2008)
New Revision: 9106

Modified:
   trunk/qgis/src/app/main.cpp
Log:
Restore code to handle Mac double-click at startup which was dropped by r9092.


Modified: trunk/qgis/src/app/main.cpp
===================================================================
--- trunk/qgis/src/app/main.cpp	2008-08-21 06:54:20 UTC (rev 9105)
+++ trunk/qgis/src/app/main.cpp	2008-08-21 07:11:49 UTC (rev 9106)
@@ -156,18 +156,21 @@
       }
     }
 
+    // Open files now if application has been fully initialized (has objectName).
+    // Otherwise (if this routine is called by processEvents inside the QgisApp constructor 
+    // at startup) wait for the command line file loader to notice these files.
     QgisApp *qgis = QgisApp::instance();
-    if(qgis)
+    if (qgis && qgis->objectName() == "QgisApp")
     {
       if (!myProjectFileName.isEmpty())
       {
-	qgis->openProject(myProjectFileName);
+        qgis->openProject(myProjectFileName);
       }
       for (QStringList::Iterator myIterator = myFileList.begin();
 	  myIterator != myFileList.end(); ++myIterator ) 
       {
-	QString fileName = *myIterator;
-	qgis->openLayer(fileName);
+        QString fileName = *myIterator;
+        qgis->openLayer(fileName);
       }
     }
   }



More information about the QGIS-commit mailing list