]> Dogcows Code - chaz/openbox/blobdiff - src/Resource.cc
load_rc(BScreen *) now uses the obResource class to load its configuration
[chaz/openbox] / src / Resource.cc
index a6254bcb3ee334b9dbca2c469e7a65bbefd4175b..ec29ac9ada4d224dc86b4314687ce95f84dff75c 100644 (file)
@@ -42,6 +42,12 @@ obResource::obResource(const std::string &file) {
   m_autosave = true;
 }
 
+obResource::obResource() {
+  m_modified = false;
+  m_database = NULL;
+  m_autosave = true;
+}
+
 obResource::~obResource() {
   if (m_database != NULL)
     XrmDestroyDatabase(m_database);
@@ -49,7 +55,6 @@ obResource::~obResource() {
 
 void obResource::setFile(const std::string &file) {
   m_file = file;
-  assert(m_file.c_str() != NULL);
 }
 
 void obResource::setAutoSave(bool autosave) {
@@ -120,7 +125,6 @@ void obResource::setValue(const std::string &rname, const std::string &value) {
 
 bool obResource::getValue(const std::string &rname, const std::string &rclass,
                           bool &value) const {
-  assert(rname.c_str() != NULL);
   assert(rclass.c_str() != NULL);
   assert(m_database != NULL);
   
@@ -130,7 +134,7 @@ bool obResource::getValue(const std::string &rname, const std::string &rclass,
                           &rettype, &retvalue) || retvalue.addr == NULL)
     return false;
   std::string val = retvalue.addr;
-  if (val == "True")
+  if (0 == strncasecmp(val.c_str(), "true", val.length()))
     value = true;
   else
     value = false;
@@ -139,8 +143,6 @@ bool obResource::getValue(const std::string &rname, const std::string &rclass,
 
 bool obResource::getValue(const std::string &rname, const std::string &rclass,
                           long &value) const {
-  assert(rname.c_str() != NULL);
-  assert(rclass.c_str() != NULL);
   assert(m_database != NULL);
   
   char *rettype;
@@ -157,8 +159,6 @@ bool obResource::getValue(const std::string &rname, const std::string &rclass,
 
 bool obResource::getValue(const std::string &rname, const std::string &rclass,
                           std::string &value) const {
-  assert(rname.c_str() != NULL);
-  assert(rclass.c_str() != NULL);
   assert(m_database != NULL);
   
   char *rettype;
This page took 0.023488 seconds and 4 git commands to generate.