Skip to content

Commit

Permalink
use browser objectName in settings key to distinguish browser2
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Nov 10, 2014
1 parent 1018c91 commit 73231d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app/qgsbrowserdockwidget.cpp
Expand Up @@ -309,7 +309,7 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
mBrowserView->header()->setStretchLastSection( false );

QSettings settings;
QString lastPath = settings.value( "/BrowserWidget/lastExpanded" ).toString();
QString lastPath = settings.value( "/" + objectName().toLower() + "/lastExpanded" ).toString();

// expand root favourites item
for ( int i = 0; i < mModel->rowCount(); i++ )
Expand All @@ -327,7 +327,7 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
expandPath( lastPath );
// save again lastExpanded because QTreeView expands items from deepest and last expanded() signal
// is called from highest item and that is stored in settings
settings.setValue( "/BrowserWidget/lastExpanded", lastPath );
settings.setValue( "/" + objectName().toLower() + "/lastExpanded", lastPath );
}
}

Expand Down Expand Up @@ -702,8 +702,7 @@ void QgsBrowserDockWidget::itemExpanded( const QModelIndex& index )
if ( !item )
return;

// TODO: save separately each type (FS, WMS)?
settings.setValue( "/BrowserWidget/lastExpanded", item->path() );
settings.setValue( "/" + objectName().toLower() + "/lastExpanded", item->path() );
QgsDebugMsg( "last expanded: " + item->path() );
}

Expand Down

0 comments on commit 73231d9

Please sign in to comment.