aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-06-25 21:18:19 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-17 00:09:34 (GMT)
commit44f091deee8883ebc0988cb4a99c3c89c1d28ed0 (patch)
tree18c859f6d2643beda4fcfb522c7e3efb98c287d7
parentcb42b13e5dfcbebad6ac6d6cf757870b7b8a65ae (diff)
downloadfluxbox_pavel-44f091deee8883ebc0988cb4a99c3c89c1d28ed0.zip
fluxbox_pavel-44f091deee8883ebc0988cb4a99c3c89c1d28ed0.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 177e985..dd7b15c 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -1161,21 +1161,23 @@ void Fluxbox::load_rc() {
1161 1161
1162 string dbfile(getRcFilename()); 1162 string dbfile(getRcFilename());
1163 1163
1164 m_l->loadfile(dbfile.c_str()); 1164 try {
1165 m_l->call(0, 0); 1165 m_l->loadfile(dbfile.c_str());
1166 1166 m_l->call(0, 0);
1167 /* XXX 1167 }
1168 if (!dbfile.empty()) { 1168 catch(lua::exception &e) {
1169 if (!m_resourcemanager.load(dbfile.c_str())) { 1169 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl;
1170 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<<dbfile<<endl; 1170 cerr<<"Fluxbox: "<<e.what()<<endl;
1171 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl; 1171 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFileTrying, "Retrying with", "Retrying rc file loading with (the following file)")<<": "<<DEFAULT_INITFILE<<endl;
1172 if (!m_resourcemanager.load(DEFAULT_INITFILE)) 1172 try {
1173 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl; 1173 m_l->loadfile(DEFAULT_INITFILE);
1174 m_l->call(0, 0);
1174 } 1175 }
1175 } else { 1176 catch(lua::exception &e) {
1176 if (!m_resourcemanager.load(DEFAULT_INITFILE))
1177 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl; 1177 cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<<DEFAULT_INITFILE<<endl;
1178 } */ 1178 cerr<<"Fluxbox: "<<e.what()<<endl;
1179 }
1180 }
1179 1181
1180 if (m_rc_menufile->empty()) 1182 if (m_rc_menufile->empty())
1181 m_rc_menufile.setDefaultValue(); 1183 m_rc_menufile.setDefaultValue();