projects
/
dana
/
openbox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0b9910b
)
add function to give the list of autostart directories
author
Dana Jansens
<danakj@orodu.net>
Wed, 24 Mar 2010 00:22:11 +0000
(20:22 -0400)
committer
Dana Jansens
<danakj@orodu.net>
Thu, 25 Mar 2010 22:11:13 +0000
(18:11 -0400)
obt/paths.c
patch
|
blob
|
history
obt/paths.h
patch
|
blob
|
history
diff --git
a/obt/paths.c
b/obt/paths.c
index
da6f288
..
d99659b
100644
(file)
--- a/
obt/paths.c
+++ b/
obt/paths.c
@@
-37,6
+37,7
@@
struct _ObtPaths
gchar *cache_home;
GSList *config_dirs;
GSList *data_dirs;
gchar *cache_home;
GSList *config_dirs;
GSList *data_dirs;
+ GSList *autostart_dirs;
};
static gint slist_path_cmp(const gchar *a, const gchar *b)
};
static gint slist_path_cmp(const gchar *a, const gchar *b)
@@
-79,6
+80,7
@@
ObtPaths* obt_paths_new(void)
{
ObtPaths *p;
const gchar *path;
{
ObtPaths *p;
const gchar *path;
+ GSList *it;
p = g_slice_new0(ObtPaths);
p->ref = 1;
p = g_slice_new0(ObtPaths);
p->ref = 1;
@@
-119,6
+121,11
@@
ObtPaths* obt_paths_new(void)
g_strdup(p->config_home),
(GSListFunc) g_slist_prepend);
g_strdup(p->config_home),
(GSListFunc) g_slist_prepend);
+ for (it = p->config_dirs; it; it = g_slist_next(it)) {
+ gchar *const s = g_strdup_printf("%s/autostart", (gchar*)it->data);
+ p->autostart_dirs = g_slist_append(p->autostart_dirs, s);
+ }
+
path = g_getenv("XDG_DATA_DIRS");
if (path && path[0] != '\0') /* not unset or empty */
p->data_dirs = split_paths(path);
path = g_getenv("XDG_DATA_DIRS");
if (path && path[0] != '\0') /* not unset or empty */
p->data_dirs = split_paths(path);
@@
-159,6
+166,9
@@
void obt_paths_unref(ObtPaths *p)
for (it = p->data_dirs; it; it = g_slist_next(it))
g_free(it->data);
g_slist_free(p->data_dirs);
for (it = p->data_dirs; it; it = g_slist_next(it))
g_free(it->data);
g_slist_free(p->data_dirs);
+ for (it = p->autostart_dirs; it; it = g_slist_next(it))
+ g_free(it->data);
+ g_slist_free(p->autostart_dirs);
g_free(p->config_home);
g_free(p->data_home);
g_free(p->cache_home);
g_free(p->config_home);
g_free(p->data_home);
g_free(p->cache_home);
@@
-247,3
+257,8
@@
GSList* obt_paths_data_dirs(ObtPaths *p)
{
return p->data_dirs;
}
{
return p->data_dirs;
}
+
+GSList* obt_paths_autostart_dirs(ObtPaths *p)
+{
+ return p->autostart_dirs;
+}
diff --git
a/obt/paths.h
b/obt/paths.h
index
8753d4f
..
6d6df5e
100644
(file)
--- a/
obt/paths.h
+++ b/
obt/paths.h
@@
-34,6
+34,7
@@
const gchar* obt_paths_data_home(ObtPaths *p);
const gchar* obt_paths_cache_home(ObtPaths *p);
GSList* obt_paths_config_dirs(ObtPaths *p);
GSList* obt_paths_data_dirs(ObtPaths *p);
const gchar* obt_paths_cache_home(ObtPaths *p);
GSList* obt_paths_config_dirs(ObtPaths *p);
GSList* obt_paths_data_dirs(ObtPaths *p);
+GSList* obt_paths_autostart_dirs(ObtPaths *p);
gchar *obt_paths_expand_tilde(const gchar *f);
gboolean obt_paths_mkdir(const gchar *path, gint mode);
gchar *obt_paths_expand_tilde(const gchar *f);
gboolean obt_paths_mkdir(const gchar *path, gint mode);