starting openbox without an rc file now works. it makes an empty Xrm db instead of crashing :)
This commit is contained in:
parent
940c1f614f
commit
7440ad2e6f
3 changed files with 9 additions and 1 deletions
|
@ -85,6 +85,13 @@ bool Resource::load() {
|
||||||
return true;
|
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) {
|
void Resource::setValue(const std::string &rname, bool value) {
|
||||||
ASSERT(m_database != NULL);
|
ASSERT(m_database != NULL);
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ public:
|
||||||
|
|
||||||
void save();
|
void save();
|
||||||
bool load();
|
bool load();
|
||||||
|
void create();
|
||||||
|
|
||||||
void setValue(const std::string &rname, bool value);
|
void setValue(const std::string &rname, bool value);
|
||||||
void setValue(const std::string &rname, int value);
|
void setValue(const std::string &rname, int value);
|
||||||
|
|
|
@ -1001,7 +1001,7 @@ void Openbox::save() {
|
||||||
|
|
||||||
void Openbox::load() {
|
void Openbox::load() {
|
||||||
if (!config.load())
|
if (!config.load())
|
||||||
return;
|
config.create();
|
||||||
|
|
||||||
std::string s;
|
std::string s;
|
||||||
long l;
|
long l;
|
||||||
|
|
Loading…
Reference in a new issue