From 96694d316b7d6ccb44c61d8908f15e91ba545e20 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 19 Sep 2022 14:32:50 +0200 Subject: [PATCH 1/3] consolidate xfconf path defines In order to make the code easier to understand/maintian, consolidate all xfconf path names into xfdesktop-common.h and only use those defines everywhere consistently. Signed-off-by: Enrico Weigelt, metux IT consult --- common/xfdesktop-common.h | 29 +++++++++++++++++-- settings/main.c | 60 ++++++++++++--------------------------- src/menu.c | 8 +++--- src/xfce-desktop.c | 14 ++++----- 4 files changed, 55 insertions(+), 56 deletions(-) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index 46a89c2b..e03f598c 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -51,8 +51,10 @@ #define ARRANGE_MESSAGE "arrange" #define QUIT_MESSAGE "quit" -#define SINGLE_WORKSPACE_MODE "/backdrop/single-workspace-mode" -#define SINGLE_WORKSPACE_NUMBER "/backdrop/single-workspace-number" +/* xfconf property pathes */ + +#define SINGLE_WORKSPACE_MODE "/backdrop/single-workspace-mode" +#define SINGLE_WORKSPACE_NUMBER "/backdrop/single-workspace-number" #define DESKTOP_ICONS_SHOW_THUMBNAILS "/desktop-icons/show-thumbnails" #define DESKTOP_ICONS_SHOW_HIDDEN_FILES "/desktop-icons/show-hidden-files" @@ -63,9 +65,32 @@ #define DESKTOP_ICONS_SHOW_TRASH "/desktop-icons/file-icons/show-trash" #define DESKTOP_ICONS_SHOW_FILESYSTEM "/desktop-icons/file-icons/show-filesystem" #define DESKTOP_ICONS_SHOW_REMOVABLE "/desktop-icons/file-icons/show-removable" +#define DESKTOP_ICONS_ON_PRIMARY "/desktop-icons/primary" +#define DESKTOP_ICONS_STYLE "/desktop-icons/style" +#define DESKTOP_ICONS_ICON_SIZE "/desktop-icons/icon-size" +#define DESKTOP_ICONS_FONT_SIZE "/desktop-icons/font-size" +#define DESKTOP_ICONS_CUSTOM_FONT_SIZE "/desktop-icons/use-custom-font-size" +#define DESKTOP_ICONS_SHOW_TOOLTIP "/desktop-icons/show-tooltips" +#define DESKTOP_ICONS_TOOLTIP_SIZE "/desktop-icons/tooltip-size" +#define DESKTOP_ICONS_SINGLE_CLICK "/desktop-icons/single-click" +#define DESKTOP_ICONS_GRAVITY "/desktop-icons/gravity" +#define DESKTOP_ICONS_CENTER_TEXT "/desktop-icons/center-text" #define DESKTOP_MENU_MAX_TEMPLATE_FILES "/desktop-menu/max-template-files" #define DESKTOP_MENU_DELETE "/desktop-menu/show-delete" +#define DESKTOP_MENU_SHOW "/desktop-menu/show" +#define DESKTOP_MENU_SHOW_ICONS "/desktop-menu/show-icons" + +#define SETTINGS_WINDOW_LAST_WIDTH "/last/window-width" +#define SETTINGS_WINDOW_LAST_HEIGHT "/last/window-height" + +#define WINLIST_SHOW_WINDOWS_MENU "/windowlist-menu/show" +#define WINLIST_SHOW_APP_ICONS "/windowlist-menu/show-icons" +#define WINLIST_SHOW_STICKY_WIN_ONCE "/windowlist-menu/show-sticky-once" +#define WINLIST_SHOW_WS_NAMES "/windowlist-menu/show-workspace-names" +#define WINLIST_SHOW_WS_SUBMENUS "/windowlist-menu/show-submenus" +#define WINLIST_SHOW_ADD_REMOVE_WORKSPACES "/windowlist-menu/show-add-remove-workspaces" + /** * File information namespaces queried for #GFileInfo objects. diff --git a/settings/main.c b/settings/main.c index f98d3b4b..e0ca6d18 100644 --- a/settings/main.c +++ b/settings/main.c @@ -67,30 +67,6 @@ #define PREVIEW_HEIGHT 96 #define PREVIEW_WIDTH (PREVIEW_HEIGHT * MAX_ASPECT_RATIO) - -#define SETTINGS_WINDOW_LAST_WIDTH "/last/window-width" -#define SETTINGS_WINDOW_LAST_HEIGHT "/last/window-height" - -#define SHOW_DESKTOP_MENU_PROP "/desktop-menu/show" -#define DESKTOP_MENU_SHOW_ICONS_PROP "/desktop-menu/show-icons" - -#define WINLIST_SHOW_WINDOWS_MENU_PROP "/windowlist-menu/show" -#define WINLIST_SHOW_APP_ICONS_PROP "/windowlist-menu/show-icons" -#define WINLIST_SHOW_STICKY_WIN_ONCE_PROP "/windowlist-menu/show-sticky-once" -#define WINLIST_SHOW_WS_NAMES_PROP "/windowlist-menu/show-workspace-names" -#define WINLIST_SHOW_WS_SUBMENUS_PROP "/windowlist-menu/show-submenus" -#define WINLIST_SHOW_ADD_REMOVE_WORKSPACES_PROP "/windowlist-menu/show-add-remove-workspaces" - -#define DESKTOP_ICONS_ON_PRIMARY_PROP "/desktop-icons/primary" -#define DESKTOP_ICONS_STYLE_PROP "/desktop-icons/style" -#define DESKTOP_ICONS_ICON_SIZE_PROP "/desktop-icons/icon-size" -#define DESKTOP_ICONS_FONT_SIZE_PROP "/desktop-icons/font-size" -#define DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP "/desktop-icons/use-custom-font-size" -#define DESKTOP_ICONS_SHOW_TOOLTIP_PROP "/desktop-icons/show-tooltips" -#define DESKTOP_ICONS_TOOLTIP_SIZE_PROP "/desktop-icons/tooltip-size" -#define DESKTOP_ICONS_SINGLE_CLICK_PROP "/desktop-icons/single-click" -#define DESKTOP_ICONS_GRAVITY_PROP "/desktop-icons/gravity" - typedef struct { GtkTreeModel *model; @@ -1055,7 +1031,7 @@ xfdesktop_spin_icon_size_timer(gpointer user_data) g_return_val_if_fail(XFCONF_IS_CHANNEL(channel), FALSE); xfconf_channel_set_uint(channel, - DESKTOP_ICONS_ICON_SIZE_PROP, + DESKTOP_ICONS_ICON_SIZE, gtk_spin_button_get_value(button)); g_object_set_data(G_OBJECT(button), "timer-id", NULL); @@ -1803,7 +1779,7 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_icon_size), xfconf_channel_get_uint(channel, - DESKTOP_ICONS_ICON_SIZE_PROP, + DESKTOP_ICONS_ICON_SIZE, DEFAULT_ICON_SIZE)); /* font size */ @@ -2003,56 +1979,56 @@ G_GNUC_END_IGNORE_DEPRECATIONS G_OBJECT(w), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_show_desktop_menu")); - xfconf_g_property_bind(channel, SHOW_DESKTOP_MENU_PROP, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, DESKTOP_MENU_SHOW, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); box = GTK_WIDGET(gtk_builder_get_object(main_gxml, "box_menu_subopts")); g_signal_connect(G_OBJECT(w), "toggled", G_CALLBACK(suboptions_set_sensitive), box); suboptions_set_sensitive(GTK_TOGGLE_BUTTON(w), box); - xfconf_g_property_bind(channel, DESKTOP_MENU_SHOW_ICONS_PROP, + xfconf_g_property_bind(channel, DESKTOP_MENU_SHOW_ICONS, G_TYPE_BOOLEAN, G_OBJECT(GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_menu_show_app_icons"))), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_show_winlist_menu")); - xfconf_g_property_bind(channel, WINLIST_SHOW_WINDOWS_MENU_PROP, + xfconf_g_property_bind(channel, WINLIST_SHOW_WINDOWS_MENU, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); box = GTK_WIDGET(gtk_builder_get_object(main_gxml, "box_winlist_subopts")); g_signal_connect(G_OBJECT(w), "toggled", G_CALLBACK(suboptions_set_sensitive), box); suboptions_set_sensitive(GTK_TOGGLE_BUTTON(w), box); - xfconf_g_property_bind(channel, WINLIST_SHOW_APP_ICONS_PROP, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, WINLIST_SHOW_APP_ICONS, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_winlist_show_app_icons"), "active"); - xfconf_g_property_bind(channel, WINLIST_SHOW_STICKY_WIN_ONCE_PROP, + xfconf_g_property_bind(channel, WINLIST_SHOW_STICKY_WIN_ONCE, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_show_winlist_sticky_once"), "active"); - xfconf_g_property_bind(channel, WINLIST_SHOW_ADD_REMOVE_WORKSPACES_PROP, + xfconf_g_property_bind(channel, WINLIST_SHOW_ADD_REMOVE_WORKSPACES, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_show_app_remove_workspaces"), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_show_winlist_ws_names")); - xfconf_g_property_bind(channel, WINLIST_SHOW_WS_NAMES_PROP, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, WINLIST_SHOW_WS_NAMES, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); box = GTK_WIDGET(gtk_builder_get_object(main_gxml, "box_winlist_names_subopts")); g_signal_connect(G_OBJECT(w), "toggled", G_CALLBACK(suboptions_set_sensitive), box); suboptions_set_sensitive(GTK_TOGGLE_BUTTON(w), box); - xfconf_g_property_bind(channel, WINLIST_SHOW_WS_SUBMENUS_PROP, + xfconf_g_property_bind(channel, WINLIST_SHOW_WS_SUBMENUS, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_show_winlist_ws_submenus"), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "primary")); - xfconf_g_property_bind(channel, DESKTOP_ICONS_ON_PRIMARY_PROP, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, DESKTOP_ICONS_ON_PRIMARY, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "combo_icons")); #ifdef ENABLE_FILE_ICONS @@ -2060,28 +2036,28 @@ G_GNUC_END_IGNORE_DEPRECATIONS #else gtk_combo_box_set_active(GTK_COMBO_BOX(w), 1); #endif - xfconf_g_property_bind(channel, DESKTOP_ICONS_STYLE_PROP, G_TYPE_INT, + xfconf_g_property_bind(channel, DESKTOP_ICONS_STYLE, G_TYPE_INT, G_OBJECT(w), "active"); /* Orientation combo */ w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "combo_orientation")); gtk_combo_box_set_active(GTK_COMBO_BOX(w), 0); - xfconf_g_property_bind(channel, DESKTOP_ICONS_GRAVITY_PROP, G_TYPE_INT, + xfconf_g_property_bind(channel, DESKTOP_ICONS_GRAVITY, G_TYPE_INT, G_OBJECT(w), "active"); g_signal_connect(G_OBJECT(w), "changed", G_CALLBACK(cb_xfdesktop_icon_orientation_changed), NULL); /* bindings */ - xfconf_g_property_bind(channel, DESKTOP_ICONS_FONT_SIZE_PROP, G_TYPE_DOUBLE, + xfconf_g_property_bind(channel, DESKTOP_ICONS_FONT_SIZE, G_TYPE_DOUBLE, G_OBJECT(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin_font_size))), "value"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE_PROP, + xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE, G_TYPE_BOOLEAN, G_OBJECT(chk_custom_font_size), "active"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_TOOLTIP_PROP, + xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_TOOLTIP, G_TYPE_BOOLEAN, G_OBJECT(chk_show_tooltips), "active"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_TOOLTIP_SIZE_PROP, G_TYPE_DOUBLE, + xfconf_g_property_bind(channel, DESKTOP_ICONS_TOOLTIP_SIZE, G_TYPE_DOUBLE, G_OBJECT(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin_tooltip_size))), "value"); xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_HIDDEN_FILES, @@ -2090,7 +2066,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_THUMBNAILS, G_TYPE_BOOLEAN, G_OBJECT(chk_show_thumbnails), "active"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SINGLE_CLICK_PROP, + xfconf_g_property_bind(channel, DESKTOP_ICONS_SINGLE_CLICK, G_TYPE_BOOLEAN, G_OBJECT(chk_single_click), "active"); diff --git a/src/menu.c b/src/menu.c index 761f78ad..9c6faa4a 100644 --- a/src/menu.c +++ b/src/menu.c @@ -112,11 +112,11 @@ menu_settings_changed(XfconfChannel *channel, const GValue *value, gpointer user_data) { - if(!strcmp(property, "/desktop-menu/show")) { + if(!strcmp(property, DESKTOP_MENU_SHOW)) { show_desktop_menu = G_VALUE_TYPE(value) ? g_value_get_boolean(value) : TRUE; - } else if(!strcmp(property, "/desktop-menu/show-icons")) { + } else if(!strcmp(property, DESKTOP_MENU_SHOW_ICONS)) { show_desktop_menu_icons = G_VALUE_TYPE(value) ? g_value_get_boolean(value) : TRUE; @@ -132,12 +132,12 @@ menu_init(XfconfChannel *channel) show_delete_option = xfconf_channel_get_bool(channel, DESKTOP_MENU_DELETE, TRUE); } - if(!channel || xfconf_channel_get_bool(channel, "/desktop-menu/show", TRUE)) + if(!channel || xfconf_channel_get_bool(channel, DESKTOP_MENU_SHOW, TRUE)) { show_desktop_menu = TRUE; if(channel) { show_desktop_menu_icons = xfconf_channel_get_bool(channel, - "/desktop-menu/show-icons", + DESKTOP_MENU_SHOW_ICONS, TRUE); } } else { diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index e65ac0e4..06d78990 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1466,29 +1466,27 @@ static void xfce_desktop_connect_settings(XfceDesktop *desktop) { #ifdef ENABLE_DESKTOP_ICONS -#define ICONS_PREFIX "/desktop-icons/" XfconfChannel *channel = desktop->priv->channel; xfce_desktop_freeze_updates(desktop); - xfconf_g_property_bind(channel, ICONS_PREFIX "style", + xfconf_g_property_bind(channel, DESKTOP_ICONS_STYLE, XFCE_TYPE_DESKTOP_ICON_STYLE, G_OBJECT(desktop), "icon-style"); - xfconf_g_property_bind(channel, ICONS_PREFIX "icon-size", G_TYPE_UINT, + xfconf_g_property_bind(channel, DESKTOP_ICONS_ICON_SIZE, G_TYPE_UINT, G_OBJECT(desktop), "icon-size"); - xfconf_g_property_bind(channel, ICONS_PREFIX "primary", G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, DESKTOP_ICONS_ON_PRIMARY, G_TYPE_BOOLEAN, G_OBJECT(desktop), "primary"); - xfconf_g_property_bind(channel, ICONS_PREFIX "font-size", G_TYPE_UINT, + xfconf_g_property_bind(channel, DESKTOP_ICONS_FONT_SIZE, G_TYPE_UINT, G_OBJECT(desktop), "icon-font-size"); - xfconf_g_property_bind(channel, ICONS_PREFIX "use-custom-font-size", + xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE, G_TYPE_BOOLEAN, G_OBJECT(desktop), "icon-font-size-set"); - xfconf_g_property_bind(channel, ICONS_PREFIX "center-text", + xfconf_g_property_bind(channel, DESKTOP_ICONS_CENTER_TEXT, G_TYPE_BOOLEAN, G_OBJECT(desktop), "icon-center-text"); xfce_desktop_thaw_updates(desktop); -#undef ICONS_PREFIX #endif } -- GitLab From 4ce6036b3cadbf012fc8baff051ca232bea7ab63 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 19 Sep 2022 16:13:17 +0200 Subject: [PATCH 2/3] xfdesktop: add define's for XfDesktop object property names In order to make the code a bit easier to understand, move the property names of XfDesktop object into define's. This way, the reader gets a better understanding on what these are actually about, clear distinction from other similar names. Signed-off-by: Enrico Weigelt, metux IT consult --- src/xfce-desktop.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index 06d78990..d5239e05 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -149,6 +149,17 @@ enum PROP_SINGLE_WORKSPACE_NUMBER, }; +/* property / param names -- used for property <-> xfconf mapping */ +#define PROPERTY_ICON_STYLE "icon-style" +#define PROPERTY_ICON_SIZE "icon-size" +#define PROPERTY_ICON_FONT_SIZE "icon-font-size" +#define PROPERTY_ICON_FONT_SIZE_SET "icon-font-size-set" +#define PROPERTY_ICON_CENTER_TEXT "icon-center-text" +#define PROPERTY_ICON_ON_PRIMARY "primary" + +#define PROPERTY_SINGLE_WORKSPACE_MODE "single-workspace-mode" +#define PROPERTY_SINGLE_WORKSPACE_NUMBER "single-workspace-number" + static void xfce_desktop_finalize(GObject *object); static void xfce_desktop_set_property(GObject *object, @@ -927,7 +938,7 @@ xfce_desktop_class_init(XfceDesktopClass *klass) #ifdef ENABLE_DESKTOP_ICONS g_object_class_install_property(gobject_class, PROP_ICON_STYLE, - g_param_spec_enum("icon-style", + g_param_spec_enum(PROPERTY_ICON_STYLE, "icon style", "icon style", XFCE_TYPE_DESKTOP_ICON_STYLE, @@ -939,35 +950,35 @@ xfce_desktop_class_init(XfceDesktopClass *klass) XFDESKTOP_PARAM_FLAGS)); g_object_class_install_property(gobject_class, PROP_ICON_SIZE, - g_param_spec_uint("icon-size", + g_param_spec_uint(PROPERTY_ICON_SIZE, "icon size", "icon size", 8, 192, DEFAULT_ICON_SIZE, XFDESKTOP_PARAM_FLAGS)); g_object_class_install_property(gobject_class, PROP_ICON_ON_PRIMARY, - g_param_spec_boolean("primary", + g_param_spec_boolean(PROPERTY_ICON_ON_PRIMARY, "primary", "show icons on primary desktop", FALSE, XFDESKTOP_PARAM_FLAGS)); g_object_class_install_property(gobject_class, PROP_ICON_FONT_SIZE, - g_param_spec_uint("icon-font-size", + g_param_spec_uint(PROPERTY_ICON_FONT_SIZE, "icon font size", "icon font size", 0, 144, 12, XFDESKTOP_PARAM_FLAGS)); g_object_class_install_property(gobject_class, PROP_ICON_FONT_SIZE_SET, - g_param_spec_boolean("icon-font-size-set", + g_param_spec_boolean(PROPERTY_ICON_FONT_SIZE, "icon font size set", "icon font size set", FALSE, XFDESKTOP_PARAM_FLAGS)); g_object_class_install_property(gobject_class, PROP_ICON_CENTER_TEXT, - g_param_spec_boolean("icon-center-text", + g_param_spec_boolean(PROPERTY_ICON_CENTER_TEXT, "icon center text", "icon center text", TRUE, @@ -976,14 +987,14 @@ xfce_desktop_class_init(XfceDesktopClass *klass) #endif /* ENABLE_DESKTOP_ICONS */ g_object_class_install_property(gobject_class, PROP_SINGLE_WORKSPACE_MODE, - g_param_spec_boolean("single-workspace-mode", + g_param_spec_boolean(PROPERTY_SINGLE_WORKSPACE_MODE, "single-workspace-mode", "single-workspace-mode", TRUE, XFDESKTOP_PARAM_FLAGS)); g_object_class_install_property(gobject_class, PROP_SINGLE_WORKSPACE_NUMBER, - g_param_spec_int("single-workspace-number", + g_param_spec_int(PROPERTY_SINGLE_WORKSPACE_NUMBER, "single-workspace-number", "single-workspace-number", 0, G_MAXINT16, 0, @@ -1189,10 +1200,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS /* Watch for single workspace setting changes */ xfconf_g_property_bind(desktop->priv->channel, SINGLE_WORKSPACE_MODE, G_TYPE_BOOLEAN, - G_OBJECT(desktop), "single-workspace-mode"); + G_OBJECT(desktop), PROPERTY_SINGLE_WORKSPACE_MODE); xfconf_g_property_bind(desktop->priv->channel, SINGLE_WORKSPACE_NUMBER, G_TYPE_INT, - G_OBJECT(desktop), "single-workspace-number"); + G_OBJECT(desktop), PROPERTY_SINGLE_WORKSPACE_NUMBER); /* watch for workspace changes */ g_signal_connect(desktop->priv->wnck_screen, "active-workspace-changed", @@ -1472,19 +1483,19 @@ xfce_desktop_connect_settings(XfceDesktop *desktop) xfconf_g_property_bind(channel, DESKTOP_ICONS_STYLE, XFCE_TYPE_DESKTOP_ICON_STYLE, - G_OBJECT(desktop), "icon-style"); + G_OBJECT(desktop), PROPERTY_ICON_STYLE); xfconf_g_property_bind(channel, DESKTOP_ICONS_ICON_SIZE, G_TYPE_UINT, - G_OBJECT(desktop), "icon-size"); + G_OBJECT(desktop), PROPERTY_ICON_SIZE); xfconf_g_property_bind(channel, DESKTOP_ICONS_ON_PRIMARY, G_TYPE_BOOLEAN, - G_OBJECT(desktop), "primary"); + G_OBJECT(desktop), PROPERTY_ICON_ON_PRIMARY); xfconf_g_property_bind(channel, DESKTOP_ICONS_FONT_SIZE, G_TYPE_UINT, - G_OBJECT(desktop), "icon-font-size"); + G_OBJECT(desktop), PROPERTY_ICON_FONT_SIZE); xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE, G_TYPE_BOOLEAN, - G_OBJECT(desktop), "icon-font-size-set"); + G_OBJECT(desktop), PROPERTY_ICON_FONT_SIZE_SET); xfconf_g_property_bind(channel, DESKTOP_ICONS_CENTER_TEXT, G_TYPE_BOOLEAN, - G_OBJECT(desktop), "icon-center-text"); + G_OBJECT(desktop), PROPERTY_ICON_CENTER_TEXT); xfce_desktop_thaw_updates(desktop); #endif -- GitLab From b3b45a0f7f300add092fd460a3defa2506741246 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 19 Sep 2022 16:22:03 +0200 Subject: [PATCH 3/3] prefix xfconf path define's with XFCONF_ For better clarification prefix all define's for xfconf pathes with "XFCONF_". Signed-off-by: Enrico Weigelt, metux IT consult --- common/xfdesktop-common.h | 74 +++++++++++++++---------------- settings/main.c | 74 +++++++++++++++---------------- src/menu.c | 10 ++--- src/xfce-desktop.c | 16 +++---- src/xfdesktop-file-icon-manager.c | 22 ++++----- 5 files changed, 98 insertions(+), 98 deletions(-) diff --git a/common/xfdesktop-common.h b/common/xfdesktop-common.h index e03f598c..a4d8b2f8 100644 --- a/common/xfdesktop-common.h +++ b/common/xfdesktop-common.h @@ -53,43 +53,43 @@ /* xfconf property pathes */ -#define SINGLE_WORKSPACE_MODE "/backdrop/single-workspace-mode" -#define SINGLE_WORKSPACE_NUMBER "/backdrop/single-workspace-number" - -#define DESKTOP_ICONS_SHOW_THUMBNAILS "/desktop-icons/show-thumbnails" -#define DESKTOP_ICONS_SHOW_HIDDEN_FILES "/desktop-icons/show-hidden-files" -#define DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE "/desktop-icons/file-icons/show-network-removable" -#define DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE "/desktop-icons/file-icons/show-device-removable" -#define DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE "/desktop-icons/file-icons/show-unknown-removable" -#define DESKTOP_ICONS_SHOW_HOME "/desktop-icons/file-icons/show-home" -#define DESKTOP_ICONS_SHOW_TRASH "/desktop-icons/file-icons/show-trash" -#define DESKTOP_ICONS_SHOW_FILESYSTEM "/desktop-icons/file-icons/show-filesystem" -#define DESKTOP_ICONS_SHOW_REMOVABLE "/desktop-icons/file-icons/show-removable" -#define DESKTOP_ICONS_ON_PRIMARY "/desktop-icons/primary" -#define DESKTOP_ICONS_STYLE "/desktop-icons/style" -#define DESKTOP_ICONS_ICON_SIZE "/desktop-icons/icon-size" -#define DESKTOP_ICONS_FONT_SIZE "/desktop-icons/font-size" -#define DESKTOP_ICONS_CUSTOM_FONT_SIZE "/desktop-icons/use-custom-font-size" -#define DESKTOP_ICONS_SHOW_TOOLTIP "/desktop-icons/show-tooltips" -#define DESKTOP_ICONS_TOOLTIP_SIZE "/desktop-icons/tooltip-size" -#define DESKTOP_ICONS_SINGLE_CLICK "/desktop-icons/single-click" -#define DESKTOP_ICONS_GRAVITY "/desktop-icons/gravity" -#define DESKTOP_ICONS_CENTER_TEXT "/desktop-icons/center-text" - -#define DESKTOP_MENU_MAX_TEMPLATE_FILES "/desktop-menu/max-template-files" -#define DESKTOP_MENU_DELETE "/desktop-menu/show-delete" -#define DESKTOP_MENU_SHOW "/desktop-menu/show" -#define DESKTOP_MENU_SHOW_ICONS "/desktop-menu/show-icons" - -#define SETTINGS_WINDOW_LAST_WIDTH "/last/window-width" -#define SETTINGS_WINDOW_LAST_HEIGHT "/last/window-height" - -#define WINLIST_SHOW_WINDOWS_MENU "/windowlist-menu/show" -#define WINLIST_SHOW_APP_ICONS "/windowlist-menu/show-icons" -#define WINLIST_SHOW_STICKY_WIN_ONCE "/windowlist-menu/show-sticky-once" -#define WINLIST_SHOW_WS_NAMES "/windowlist-menu/show-workspace-names" -#define WINLIST_SHOW_WS_SUBMENUS "/windowlist-menu/show-submenus" -#define WINLIST_SHOW_ADD_REMOVE_WORKSPACES "/windowlist-menu/show-add-remove-workspaces" +#define XFCONF_SINGLE_WORKSPACE_MODE "/backdrop/single-workspace-mode" +#define XFCONF_SINGLE_WORKSPACE_NUMBER "/backdrop/single-workspace-number" + +#define XFCONF_DESKTOP_ICONS_SHOW_THUMBNAILS "/desktop-icons/show-thumbnails" +#define XFCONF_DESKTOP_ICONS_SHOW_HIDDEN_FILES "/desktop-icons/show-hidden-files" +#define XFCONF_DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE "/desktop-icons/file-icons/show-network-removable" +#define XFCONF_DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE "/desktop-icons/file-icons/show-device-removable" +#define XFCONF_DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE "/desktop-icons/file-icons/show-unknown-removable" +#define XFCONF_DESKTOP_ICONS_SHOW_HOME "/desktop-icons/file-icons/show-home" +#define XFCONF_DESKTOP_ICONS_SHOW_TRASH "/desktop-icons/file-icons/show-trash" +#define XFCONF_DESKTOP_ICONS_SHOW_FILESYSTEM "/desktop-icons/file-icons/show-filesystem" +#define XFCONF_DESKTOP_ICONS_SHOW_REMOVABLE "/desktop-icons/file-icons/show-removable" +#define XFCONF_DESKTOP_ICONS_ON_PRIMARY "/desktop-icons/primary" +#define XFCONF_DESKTOP_ICONS_STYLE "/desktop-icons/style" +#define XFCONF_DESKTOP_ICONS_ICON_SIZE "/desktop-icons/icon-size" +#define XFCONF_DESKTOP_ICONS_FONT_SIZE "/desktop-icons/font-size" +#define XFCONF_DESKTOP_ICONS_CUSTOM_FONT_SIZE "/desktop-icons/use-custom-font-size" +#define XFCONF_DESKTOP_ICONS_SHOW_TOOLTIP "/desktop-icons/show-tooltips" +#define XFCONF_DESKTOP_ICONS_TOOLTIP_SIZE "/desktop-icons/tooltip-size" +#define XFCONF_DESKTOP_ICONS_SINGLE_CLICK "/desktop-icons/single-click" +#define XFCONF_DESKTOP_ICONS_GRAVITY "/desktop-icons/gravity" +#define XFCONF_DESKTOP_ICONS_CENTER_TEXT "/desktop-icons/center-text" + +#define XFCONF_DESKTOP_MENU_MAX_TEMPLATE_FILES "/desktop-menu/max-template-files" +#define XFCONF_DESKTOP_MENU_DELETE "/desktop-menu/show-delete" +#define XFCONF_DESKTOP_MENU_SHOW "/desktop-menu/show" +#define XFCONF_DESKTOP_MENU_SHOW_ICONS "/desktop-menu/show-icons" + +#define XFCONF_SETTINGS_WINDOW_LAST_WIDTH "/last/window-width" +#define XFCONF_SETTINGS_WINDOW_LAST_HEIGHT "/last/window-height" + +#define XFCONF_WINLIST_SHOW_WINDOWS_MENU "/windowlist-menu/show" +#define XFCONF_WINLIST_SHOW_APP_ICONS "/windowlist-menu/show-icons" +#define XFCONF_WINLIST_SHOW_STICKY_WIN_ONCE "/windowlist-menu/show-sticky-once" +#define XFCONF_WINLIST_SHOW_WS_NAMES "/windowlist-menu/show-workspace-names" +#define XFCONF_WINLIST_SHOW_WS_SUBMENUS "/windowlist-menu/show-submenus" +#define XFCONF_WINLIST_SHOW_ADD_REMOVE_WORKSPACES "/windowlist-menu/show-add-remove-workspaces" /** diff --git a/settings/main.c b/settings/main.c index e0ca6d18..bcf9da46 100644 --- a/settings/main.c +++ b/settings/main.c @@ -403,19 +403,19 @@ setup_special_icon_list(GtkBuilder *gxml, gboolean state; } icons[] = { { N_("Home"), { "user-home", "gnome-fs-desktop" }, - DESKTOP_ICONS_SHOW_HOME, TRUE }, + XFCONF_DESKTOP_ICONS_SHOW_HOME, TRUE }, { N_("File System"), { "drive-harddisk", "gnome-dev-harddisk" }, - DESKTOP_ICONS_SHOW_FILESYSTEM, TRUE }, + XFCONF_DESKTOP_ICONS_SHOW_FILESYSTEM, TRUE }, { N_("Trash"), { "user-trash", "gnome-fs-trash-empty" }, - DESKTOP_ICONS_SHOW_TRASH, TRUE }, + XFCONF_DESKTOP_ICONS_SHOW_TRASH, TRUE }, { N_("Removable Devices"), { "drive-removable-media", "gnome-dev-removable" }, - DESKTOP_ICONS_SHOW_REMOVABLE, TRUE }, + XFCONF_DESKTOP_ICONS_SHOW_REMOVABLE, TRUE }, { N_("Network Shares"), { "gtk-network", "gnome-dev-network" }, - DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE, TRUE }, + XFCONF_DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE, TRUE }, { N_("Disks and Drives"), { "drive-harddisk-usb", "gnome-dev-removable-usb" }, - DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE, TRUE }, + XFCONF_DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE, TRUE }, { N_("Other Devices"), { "multimedia-player", "phone" }, - DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE, TRUE }, + XFCONF_DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE, TRUE }, { NULL, { NULL, NULL }, NULL, FALSE }, }; const int REMOVABLE_DEVICES = 4; @@ -914,7 +914,7 @@ xfdesktop_settings_get_active_workspace(AppearancePanel *panel, } single_workspace = xfconf_channel_get_bool(panel->channel, - SINGLE_WORKSPACE_MODE, + XFCONF_SINGLE_WORKSPACE_MODE, TRUE); /* If we're in single_workspace mode we need to return the workspace that @@ -922,7 +922,7 @@ xfdesktop_settings_get_active_workspace(AppearancePanel *panel, * workspace and turn off the single workspace mode */ if(single_workspace) { single_workspace_num = xfconf_channel_get_int(panel->channel, - SINGLE_WORKSPACE_NUMBER, + XFCONF_SINGLE_WORKSPACE_NUMBER, 0); if(single_workspace_num < wnck_screen_get_workspace_count(wnck_screen)) { return single_workspace_num; @@ -1031,7 +1031,7 @@ xfdesktop_spin_icon_size_timer(gpointer user_data) g_return_val_if_fail(XFCONF_IS_CHANNEL(channel), FALSE); xfconf_channel_set_uint(channel, - DESKTOP_ICONS_ICON_SIZE, + XFCONF_DESKTOP_ICONS_ICON_SIZE, gtk_spin_button_get_value(button)); g_object_set_data(G_OBJECT(button), "timer-id", NULL); @@ -1655,12 +1655,12 @@ cb_xfdesktop_chk_apply_to_all(GtkCheckButton *button, TRACE("entering"); xfconf_channel_set_bool(panel->channel, - SINGLE_WORKSPACE_MODE, + XFCONF_SINGLE_WORKSPACE_MODE, active); if(active) { xfconf_channel_set_int(panel->channel, - SINGLE_WORKSPACE_NUMBER, + XFCONF_SINGLE_WORKSPACE_NUMBER, panel->workspace); } else { cb_update_background_tab(panel->wnck_window, panel); @@ -1779,7 +1779,7 @@ xfdesktop_settings_dialog_setup_tabs(GtkBuilder *main_gxml, gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_icon_size), xfconf_channel_get_uint(channel, - DESKTOP_ICONS_ICON_SIZE, + XFCONF_DESKTOP_ICONS_ICON_SIZE, DEFAULT_ICON_SIZE)); /* font size */ @@ -1941,7 +1941,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS panel->chk_apply_to_all = GTK_WIDGET(gtk_builder_get_object(appearance_gxml, "chk_apply_to_all")); - if(xfconf_channel_get_bool(channel, SINGLE_WORKSPACE_MODE, TRUE)) { + if(xfconf_channel_get_bool(channel, XFCONF_SINGLE_WORKSPACE_MODE, TRUE)) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(panel->chk_apply_to_all), TRUE); } @@ -1975,60 +1975,60 @@ G_GNUC_END_IGNORE_DEPRECATIONS /* Menus Tab */ w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_show_delete_option")); - xfconf_g_property_bind(channel, DESKTOP_MENU_DELETE, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_MENU_DELETE, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_show_desktop_menu")); - xfconf_g_property_bind(channel, DESKTOP_MENU_SHOW, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_MENU_SHOW, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); box = GTK_WIDGET(gtk_builder_get_object(main_gxml, "box_menu_subopts")); g_signal_connect(G_OBJECT(w), "toggled", G_CALLBACK(suboptions_set_sensitive), box); suboptions_set_sensitive(GTK_TOGGLE_BUTTON(w), box); - xfconf_g_property_bind(channel, DESKTOP_MENU_SHOW_ICONS, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_MENU_SHOW_ICONS, G_TYPE_BOOLEAN, G_OBJECT(GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_menu_show_app_icons"))), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_show_winlist_menu")); - xfconf_g_property_bind(channel, WINLIST_SHOW_WINDOWS_MENU, + xfconf_g_property_bind(channel, XFCONF_WINLIST_SHOW_WINDOWS_MENU, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); box = GTK_WIDGET(gtk_builder_get_object(main_gxml, "box_winlist_subopts")); g_signal_connect(G_OBJECT(w), "toggled", G_CALLBACK(suboptions_set_sensitive), box); suboptions_set_sensitive(GTK_TOGGLE_BUTTON(w), box); - xfconf_g_property_bind(channel, WINLIST_SHOW_APP_ICONS, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_WINLIST_SHOW_APP_ICONS, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_winlist_show_app_icons"), "active"); - xfconf_g_property_bind(channel, WINLIST_SHOW_STICKY_WIN_ONCE, + xfconf_g_property_bind(channel, XFCONF_WINLIST_SHOW_STICKY_WIN_ONCE, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_show_winlist_sticky_once"), "active"); - xfconf_g_property_bind(channel, WINLIST_SHOW_ADD_REMOVE_WORKSPACES, + xfconf_g_property_bind(channel, XFCONF_WINLIST_SHOW_ADD_REMOVE_WORKSPACES, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_show_app_remove_workspaces"), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "chk_show_winlist_ws_names")); - xfconf_g_property_bind(channel, WINLIST_SHOW_WS_NAMES, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_WINLIST_SHOW_WS_NAMES, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); box = GTK_WIDGET(gtk_builder_get_object(main_gxml, "box_winlist_names_subopts")); g_signal_connect(G_OBJECT(w), "toggled", G_CALLBACK(suboptions_set_sensitive), box); suboptions_set_sensitive(GTK_TOGGLE_BUTTON(w), box); - xfconf_g_property_bind(channel, WINLIST_SHOW_WS_SUBMENUS, + xfconf_g_property_bind(channel, XFCONF_WINLIST_SHOW_WS_SUBMENUS, G_TYPE_BOOLEAN, gtk_builder_get_object(main_gxml, "chk_show_winlist_ws_submenus"), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "primary")); - xfconf_g_property_bind(channel, DESKTOP_ICONS_ON_PRIMARY, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_ON_PRIMARY, G_TYPE_BOOLEAN, G_OBJECT(w), "active"); w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "combo_icons")); #ifdef ENABLE_FILE_ICONS @@ -2036,37 +2036,37 @@ G_GNUC_END_IGNORE_DEPRECATIONS #else gtk_combo_box_set_active(GTK_COMBO_BOX(w), 1); #endif - xfconf_g_property_bind(channel, DESKTOP_ICONS_STYLE, G_TYPE_INT, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_STYLE, G_TYPE_INT, G_OBJECT(w), "active"); /* Orientation combo */ w = GTK_WIDGET(gtk_builder_get_object(main_gxml, "combo_orientation")); gtk_combo_box_set_active(GTK_COMBO_BOX(w), 0); - xfconf_g_property_bind(channel, DESKTOP_ICONS_GRAVITY, G_TYPE_INT, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_GRAVITY, G_TYPE_INT, G_OBJECT(w), "active"); g_signal_connect(G_OBJECT(w), "changed", G_CALLBACK(cb_xfdesktop_icon_orientation_changed), NULL); /* bindings */ - xfconf_g_property_bind(channel, DESKTOP_ICONS_FONT_SIZE, G_TYPE_DOUBLE, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_FONT_SIZE, G_TYPE_DOUBLE, G_OBJECT(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin_font_size))), "value"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_CUSTOM_FONT_SIZE, G_TYPE_BOOLEAN, G_OBJECT(chk_custom_font_size), "active"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_TOOLTIP, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_TOOLTIP, G_TYPE_BOOLEAN, G_OBJECT(chk_show_tooltips), "active"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_TOOLTIP_SIZE, G_TYPE_DOUBLE, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_TOOLTIP_SIZE, G_TYPE_DOUBLE, G_OBJECT(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(spin_tooltip_size))), "value"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_HIDDEN_FILES, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_HIDDEN_FILES, G_TYPE_BOOLEAN, G_OBJECT(chk_show_hidden_files), "active"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_THUMBNAILS, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_THUMBNAILS, G_TYPE_BOOLEAN, G_OBJECT(chk_show_thumbnails), "active"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SINGLE_CLICK, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SINGLE_CLICK, G_TYPE_BOOLEAN, G_OBJECT(chk_single_click), "active"); @@ -2094,8 +2094,8 @@ xfdesktop_settings_response(GtkWidget *dialog, gint response_id, gpointer user_d if ((state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) == 0) { /* save window size */ gtk_window_get_size(GTK_WINDOW(dialog), &width, &height); - xfconf_channel_set_int(channel, SETTINGS_WINDOW_LAST_WIDTH, width); - xfconf_channel_set_int(channel, SETTINGS_WINDOW_LAST_HEIGHT, height); + xfconf_channel_set_int(channel, XFCONF_SETTINGS_WINDOW_LAST_WIDTH, width); + xfconf_channel_set_int(channel, XFCONF_SETTINGS_WINDOW_LAST_HEIGHT, height); } gtk_main_quit(); @@ -2187,8 +2187,8 @@ main(int argc, char **argv) channel); gtk_window_set_default_size (GTK_WINDOW(dialog), - xfconf_channel_get_int(channel, SETTINGS_WINDOW_LAST_WIDTH, -1), - xfconf_channel_get_int(channel, SETTINGS_WINDOW_LAST_HEIGHT, -1)); + xfconf_channel_get_int(channel, XFCONF_SETTINGS_WINDOW_LAST_WIDTH, -1), + xfconf_channel_get_int(channel, XFCONF_SETTINGS_WINDOW_LAST_HEIGHT, -1)); gtk_window_present(GTK_WINDOW (dialog)); screen = XScreenNumberOfScreen(gdk_x11_screen_get_xscreen(gtk_widget_get_screen(dialog))); diff --git a/src/menu.c b/src/menu.c index 9c6faa4a..564cd8b4 100644 --- a/src/menu.c +++ b/src/menu.c @@ -112,11 +112,11 @@ menu_settings_changed(XfconfChannel *channel, const GValue *value, gpointer user_data) { - if(!strcmp(property, DESKTOP_MENU_SHOW)) { + if(!strcmp(property, XFCONF_DESKTOP_MENU_SHOW)) { show_desktop_menu = G_VALUE_TYPE(value) ? g_value_get_boolean(value) : TRUE; - } else if(!strcmp(property, DESKTOP_MENU_SHOW_ICONS)) { + } else if(!strcmp(property, XFCONF_DESKTOP_MENU_SHOW_ICONS)) { show_desktop_menu_icons = G_VALUE_TYPE(value) ? g_value_get_boolean(value) : TRUE; @@ -129,15 +129,15 @@ menu_init(XfconfChannel *channel) { #ifdef ENABLE_DESKTOP_MENU if(channel) { - show_delete_option = xfconf_channel_get_bool(channel, DESKTOP_MENU_DELETE, TRUE); + show_delete_option = xfconf_channel_get_bool(channel, XFCONF_DESKTOP_MENU_DELETE, TRUE); } - if(!channel || xfconf_channel_get_bool(channel, DESKTOP_MENU_SHOW, TRUE)) + if(!channel || xfconf_channel_get_bool(channel, XFCONF_DESKTOP_MENU_SHOW, TRUE)) { show_desktop_menu = TRUE; if(channel) { show_desktop_menu_icons = xfconf_channel_get_bool(channel, - DESKTOP_MENU_SHOW_ICONS, + XFCONF_DESKTOP_MENU_SHOW_ICONS, TRUE); } } else { diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c index d5239e05..025751d2 100644 --- a/src/xfce-desktop.c +++ b/src/xfce-desktop.c @@ -1199,10 +1199,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS /* Watch for single workspace setting changes */ xfconf_g_property_bind(desktop->priv->channel, - SINGLE_WORKSPACE_MODE, G_TYPE_BOOLEAN, + XFCONF_SINGLE_WORKSPACE_MODE, G_TYPE_BOOLEAN, G_OBJECT(desktop), PROPERTY_SINGLE_WORKSPACE_MODE); xfconf_g_property_bind(desktop->priv->channel, - SINGLE_WORKSPACE_NUMBER, G_TYPE_INT, + XFCONF_SINGLE_WORKSPACE_NUMBER, G_TYPE_INT, G_OBJECT(desktop), PROPERTY_SINGLE_WORKSPACE_NUMBER); /* watch for workspace changes */ @@ -1481,19 +1481,19 @@ xfce_desktop_connect_settings(XfceDesktop *desktop) xfce_desktop_freeze_updates(desktop); - xfconf_g_property_bind(channel, DESKTOP_ICONS_STYLE, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_STYLE, XFCE_TYPE_DESKTOP_ICON_STYLE, G_OBJECT(desktop), PROPERTY_ICON_STYLE); - xfconf_g_property_bind(channel, DESKTOP_ICONS_ICON_SIZE, G_TYPE_UINT, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_ICON_SIZE, G_TYPE_UINT, G_OBJECT(desktop), PROPERTY_ICON_SIZE); - xfconf_g_property_bind(channel, DESKTOP_ICONS_ON_PRIMARY, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_ON_PRIMARY, G_TYPE_BOOLEAN, G_OBJECT(desktop), PROPERTY_ICON_ON_PRIMARY); - xfconf_g_property_bind(channel, DESKTOP_ICONS_FONT_SIZE, G_TYPE_UINT, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_FONT_SIZE, G_TYPE_UINT, G_OBJECT(desktop), PROPERTY_ICON_FONT_SIZE); - xfconf_g_property_bind(channel, DESKTOP_ICONS_CUSTOM_FONT_SIZE, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_CUSTOM_FONT_SIZE, G_TYPE_BOOLEAN, G_OBJECT(desktop), PROPERTY_ICON_FONT_SIZE_SET); - xfconf_g_property_bind(channel, DESKTOP_ICONS_CENTER_TEXT, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_CENTER_TEXT, G_TYPE_BOOLEAN, G_OBJECT(desktop), PROPERTY_ICON_CENTER_TEXT); diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c index 19444323..0b1b0188 100644 --- a/src/xfdesktop-file-icon-manager.c +++ b/src/xfdesktop-file-icon-manager.c @@ -4063,27 +4063,27 @@ xfdesktop_file_icon_manager_new(GFile *folder, NULL); fmanager->priv->channel = XFCONF_CHANNEL(g_object_ref(G_OBJECT(channel))); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_FILESYSTEM, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_FILESYSTEM, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-filesystem"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_HOME, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_HOME, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-home"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_TRASH, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_TRASH, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-trash"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_REMOVABLE, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_REMOVABLE, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-removable"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_NETWORK_REMOVABLE, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-network-volume"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_DEVICE_REMOVABLE, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-device-volume"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_UNKNWON_REMOVABLE, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-unknown-volume"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_THUMBNAILS, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_THUMBNAILS, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-thumbnails"); - xfconf_g_property_bind(channel, DESKTOP_ICONS_SHOW_HIDDEN_FILES, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_ICONS_SHOW_HIDDEN_FILES, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-hidden-files"); - xfconf_g_property_bind(channel, DESKTOP_MENU_DELETE, G_TYPE_BOOLEAN, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_MENU_DELETE, G_TYPE_BOOLEAN, G_OBJECT(fmanager), "show-delete-menu"); - xfconf_g_property_bind(channel, DESKTOP_MENU_MAX_TEMPLATE_FILES, G_TYPE_INT, + xfconf_g_property_bind(channel, XFCONF_DESKTOP_MENU_MAX_TEMPLATE_FILES, G_TYPE_INT, G_OBJECT(fmanager), "max-templates"); return XFDESKTOP_ICON_VIEW_MANAGER(fmanager); -- GitLab