aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-25 21:18:19 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 09:57:20 (GMT)
commitccade37903047af3c3b9bf051c2a060bdb75bdb9 (patch)
treec3912674fc900f8d8f4d8287f30054d7dd23b6a1
parent251a4c9ac62050e912fd861c4443ebe83948e22d (diff)
downloadfluxbox_pavel-ccade37903047af3c3b9bf051c2a060bdb75bdb9.zip
fluxbox_pavel-ccade37903047af3c3b9bf051c2a060bdb75bdb9.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 07d5436..93779c7 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();