Skip to content
Permalink
Browse files

Merge pull request #2297 from nirvn/fix_recent_project_sort

[welcome page] fix sorting of recent projects on startup
  • Loading branch information
NathanW2 committed Sep 8, 2015
2 parents 94badce + 4c81803 commit c3a141551dd01c4b40e7404dfffca3313c99895d
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/app/qgisapp.cpp
@@ -1174,12 +1174,20 @@ void QgisApp::readSettings()
settings.endGroup();

settings.beginGroup( "/UI/recentProjects" );
QStringList projectKeys = settings.childGroups();
QStringList projectKeysList = settings.childGroups();

Q_FOREACH ( const QString& key, projectKeys )
//convert list to int values to obtain proper order
QList<int> projectKeys;
Q_FOREACH ( const QString& key, projectKeysList )
{
projectKeys.append( key.toInt() );
}
qSort( projectKeys );

Q_FOREACH ( const int& key, projectKeys )
{
QgsWelcomePageItemsModel::RecentProjectData data;
settings.beginGroup( key );
settings.beginGroup( QString::number( key ) );
data.title = settings.value( "title" ).toString();
data.path = settings.value( "path" ).toString();
data.previewImagePath = settings.value( "previewImage" ).toString();
@@ -10758,4 +10766,3 @@ LONG WINAPI QgisApp::qgisCrashDump( struct _EXCEPTION_POINTERS *ExceptionInfo )
return EXCEPTION_EXECUTE_HANDLER;
}
#endif

0 comments on commit c3a1415

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