From 976e5da32d8b20f054abf4cf2895ae466bcc7370 Mon Sep 17 00:00:00 2001 From: dooglus Date: Wed, 4 Apr 2007 19:31:26 +0000 Subject: [PATCH] Fix 1694393: save 'pref.*' keys first, so the window manager hint preference is loaded before saved dialogs are created. git-svn-id: http://svn.voria.com/code@423 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/synfigapp/settings.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/synfig-studio/trunk/src/synfigapp/settings.cpp b/synfig-studio/trunk/src/synfigapp/settings.cpp index 70be8bd..73d927f 100644 --- a/synfig-studio/trunk/src/synfigapp/settings.cpp +++ b/synfig-studio/trunk/src/synfigapp/settings.cpp @@ -129,6 +129,19 @@ Settings::set_value(const synfig::String& key,const synfig::String& value) return true; } +//! Compare two key names, putting pref.* keys first +static bool +compare_pref_first (synfig::String first, synfig::String second) +{ + return first.substr(0, 5) == "pref." + ? second.substr(0, 5) == "pref." + ? first < second + : true + : second.substr(0, 5) == "pref." + ? false + : first < second; +} + Settings::KeyList Settings::get_key_list()const { @@ -154,7 +167,10 @@ Settings::get_key_list()const } // Sort the keys - key_list.sort(); + // We make sure the 'pref.*' keys come first to fix bug 1694393, + // where windows were being created before the parameter + // specifying which window manager hint to use had been loaded + key_list.sort(compare_pref_first); return key_list; } -- 2.7.4