From ccade37903047af3c3b9bf051c2a060bdb75bdb9 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 07d5436..93779c7 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