Skip to content

Commit

Permalink
Insert dropped uris in reverse order.
Browse files Browse the repository at this point in the history
As each one is inserted on top of previous,
this result in layers sorted alphabeticaly in layer tree.
Relate with #6828.
  • Loading branch information
arnaud-morvan authored and m-kuhn committed Aug 12, 2017
1 parent e34a593 commit 97d168e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -1565,8 +1565,11 @@ void QgisApp::unregisterCustomDropHandler( QgsCustomDropHandler *handler )

void QgisApp::handleDropUriList( const QgsMimeDataUtils::UriList &lst )
{
Q_FOREACH ( const QgsMimeDataUtils::Uri &u, lst )
// insert items in reverse order as each one is inserted on top of previous one
for ( int i = lst.size() - 1 ; i >= 0 ; i-- )
{
const QgsMimeDataUtils::Uri &u = lst.at( i );

QString uri = crsAndFormatAdjustedLayerUri( u.uri, u.supportedCrs, u.supportedFormats );

if ( u.layerType == QLatin1String( "vector" ) )
Expand Down

0 comments on commit 97d168e

Please sign in to comment.