]> Dogcows Code - chaz/openbox/commitdiff
starting openbox without an rc file now works. it makes an empty Xrm db instead of...
authorDana Jansens <danakj@orodu.net>
Fri, 19 Apr 2002 07:50:02 +0000 (07:50 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 19 Apr 2002 07:50:02 +0000 (07:50 +0000)
src/Resource.cc
src/Resource.h
src/openbox.cc

index cff9bd38590ff934925d55b5805e3f7dca9a4bb0..2a678f89dafde320e75491ca3741599e424a84ba 100644 (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);
 
index 726755f385d2aa5f8cf12e94871c07f75a250a3e..7d7924943bfb4f9fe15928ef752d5bede98a7df8 100644 (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);
index dff6810222594f227c9e0dc6d2bed59080dcb403..86baec6e3c02d4dfc4d338e375bf5036c466df77 100644 (file)
@@ -1001,7 +1001,7 @@ void Openbox::save() {
 
 void Openbox::load() {
   if (!config.load())
-    return;
+    config.create();
 
   std::string s;
   long l;
This page took 0.024163 seconds and 4 git commands to generate.