Support for launcher_apps_dir

git-svn-id: http://tint2.googlecode.com/svn/trunk@727 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000
2015-03-01 11:06:48 +00:00
committed by mrovi9000@gmail.com
parent ba40b0752f
commit da7efb27a9
5 changed files with 60 additions and 2 deletions

View File

@@ -415,6 +415,18 @@ void config_write_launcher(FILE *fp)
g_free(app_path);
}
gchar **app_dirs = g_strsplit(gtk_entry_get_text(GTK_ENTRY(launcher_apps_dirs)), ",", 0);
for (index = 0; app_dirs[index]; index++) {
gchar *dir = app_dirs[index];
g_strstrip(dir);
if (strlen(dir) > 0) {
char *contracted = contract_tilde(dir);
fprintf(fp, "launcher_item_app = %s\n", contracted);
free(contracted);
}
}
g_strfreev(app_dirs);
fprintf(fp, "\n");
}
@@ -1086,6 +1098,16 @@ void add_entry(char *key, char *value)
load_desktop_file(path, FALSE);
free(path);
}
else if (strcmp(key, "launcher_apps_dir") == 0) {
char *path = expand_tilde(value);
if (gtk_entry_get_text_length(GTK_ENTRY(launcher_apps_dirs)) > 0) {
gtk_entry_append_text(GTK_ENTRY(launcher_apps_dirs), ",");
}
gtk_entry_append_text(GTK_ENTRY(launcher_apps_dirs), path);
free(path);
}
else if (strcmp(key, "launcher_icon_theme") == 0) {
set_current_icon_theme(value);
}