X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FResource.cc;h=2a678f89dafde320e75491ca3741599e424a84ba;hb=0a3cfdfcb956024639a05549a50586e3d826b42e;hp=f3b0e5f9ef3bfb50f0f57d6376f91bbb0b573901;hpb=43e9d583c5fa8378013169929d0ef54e1dccb6fa;p=chaz%2Fopenbox diff --git a/src/Resource.cc b/src/Resource.cc index f3b0e5f9..2a678f89 100644 --- a/src/Resource.cc +++ b/src/Resource.cc @@ -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); @@ -116,6 +123,7 @@ void Resource::setValue(const std::string &rname, long value) { void Resource::setValue(const std::string &rname, const char *value) { ASSERT(m_database != NULL); + ASSERT(value != NULL); std::string rc_string = rname + ": " + value; XrmPutLineResource(&m_database, rc_string.c_str());