summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-07-28 11:38:53 -0400
committerDana Jansens <danakj@orodu.net>2008-01-20 01:36:55 -0500
commit07d5674d3984d008de1ecc768a296afbed731e4e (patch)
tree4390ac212b5ad00430c6328972e0180808a7eb2e /openbox
parent1a0a1626b699c2e272ea6823b59aa7387242880e (diff)
move the xdg path stuff into obt/paths.[ch], and make render and openbox use it
Diffstat (limited to 'openbox')
-rw-r--r--openbox/actions/execute.c3
-rw-r--r--openbox/actions/restart.c3
-rw-r--r--openbox/config.c5
-rw-r--r--openbox/menu.c3
-rw-r--r--openbox/menu.h1
-rw-r--r--openbox/openbox.c7
-rw-r--r--openbox/session.c10
7 files changed, 17 insertions, 15 deletions
diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c
index 6b84ce40..5a747270 100644
--- a/openbox/actions/execute.c
+++ b/openbox/actions/execute.c
@@ -2,6 +2,7 @@
#include "openbox/event.h"
#include "openbox/startupnotify.h"
#include "openbox/screen.h"
+#include "obt/paths.h"
#include "gettext.h"
typedef struct {
@@ -39,7 +40,7 @@ static gpointer setup_func(xmlNodePtr node)
(n = obt_parse_find_node(node, "execute")))
{
gchar *s = obt_parse_node_string(n);
- o->cmd = parse_expand_tilde(s);
+ o->cmd = obt_paths_expand_tilde(s);
g_free(s);
}
diff --git a/openbox/actions/restart.c b/openbox/actions/restart.c
index 0afe8bf0..47f332b1 100644
--- a/openbox/actions/restart.c
+++ b/openbox/actions/restart.c
@@ -1,5 +1,6 @@
#include "openbox/actions.h"
#include "openbox/openbox.h"
+#include "obt/paths.h"
typedef struct {
gchar *cmd;
@@ -25,7 +26,7 @@ static gpointer setup_func(xmlNodePtr node)
(n = obt_parse_find_node(node, "execute")))
{
gchar *s = obt_parse_node_string(n);
- o->cmd = parse_expand_tilde(s);
+ o->cmd = obt_paths_expand_tilde(s);
g_free(s);
}
return o;
diff --git a/openbox/config.c b/openbox/config.c
index 70e44d76..b2bfd8db 100644
--- a/openbox/config.c
+++ b/openbox/config.c
@@ -26,6 +26,7 @@
#include "screen.h"
#include "openbox.h"
#include "gettext.h"
+#include "obt/paths.h"
gboolean config_focus_new;
gboolean config_focus_follow;
@@ -511,7 +512,7 @@ static void parse_theme(xmlNodePtr node, gpointer d)
g_free(config_theme);
c = obt_parse_node_string(n);
- config_theme = parse_expand_tilde(c);
+ config_theme = obt_paths_expand_tilde(c);
g_free(c);
}
if ((n = obt_parse_find_node(node, "titleLayout"))) {
@@ -743,7 +744,7 @@ static void parse_menu(xmlNodePtr node, gpointer d)
c = obt_parse_node_string(node);
config_menu_files = g_slist_append(config_menu_files,
- parse_expand_tilde(c));
+ obt_paths_expand_tilde(c));
g_free(c);
}
if ((n = obt_parse_find_node(node, "hideDelay")))
diff --git a/openbox/menu.c b/openbox/menu.c
index a78aa4da..768630bd 100644
--- a/openbox/menu.c
+++ b/openbox/menu.c
@@ -35,6 +35,7 @@
#include "client_list_combined_menu.h"
#include "gettext.h"
#include "obt/parse.h"
+#include "obt/paths.h"
typedef struct _ObMenuParseState ObMenuParseState;
@@ -314,7 +315,7 @@ static void parse_menu(xmlNodePtr node, gpointer data)
if ((menu = menu_new(name, title, TRUE, NULL))) {
menu->pipe_creator = state->pipe_creator;
if (obt_parse_attr_string(node, "execute", &script)) {
- menu->execute = parse_expand_tilde(script);
+ menu->execute = obt_paths_expand_tilde(script);
} else {
ObMenu *old;
diff --git a/openbox/menu.h b/openbox/menu.h
index d759a993..752a6771 100644
--- a/openbox/menu.h
+++ b/openbox/menu.h
@@ -22,7 +22,6 @@
#include "window.h"
#include "geom.h"
#include "render/render.h"
-#include "obt/parse.h"
#include <glib.h>
diff --git a/openbox/openbox.c b/openbox/openbox.c
index 92d0bbf6..c9979325 100644
--- a/openbox/openbox.c
+++ b/openbox/openbox.c
@@ -135,11 +135,8 @@ gint main(gint argc, gchar **argv)
program_name = g_path_get_basename(argv[0]);
g_set_prgname(program_name);
- if (!remote_control) {
- parse_paths_startup();
-
+ if (!remote_control)
session_startup(argc, argv);
- }
if (!obt_display_open(NULL))
ob_exit_with_error(_("Failed to open the display from the DISPLAY environment variable."));
@@ -371,8 +368,6 @@ gint main(gint argc, gchar **argv)
obt_display_close(obt_display);
- parse_paths_shutdown();
-
if (restart) {
if (restart_path != NULL) {
gint argcp;
diff --git a/openbox/session.c b/openbox/session.c
index e6883f32..c38a8204 100644
--- a/openbox/session.c
+++ b/openbox/session.c
@@ -41,6 +41,7 @@ GList* session_state_find(struct _ObClient *c) { return NULL; }
#include "focus.h"
#include "gettext.h"
#include "obt/parse.h"
+#include "obt/paths.h"
#include <time.h>
#include <errno.h>
@@ -90,15 +91,18 @@ static void session_state_free(ObSessionState *state);
void session_startup(gint argc, gchar **argv)
{
gchar *dir;
+ ObtPaths *p;
if (!ob_sm_use) return;
sm_argc = argc;
sm_argv = argv;
- dir = g_build_filename(parse_xdg_data_home_path(),
- "openbox", "sessions", NULL);
- if (!parse_mkdir_path(dir, 0700)) {
+ p = obt_paths_new();
+ dir = g_build_filename(obt_paths_data_home(p), "openbox", "sessions",NULL);
+ obt_paths_unref(p), p = NULL;
+
+ if (!obt_paths_mkdir_path(dir, 0700)) {
g_message(_("Unable to make directory '%s': %s"),
dir, g_strerror(errno));
}