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

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Sep 26 03:35:22 EDT 2009


Author: jef
Date: 2009-09-26 03:35:20 -0400 (Sat, 26 Sep 2009)
New Revision: 11713

Modified:
   trunk/qgis/src/app/qgisapp.cpp
Log:
fix drag & drop to legend

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2009-09-25 14:24:52 UTC (rev 11712)
+++ trunk/qgis/src/app/qgisapp.cpp	2009-09-26 07:35:20 UTC (rev 11713)
@@ -510,21 +510,21 @@
   QList<QUrl>urls = event->mimeData()->urls();
   for ( i = urls.begin(); i != urls.end(); i++ )
   {
-    QUrl mUrl = *i;
+    QString fileName = i->toLocalFile();
     // seems that some drag and drop operations include an empty url
     // so we test for length to make sure we have something
-    if ( mUrl.path().length() > 0 )
+    if ( !fileName.isEmpty() )
     {
       // check to see if we are opening a project file
-      QFileInfo fi( mUrl.path() );
+      QFileInfo fi( fileName );
       if ( fi.completeSuffix() == "qgs" )
       {
-        QgsDebugMsg( "Opening project " + mUrl.path() );
+        QgsDebugMsg( "Opening project " + fileName );
       }
       else
       {
-        QgsDebugMsg( "Adding " + mUrl.path() + " to the map canvas" );
-        openLayer( mUrl.path() );
+        QgsDebugMsg( "Adding " + fileName + " to the map canvas" );
+        openLayer( fileName );
       }
     }
   }



More information about the QGIS-commit mailing list