real_reconfigure now using obResource instead of teh XrmDatabase calls.
obResource class calls XrmInitialize().
This commit is contained in:
parent
8d3c97389f
commit
456cf2d506
3 changed files with 14 additions and 13 deletions
|
@ -35,17 +35,27 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
bool obResource::m_initialized = false;
|
||||
|
||||
obResource::obResource(const std::string &file) {
|
||||
setFile(file);
|
||||
m_modified = false;
|
||||
m_database = NULL;
|
||||
m_autosave = true;
|
||||
if (!m_initialized) {
|
||||
XrmInitialize();
|
||||
m_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
obResource::obResource() {
|
||||
m_modified = false;
|
||||
m_database = NULL;
|
||||
m_autosave = true;
|
||||
if (!m_initialized) {
|
||||
XrmInitialize();
|
||||
m_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
obResource::~obResource() {
|
||||
|
|
|
@ -65,6 +65,7 @@ public:
|
|||
std::string &value) const;
|
||||
|
||||
private:
|
||||
static bool m_initialized;
|
||||
std::string m_file;
|
||||
bool m_modified;
|
||||
bool m_autosave;
|
||||
|
|
|
@ -197,7 +197,6 @@ Openbox::Openbox(int m_argc, char **m_argv, char *dpy_name, char *rc)
|
|||
|
||||
menuTimestamps = new LinkedList<MenuTimestamp>;
|
||||
|
||||
XrmInitialize();
|
||||
load_rc();
|
||||
|
||||
#ifdef HAVE_GETPID
|
||||
|
@ -1491,18 +1490,9 @@ void Openbox::reconfigure(void) {
|
|||
void Openbox::real_reconfigure(void) {
|
||||
grab();
|
||||
|
||||
XrmDatabase new_openboxrc = (XrmDatabase) 0;
|
||||
char style[MAXPATHLEN + 64];
|
||||
|
||||
sprintf(style, "session.styleFile: %s", resource.style_file);
|
||||
XrmPutLineResource(&new_openboxrc, style);
|
||||
|
||||
XrmDatabase old_openboxrc = XrmGetFileDatabase(rc_file);
|
||||
|
||||
XrmMergeDatabases(new_openboxrc, &old_openboxrc);
|
||||
XrmPutFileDatabase(old_openboxrc, rc_file);
|
||||
if (old_openboxrc) XrmDestroyDatabase(old_openboxrc);
|
||||
|
||||
config.load();
|
||||
config.setValue("session.styleFile", resource.style_file); // autosave's
|
||||
|
||||
for (int i = 0, n = menuTimestamps->count(); i < n; i++) {
|
||||
MenuTimestamp *ts = menuTimestamps->remove(0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue