X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fsettings.cpp;h=de2c708b5365777e2a2710c0d899c01035ed8624;hb=5f937f1d74ccc6dc54f876e62cdea574e7cb56bf;hp=a22e6a6e18ea6d0df892a7a03cbfc0fa523394f3;hpb=c6af6e1c3816eb3b15c573089b32e6ae65cd2f49;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/settings.cpp b/synfig-studio/trunk/src/synfigapp/settings.cpp index a22e6a6..de2c708 100644 --- a/synfig-studio/trunk/src/synfigapp/settings.cpp +++ b/synfig-studio/trunk/src/synfigapp/settings.cpp @@ -2,10 +2,11 @@ /*! \file settings.cpp ** \brief Template File ** -** $Id: settings.cpp,v 1.2 2005/01/12 04:08:32 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -129,6 +130,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 +168,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; } @@ -178,7 +195,8 @@ Settings::save_to_file(const synfig::String& filename)const for(iter=key_list.begin();iter!=key_list.end();++iter) { if(!file)return false; - file<<*iter<<'='<