enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-devel] Windows enigmarc location suggestion w/ code


From: Tacvek
Subject: [Enigma-devel] Windows enigmarc location suggestion w/ code
Date: Fri, 17 Oct 2003 22:58:53 -0400

I belive that trying to place the file in HOME should have a higher priority
than placing it in application data. In my system i have a HOME enfironment
varable defined because i work with many *nix tools. I liked having
'~/.enimarc', especially since appliction files is a hidden folder on XP.

The code needed requires two changes, one that lets the program save to
~/.enigmarc if the HOME environment varable exists, the other change has
that file executed last making that the most 'valid' file. Neither of these
changes should affect any system that does not define HOME or non windows
systems.

Here is the code (sorry it is not a diff, but I never know which settings to
use).

bool
options::Load ()
{
    string fname;
    bool error = false;

    fname = System_ConfigurationFileName();
    error |= load_from_file (fname.c_str());

#ifdef __MINGW32__
    fname  = Windows_ConfigurationFileName();
    error |= load_from_file (fname.c_str());
#endif

    fname = Personal_ConfigurationFileName();
    error |= load_from_file (fname.c_str());

    LevelStatusChanged = false;

    return error;
}

bool
options::Save ()
{
#ifdef __MINGW32__
     if (getenv ("HOME") != 0)
        string fname = Windows_ConfigurationFileName();
    else
        string fname = Personal_ConfigurationFileName();
#else
    string fname = Personal_ConfigurationFileName();
#endif
/* Code cut to reduce email size */
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]