]> Dogcows Code - chaz/openbox/blobdiff - src/config.cc
dont wrap pointerassassin
[chaz/openbox] / src / config.cc
index 6feb94b20520cbf2e53af745bf5a144aeb274d3e..d464ebbc5234a72cf3c59419dbee4f7c728d198b 100644 (file)
@@ -8,6 +8,8 @@ extern "C" {
 #include <Python.h>
 }
 
+#include <cstring>
+
 namespace ob {
 
 static PyObject *obdict = NULL;
@@ -25,8 +27,9 @@ bool python_get_string(const char *name, otk::ustring *value)
 {
   PyObject *val = PyDict_GetItemString(obdict, const_cast<char*>(name));
   if (!(val && PyString_Check(val))) return false;
-  
-  *value = PyString_AsString(val);
+
+  std::string temp(PyString_AsString(val), PyString_Size(val));
+  *value = temp;
   return true;
 }
 
@@ -52,14 +55,12 @@ Config::Config()
   PyObject *obmodule = PyImport_AddModule("config");
   obdict = PyModule_GetDict(obmodule);
 
-  std::vector<otk::ustring> names;
-  python_get_stringlist("DESKTOP_NAMES", &names);
+  python_get_stringlist("DESKTOP_NAMES", &desktop_names);
 
   python_get_string("THEME", &theme);
 
   if (!python_get_string("TITLEBAR_LAYOUT", &titlebar_layout))
     titlebar_layout = "NTIMC";
-  printf("LAYOUT %s\n", titlebar_layout.c_str());
 
   if (!python_get_long("DOUBLE_CLICK_DELAY", &double_click_delay))
     double_click_delay = 300;
@@ -69,4 +70,8 @@ Config::Config()
     num_desktops = 1;
 }
 
+Config::~Config()
+{
+}
+
 }
This page took 0.020469 seconds and 4 git commands to generate.