Skip to content

Commit 9d80e9d

Browse files
author
jef
committed
fix drag & drop to legend
git-svn-id: http://svn.osgeo.org/qgis/trunk@11713 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 51024aa commit 9d80e9d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/app/qgisapp.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -510,21 +510,21 @@ void QgisApp::dropEvent( QDropEvent *event )
510510
QList<QUrl>urls = event->mimeData()->urls();
511511
for ( i = urls.begin(); i != urls.end(); i++ )
512512
{
513-
QUrl mUrl = *i;
513+
QString fileName = i->toLocalFile();
514514
// seems that some drag and drop operations include an empty url
515515
// so we test for length to make sure we have something
516-
if ( mUrl.path().length() > 0 )
516+
if ( !fileName.isEmpty() )
517517
{
518518
// check to see if we are opening a project file
519-
QFileInfo fi( mUrl.path() );
519+
QFileInfo fi( fileName );
520520
if ( fi.completeSuffix() == "qgs" )
521521
{
522-
QgsDebugMsg( "Opening project " + mUrl.path() );
522+
QgsDebugMsg( "Opening project " + fileName );
523523
}
524524
else
525525
{
526-
QgsDebugMsg( "Adding " + mUrl.path() + " to the map canvas" );
527-
openLayer( mUrl.path() );
526+
QgsDebugMsg( "Adding " + fileName + " to the map canvas" );
527+
openLayer( fileName );
528528
}
529529
}
530530
}

0 commit comments

Comments
 (0)