X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fsynfigapp%2Fsettings.cpp;h=70be8bd7a0af51c3d5320cc8330d28da719638fa;hb=e409c0699e0a3ff57d7e25fcb0d4042a5826dfa7;hp=06690a3d70d5c6a085f4bc937aaec4da84186eed;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/synfigapp/settings.cpp b/synfig-studio/trunk/src/synfigapp/settings.cpp index 06690a3..70be8bd 100644 --- a/synfig-studio/trunk/src/synfigapp/settings.cpp +++ b/synfig-studio/trunk/src/synfigapp/settings.cpp @@ -1,20 +1,21 @@ /* === S Y N F I G ========================================================= */ -/*! \file template.cpp +/*! \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 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -90,7 +91,7 @@ Settings::get_value(const synfig::String& key, synfig::String& value)const if(key.size()>iter->first.size() && String(key.begin(),key.begin()+iter->first.size())==iter->first) { synfig::String key_(key.begin()+iter->first.size()+1,key.end()); - + // If the domain has it, then we have got a hit if(iter->second->get_value(key_,value)) return true; @@ -103,7 +104,7 @@ Settings::get_value(const synfig::String& key, synfig::String& value)const value=simple_value_map.find(key)->second; return true; } - + // key not found return false; } @@ -119,7 +120,7 @@ Settings::set_value(const synfig::String& key,const synfig::String& value) if(key.size()>iter->first.size() && String(key.begin(),key.begin()+iter->first.size())==iter->first) { synfig::String key_(key.begin()+iter->first.size()+1,key.end()); - + return iter->second->set_value(key_,value); } } @@ -144,7 +145,7 @@ Settings::get_key_list()const key_list.push_back(iter->first+'.'+*key_iter); } } - + // Get keys from the simple variables { ValueBaseMap::const_iterator iter; @@ -154,7 +155,7 @@ Settings::get_key_list()const // Sort the keys key_list.sort(); - + return key_list; } @@ -162,15 +163,15 @@ bool Settings::save_to_file(const synfig::String& filename)const { synfig::String tmp_filename(filename+".TMP"); - + try { std::ofstream file(tmp_filename.c_str()); if(!file)return false; - + KeyList key_list(get_key_list()); - + // Save the keys { KeyList::const_iterator iter; @@ -180,15 +181,15 @@ Settings::save_to_file(const synfig::String& filename)const file<<*iter<<'='<