From 0a39d13b503937f3ada42382e4d234693b4b7e5e Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sat, 25 Jun 2011 23:18:19 +0200 Subject: Fallback to loading of system-wide init file if loading of user's fails --- src/fluxbox.cc | 28 +++++++++++++++------------- 1 file 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() { string dbfile(getRcFilename()); - m_l->loadfile(dbfile.c_str()); - m_l->call(0, 0); - - /* XXX - if (!dbfile.empty()) { - if (!m_resourcemanager.load(dbfile.c_str())) { - cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<loadfile(dbfile.c_str()); + m_l->call(0, 0); + } + catch(lua::exception &e) { + cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "Failed trying to read rc file")<<":"<loadfile(DEFAULT_INITFILE); + m_l->call(0, 0); } - } else { - if (!m_resourcemanager.load(DEFAULT_INITFILE)) + catch(lua::exception &e) { cerr<<_FB_CONSOLETEXT(Fluxbox, CantLoadRCFile, "Failed to load database", "")<<": "<empty()) m_rc_menufile.setDefaultValue(); -- cgit v0.11.2