Fixed profile selection always in random order

This commit is contained in:
Mark Watkins 2013-10-20 21:00:55 +10:00
parent 1ce3423f8c
commit fc601fc7ef
3 changed files with 4 additions and 4 deletions

View File

@ -434,14 +434,14 @@ QString SHA1(QString pass)
namespace Profiles namespace Profiles
{ {
QHash<QString,Profile *> profiles; QMap<QString,Profile *> profiles;
void Done() void Done()
{ {
PREF.Save(); PREF.Save();
LAYOUT.Save(); LAYOUT.Save();
// Only save the open profile.. // Only save the open profile..
for (QHash<QString,Profile *>::iterator i=profiles.begin(); i!=profiles.end(); i++) { for (QMap<QString,Profile *>::iterator i=profiles.begin(); i!=profiles.end(); i++) {
i.value()->Save(); i.value()->Save();
delete i.value(); delete i.value();
} }

View File

@ -630,7 +630,7 @@ public:
namespace Profiles namespace Profiles
{ {
extern QHash<QString,Profile *> profiles; extern QMap<QString,Profile *> profiles;
void Scan(); // Initialize and load Profile void Scan(); // Initialize and load Profile
void Done(); // Save all Profile objects and clear list void Done(); // Save all Profile objects and clear list

View File

@ -32,7 +32,7 @@ ProfileSelect::ProfileSelect(QWidget *parent) :
QString name; QString name;
QIcon icon(":/icons/moon.png"); QIcon icon(":/icons/moon.png");
for (QHash<QString,Profile *>::iterator p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) { for (QMap<QString,Profile *>::iterator p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) {
name=p.key(); name=p.key();
QStandardItem *item=new QStandardItem(icon,name); QStandardItem *item=new QStandardItem(icon,name);