aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-25 21:18:19 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2012-04-07 02:11:28 (GMT)
commitcf424d6dcb0387db8edc86e00d5cf2eaef18f445 (patch)
tree7bbc3a868c18a749a323f9bdd4d984487b92c183
parentc57157b866fe324b3708a01ab1dfa157dfeb6972 (diff)
downloadfluxbox_paul-cf424d6dcb0387db8edc86e00d5cf2eaef18f445.zip
fluxbox_paul-cf424d6dcb0387db8edc86e00d5cf2eaef18f445.tar.bz2
Fallback to loading of system-wide init file if loading of user's fails
-rw-r--r--src/fluxbox.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 0f00bc7..10b8a23 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -1152,21 +1152,23 @@ void Fluxbox::load_rc() {
1152 1152
1153 string dbfile(getRcFilename()); 1153 string dbfile(getRcFilename());
1154 1154
1155 m_l->loadfile(dbfile.c_str()); 1155 try {
1156 m_l->call(0, 0); 1156 m_l->loadfile(dbfile.c_str());
1157 1157 m_l->call(0, 0);
1158 /* XXX 1158 }
1159 if (!dbfile.empty()) { 1159 catch(lua::exception &e) {
1160 if (!m_resourcemanager.load(dbfile.c_str())) { 1160 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl;
1161 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl; 1161 cerr<<"Fluxbox: "<<e.what()<<endl;
1162 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl; 1162 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl;
1163 if (!m_resourcemanager.load(DEFAULT_INITFILE)) 1163 try {
1164 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl; 1164 m_l->loadfile(DEFAULT_INITFILE);
1165 m_l->call(0, 0);
1165 } 1166 }
1166 } else { 1167 catch(lua::exception &e) {
1167 if (!m_resourcemanager.load(DEFAULT_INITFILE))
1168 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl; 1168 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
1169 } */ 1169 cerr<<"Fluxbox: "<<e.what()<<endl;
1170 }
1171 }
1170 1172
1171 if (m_rc_menufile->empty()) 1173 if (m_rc_menufile->empty())
1172 m_rc_menufile.setDefaultValue(); 1174 m_rc_menufile.setDefaultValue();