From fc601fc7ef38d15deeac503b543f176ca8dbc17a Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 20 Oct 2013 21:00:55 +1000 Subject: [PATCH] Fixed profile selection always in random order --- sleepyhead/SleepLib/profiles.cpp | 4 ++-- sleepyhead/SleepLib/profiles.h | 2 +- sleepyhead/profileselect.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sleepyhead/SleepLib/profiles.cpp b/sleepyhead/SleepLib/profiles.cpp index 564d6d45..e7720e3c 100644 --- a/sleepyhead/SleepLib/profiles.cpp +++ b/sleepyhead/SleepLib/profiles.cpp @@ -434,14 +434,14 @@ QString SHA1(QString pass) namespace Profiles { -QHash profiles; +QMap profiles; void Done() { PREF.Save(); LAYOUT.Save(); // Only save the open profile.. - for (QHash::iterator i=profiles.begin(); i!=profiles.end(); i++) { + for (QMap::iterator i=profiles.begin(); i!=profiles.end(); i++) { i.value()->Save(); delete i.value(); } diff --git a/sleepyhead/SleepLib/profiles.h b/sleepyhead/SleepLib/profiles.h index 27e0af2b..82174daa 100644 --- a/sleepyhead/SleepLib/profiles.h +++ b/sleepyhead/SleepLib/profiles.h @@ -630,7 +630,7 @@ public: namespace Profiles { -extern QHash profiles; +extern QMap profiles; void Scan(); // Initialize and load Profile void Done(); // Save all Profile objects and clear list diff --git a/sleepyhead/profileselect.cpp b/sleepyhead/profileselect.cpp index ffd0369d..8e626a2e 100644 --- a/sleepyhead/profileselect.cpp +++ b/sleepyhead/profileselect.cpp @@ -32,7 +32,7 @@ ProfileSelect::ProfileSelect(QWidget *parent) : QString name; QIcon icon(":/icons/moon.png"); - for (QHash::iterator p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) { + for (QMap::iterator p=Profiles::profiles.begin();p!=Profiles::profiles.end();p++) { name=p.key(); QStandardItem *item=new QStandardItem(icon,name);