From cf424d6dcb0387db8edc86e00d5cf2eaef18f445 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 0f00bc7..10b8a23 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -1152,21 +1152,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