- Fixed loading/saving of config on win32. I know it's mainly my fault (I forgot to do an up yesterday night), but ever heard the ancient maxim 'Premature optimization is the root of all evil'?

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1189 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-09-16 11:46:19 +00:00
parent deaf0702e5
commit f174524b1e
2 changed files with 6 additions and 6 deletions

View File

@ -45,7 +45,7 @@ GlobalPreferences::GlobalPreferences()
{} {}
const Glib::ustring& Glib::ustring
GlobalPreferences::get_preferences_dir() const throw(Glib::FileError) GlobalPreferences::get_preferences_dir() const throw(Glib::FileError)
{ {
using namespace Glib; using namespace Glib;
@ -91,7 +91,7 @@ GlobalPreferences::get_preferences_dir() const throw(Glib::FileError)
#else #else
static const ustring dir = get_home_dir() + G_DIR_SEPARATOR_S + ".sgpemv2"; const ustring dir = get_home_dir() + G_DIR_SEPARATOR_S + ".sgpemv2";
if(!file_test(dir, FILE_TEST_IS_DIR)) if(!file_test(dir, FILE_TEST_IS_DIR))
{ {
const int err = g_mkdir(dir.c_str(), 0755); const int err = g_mkdir(dir.c_str(), 0755);
@ -104,10 +104,10 @@ GlobalPreferences::get_preferences_dir() const throw(Glib::FileError)
} }
const Glib::ustring& Glib::ustring
GlobalPreferences::get_config_filename() const throw(Glib::FileError) GlobalPreferences::get_config_filename() const throw(Glib::FileError)
{ {
static const Glib::ustring filename = get_preferences_dir() + G_DIR_SEPARATOR_S + Glib::ustring("sgpemrc"); const Glib::ustring filename = get_preferences_dir() + G_DIR_SEPARATOR_S + Glib::ustring("sgpemrc");
return filename; return filename;
} }

View File

@ -57,7 +57,7 @@ namespace sgpem
/** /**
\return GlobalPreferences configuration filename \return GlobalPreferences configuration filename
*/ */
const Glib::ustring& get_config_filename() const throw(Glib::FileError); Glib::ustring get_config_filename() const throw(Glib::FileError);
/** /**
\brief Returns configured Policy directories \brief Returns configured Policy directories
@ -128,7 +128,7 @@ namespace sgpem
* %ApplicationData%/sgpemv2, on *nix systems $HOME/.sgpemv2. * %ApplicationData%/sgpemv2, on *nix systems $HOME/.sgpemv2.
* If it doesn't exist, attempt to create it. * If it doesn't exist, attempt to create it.
*/ */
const Glib::ustring& get_preferences_dir() const throw(Glib::FileError); Glib::ustring get_preferences_dir() const throw(Glib::FileError);
private: private:
GlobalPreferences(); GlobalPreferences();