starting openbox without an rc file now works. it makes an empty Xrm db instead of crashing :)

This commit is contained in:
Dana Jansens 2002-04-19 07:50:02 +00:00
parent 940c1f614f
commit 7440ad2e6f
3 changed files with 9 additions and 1 deletions

View file

@ -85,6 +85,13 @@ bool Resource::load() {
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);

View file

@ -50,6 +50,7 @@ public:
void save();
bool load();
void create();
void setValue(const std::string &rname, bool value);
void setValue(const std::string &rname, int value);

View file

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