- Cleanup GlobalPreferences badly cluttered interface, removing

deprecated methods and things that don't exist in the design
- Put the ``sgpemrc'' application configuration file into
the proper place (``$HOME/.sgpemv2''), creating the directory
if it doesn't exist, as per specs
- Disable test-global_preferences_serialization building since
it doesn't work with the new interface (todo: create a class inheriting 
from GlobalPreferences, and redefining get_config_filename() to return
a tmpname to a mkfifo() pipe connected to the stdout. If you don't understand 
a word of this, you're not a Real Unix Programmer(tm))
- Update other files to use the new interface


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1178 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-09-15 21:31:31 +00:00
parent bd1b8f879b
commit 93feee1ee5
8 changed files with 79 additions and 124 deletions

View file

@ -72,8 +72,8 @@ PythonCPUPolicyManager::PythonCPUPolicyManager()
GlobalPreferences& prefs = GlobalPreferences::get_instance();
Glib::ustring importdirs = "import sys\n"
"sys.path[:0] = [ ";
for_each(prefs.policies_dir_begin(),
prefs.policies_dir_end(),
for_each(prefs.get_policy_dirs().begin(),
prefs.get_policy_dirs().end(),
pol_dirs_concat(importdirs));
importdirs += " '" SHAREDIR "' ]\n";
@ -101,8 +101,8 @@ void
PythonCPUPolicyManager::collect_policies()
{
GlobalPreferences& prefs = GlobalPreferences::get_instance();
GlobalPreferences::dir_iterator dir_it = prefs.policies_dir_begin();
GlobalPreferences::dir_iterator dir_end = prefs.policies_dir_end();
GlobalPreferences::DirVectorIt dir_it = prefs.get_policy_dirs().begin();
GlobalPreferences::DirVectorIt dir_end = prefs.get_policy_dirs().end();
for (; dir_it != dir_end; ++dir_it)
{

View file

@ -65,8 +65,11 @@ main(int argc, char** argv)
exit(-1);
}
else
{
// Add argv[1] as the directory to search for uninstalled policies
sgpem::GlobalPreferences::get_instance().add_policies_dir(argv[1]);
GlobalPreferences::DirVector& pol_dirs = GlobalPreferences::get_instance().get_policy_dirs();
pol_dirs.insert(pol_dirs.begin(), argv[1]);
}
// Self-register itself to PoliciesGatekeeper, however we don't care about it
PythonCPUPolicyManager polman;