From: divverent Date: Wed, 29 Apr 2009 16:35:28 +0000 (+0000) Subject: always sort game descriptions by displayed name X-Git-Tag: svn-r421~63 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a1f2938c756ee50f781572031a383e737e51d95f;p=xonotic%2Fnetradiant.git always sort game descriptions by displayed name git-svn-id: svn://svn.icculus.org/netradiant/trunk@357 61c419a2-8eb2-4b30-bcec-8cead039b335 --- diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 5302c375..a691d812 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -461,7 +461,21 @@ void CGameDialog::Init() ScanForGames(); if (mGames.empty()) { - Error("Didn't find any valid game file descriptions, aborting\n"); + Error("Didn't find any valid game file descriptions, aborting\n"); + } + else + { + std::list::iterator iGame, iPrevGame; + for(iGame=mGames.begin(), iPrevGame = mGames.end(); iGame!=mGames.end(); iPrevGame = iGame, ++iGame) + { + if(iPrevGame != mGames.end()) + if(strcmp((*iGame)->getRequiredKeyValue("name"), (*iPrevGame)->getRequiredKeyValue("name")) < 0) + { + CGameDescription *h = *iGame; + *iGame = *iPrevGame; + *iPrevGame = h; + } + } } CGameDescription* currentGameDescription = 0;