starting openbox without an rc file now works. it makes an empty Xrm db instead of crashing :)
Dana Jansens danakj@orodu.net
3 files changed,
9 insertions(+),
1 deletions(-)
M
src/Resource.cc
→
src/Resource.cc
@@ -85,6 +85,13 @@ return false;
return true; } +void Resource::create() { + if (m_database != NULL) + XrmDestroyDatabase(m_database); + m_modified = false; + ASSERT(NULL != (m_database = XrmGetStringDatabase(""))); +} + void Resource::setValue(const std::string &rname, bool value) { ASSERT(m_database != NULL);
M
src/Resource.h
→
src/Resource.h
@@ -50,6 +50,7 @@ }
void save(); bool load(); + void create(); void setValue(const std::string &rname, bool value); void setValue(const std::string &rname, int value);
M
src/openbox.cc
→
src/openbox.cc
@@ -1001,7 +1001,7 @@ }
void Openbox::load() { if (!config.load()) - return; + config.create(); std::string s; long l;