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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1001,7 +1001,7 @@ void Openbox::save() {
|
|||
|
||||
void Openbox::load() {
|
||||
if (!config.load())
|
||||
return;
|
||||
config.create();
|
||||
|
||||
std::string s;
|
||||
long l;
|
||||
|
|
Loading…
Reference in a new issue