Skip to content

Commit

Permalink
fix drag & drop to legend
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11713 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Sep 26, 2009
1 parent 70d7b84 commit 9e0408c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/qgisapp.cpp
Expand Up @@ -510,21 +510,21 @@ void QgisApp::dropEvent( QDropEvent *event )
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 );
}
}
}
Expand Down

0 comments on commit 9e0408c

Please sign in to comment.