From 6a0ec4159139d0bb4fea0c11b790b4fc2ea774ab Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Sun, 27 Apr 2014 17:51:18 +0200 Subject: Add support for metacity-theme-2.xml Closes https://github.com/mate-desktop/mate-control-center/issues/92 --- libwindow-settings/marco-window-manager.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'libwindow-settings/marco-window-manager.c') diff --git a/libwindow-settings/marco-window-manager.c b/libwindow-settings/marco-window-manager.c index 2492eb99..5ce68dfb 100644 --- a/libwindow-settings/marco-window-manager.c +++ b/libwindow-settings/marco-window-manager.c @@ -121,18 +121,33 @@ add_themes_from_dir (GList *current_list, const char *path) return current_list; for (entry = readdir (theme_dir); entry != NULL; entry = readdir (theme_dir)) { - theme_file_path = g_build_filename (path, entry->d_name, "metacity-1/metacity-theme-1.xml", NULL); + theme_file_path = g_build_filename (path, entry->d_name, "metacity-1/metacity-theme-2.xml", NULL); if (g_file_test (theme_file_path, G_FILE_TEST_EXISTS)) { for (node = current_list; (node != NULL) && (!found); node = node->next) { found = (strcmp (node->data, entry->d_name) == 0); } - + if (!found) { current_list = g_list_prepend (current_list, g_strdup (entry->d_name)); } } + else { + g_free (theme_file_path); + theme_file_path = g_build_filename (path, entry->d_name, "metacity-1/metacity-theme-1.xml", NULL); + + if (g_file_test (theme_file_path, G_FILE_TEST_EXISTS)) { + + for (node = current_list; (node != NULL) && (!found); node = node->next) { + found = (strcmp (node->data, entry->d_name) == 0); + } + + if (!found) { + current_list = g_list_prepend (current_list, g_strdup (entry->d_name)); + } + } + } found = FALSE; /*g_free (entry);*/ -- cgit v1.2.1