X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fconfig.cc;h=d464ebbc5234a72cf3c59419dbee4f7c728d198b;hb=213df2814b002da2c5f324210d44559f9d651e21;hp=6feb94b20520cbf2e53af745bf5a144aeb274d3e;hpb=059bc4dc24b68d637c3608c05344c53c64cc2c4b;p=chaz%2Fopenbox diff --git a/src/config.cc b/src/config.cc index 6feb94b2..d464ebbc 100644 --- a/src/config.cc +++ b/src/config.cc @@ -8,6 +8,8 @@ extern "C" { #include } +#include + 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(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 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() +{ +} + }