1.1 --- a/org/sonews/config/Config.java Thu Aug 20 18:41:21 2009 +0200
1.2 +++ b/org/sonews/config/Config.java Sun Aug 29 17:03:21 2010 +0200
1.3 @@ -128,24 +128,20 @@
1.4 return val;
1.5 }
1.6
1.7 - public String get(int level, String key, String def)
1.8 + public String get(int maxLevel, String key, String def)
1.9 {
1.10 - switch(level)
1.11 + String val = CommandLineConfig.getInstance().get(key, null);
1.12 +
1.13 + if(val == null && maxLevel <= LEVEL_FILE)
1.14 {
1.15 - case LEVEL_CLI:
1.16 + val = FileConfig.getInstance().get(key, null);
1.17 + if(val == null && maxLevel <= LEVEL_BACKEND)
1.18 {
1.19 - return CommandLineConfig.getInstance().get(key, def);
1.20 - }
1.21 - case LEVEL_FILE:
1.22 - {
1.23 - return FileConfig.getInstance().get(key, def);
1.24 - }
1.25 - case LEVEL_BACKEND:
1.26 - {
1.27 - return BackendConfig.getInstance().get(key, def);
1.28 + val = BackendConfig.getInstance().get(key, def);
1.29 }
1.30 }
1.31 - return null;
1.32 +
1.33 + return val != null ? val : def;
1.34 }
1.35
1.36 @Override