Skip to content

Commit 0796df0

Browse files
committedFeb 4, 2016
Fix crash with "add selected layers" from browser (fix #14223)
1 parent 2566061 commit 0796df0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/app/qgsbrowserdockwidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ void QgsBrowserDockWidget::addSelectedLayers()
577577
qSort( list );
578578

579579
// If any of the layer items are QGIS we just open and exit the loop
580-
for ( int i = 0; i <= list.size(); i++ )
580+
Q_FOREACH ( const QModelIndex& index, list )
581581
{
582-
QgsDataItem *item = mModel->dataItem( mProxyModel->mapToSource( list[i] ) );
582+
QgsDataItem *item = mModel->dataItem( mProxyModel->mapToSource( index ) );
583583
if ( item && item->type() == QgsDataItem::Project )
584584
{
585585
QgsProjectItem *projectItem = qobject_cast<QgsProjectItem*>( item );

0 commit comments

Comments
 (0)
Please sign in to comment.