all repos — openbox @ 7440ad2e6fe345d0fbc037c690913705bc351e68

openbox fork - make it a bit more like ryudo

starting openbox without an rc file now works. it makes an empty Xrm db instead of crashing :)
Dana Jansens danakj@orodu.net
commit

7440ad2e6fe345d0fbc037c690913705bc351e68

parent

940c1f614fa380a9153c3b81d0614201b27957c2

3 files changed, 9 insertions(+), 1 deletions(-)

jump to
M src/Resource.ccsrc/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.hsrc/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.ccsrc/openbox.cc

@@ -1001,7 +1001,7 @@ }

void Openbox::load() { if (!config.load()) - return; + config.create(); std::string s; long l;