diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-06-25 21:18:19 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-06-25 21:18:19 (GMT) |
commit | 0a39d13b503937f3ada42382e4d234693b4b7e5e (patch) | |
tree | 741dc11a33cd21181f92d697473f1baebd504b92 /src | |
parent | 397d11b6b95cc6fb2625dcda00ae9c62d2430e24 (diff) | |
download | fluxbox_pavel-0a39d13b503937f3ada42382e4d234693b4b7e5e.zip fluxbox_pavel-0a39d13b503937f3ada42382e4d234693b4b7e5e.tar.bz2 |
Fallback to loading of system-wide init file if loading of user's fails
Diffstat (limited to 'src')
-rw-r--r-- | src/fluxbox.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 15b3f0f..bbb9cf3 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -1153,21 +1153,23 @@ void Fluxbox::load_rc() { | |||
1153 | 1153 | ||
1154 | string dbfile(getRcFilename()); | 1154 | string dbfile(getRcFilename()); |
1155 | 1155 | ||
1156 | m_l->loadfile(dbfile.c_str()); | 1156 | try { |
1157 | m_l->call(0, 0); | 1157 | m_l->loadfile(dbfile.c_str()); |
1158 | 1158 | m_l->call(0, 0); | |
1159 | /* XXX | 1159 | } |
1160 | if (!dbfile.empty()) { | 1160 | catch(lua::exception &e) { |
1161 | if (!m_resourcemanager.load(dbfile.c_str())) { | 1161 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl; |
1162 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl; | 1162 | cerr<<"Fluxbox: "<<e.what()<<endl; |
1163 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl; | 1163 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl; |
1164 | if (!m_resourcemanager.load(DEFAULT_INITFILE)) | 1164 | try { |
1165 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl; | 1165 | m_l->loadfile(DEFAULT_INITFILE); |
1166 | m_l->call(0, 0); | ||
1166 | } | 1167 | } |
1167 | } else { | 1168 | catch(lua::exception &e) { |
1168 | if (!m_resourcemanager.load(DEFAULT_INITFILE)) | ||
1169 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl; | 1169 | cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl; |
1170 | } */ | 1170 | cerr<<"Fluxbox: "<<e.what()<<endl; |
1171 | } | ||
1172 | } | ||
1171 | 1173 | ||
1172 | if (m_rc_menufile->empty()) | 1174 | if (m_rc_menufile->empty()) |
1173 | m_rc_menufile.setDefaultValue(); | 1175 | m_rc_menufile.setDefaultValue(); |