Browse Source

config: pick up fallback config file from system data dirs

bboozzoo/device-cache
Maciek Borzecki 10 years ago
parent
commit
908203adc9
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/config.vala

+ 7
- 2
src/config.vala View File

@ -28,9 +28,10 @@ public class Config : Object {
public static string[] config_search_dirs(string primary_dir) {
string[] dirs = {primary_dir};
string[] sysdirs = Environment.get_system_config_dirs();
string[] sysdirs = Environment.get_system_data_dirs();
foreach (string d in sysdirs) {
dirs += d.dup();
dirs += Path.build_path(Path.DIR_SEPARATOR_S,
d, "mconnect");
}
return dirs;
}
@ -41,6 +42,10 @@ public class Config : Object {
string[] dirs = config_search_dirs(base_config_dir);
string full_path = null;
foreach (string d in dirs) {
debug("config search dir: %s", d);
}
try {
bool found = _kf.load_from_dirs(Config.FILE, dirs,
out full_path,


Loading…
Cancel
Save