Skip to content
Permalink
Browse files

[welcome page] fix sorting of recent projects on startup

  • Loading branch information
nirvn committed Sep 8, 2015
1 parent b006298 commit 4c81803ea75e116b4a8a66990fda46a0a24a2403
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();
@@ -10759,4 +10767,3 @@ LONG WINAPI QgisApp::qgisCrashDump( struct _EXCEPTION_POINTERS *ExceptionInfo )
return EXCEPTION_EXECUTE_HANDLER;
}
#endif

0 comments on commit 4c81803

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