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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Apr 14 07:13:54 EDT 2008


Author: jef
Date: 2008-04-14 07:13:53 -0400 (Mon, 14 Apr 2008)
New Revision: 8349

Modified:
   trunk/qgis/src/app/qgisapp.cpp
Log:
workaround for what seems to be a Qt problem with file:// urls on windows

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2008-04-14 06:53:30 UTC (rev 8348)
+++ trunk/qgis/src/app/qgisapp.cpp	2008-04-14 11:13:53 UTC (rev 8349)
@@ -178,6 +178,10 @@
 #include <dlfcn.h>
 #endif
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 using namespace std;
 class QTreeWidgetItem;
 
@@ -3783,7 +3787,6 @@
   mMapLegend->legendLayerZoom();
 }
 
-
 void QgisApp::showPluginManager()
 {
   QgsPluginManager *pm = new QgsPluginManager(this);
@@ -4293,6 +4296,11 @@
   OSStatus status = LSOpenCFURLRef(urlRef, NULL);
   status = 0; //avoid compiler warning
   CFRelease(urlRef);
+#elif defined(WIN32)
+  if(url.startsWith("file://", Qt::CaseInsensitive))
+    ShellExecute(0, 0, url.mid(7).toLocal8Bit().constData(), 0, 0, SW_SHOWNORMAL);
+  else
+    QDesktopServices::openUrl(url);
 #else
   QDesktopServices::openUrl(url);
 #endif



More information about the QGIS-commit mailing list