Skip to content
Permalink
Browse files

Insert dropped uris in reverse order.

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 May 11, 2017
1 parent e34a593 commit 97d168e163ed5c31de6f841d64d333a3a98df88e
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/app/qgisapp.cpp
@@ -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" ) )

0 comments on commit 97d168e

Please sign in to comment.
You can’t perform that action at this time.