[geany/geany] c3f3ec: session.conf split follow-up: plugins (PR #3183)

Thomas Martitz git-noreply at geany.org
Wed Apr 27 15:11:03 UTC 2022


Branch:      refs/heads/master
Author:      Thomas Martitz <thomas.martitz at mailbox.org>
Committer:   GitHub <noreply at github.com>
Date:        Wed, 27 Apr 2022 15:11:03 UTC
Commit:      c3f3eca869eef59dd45e435fbc446c86d4aef993
             https://github.com/geany/geany/commit/c3f3eca869eef59dd45e435fbc446c86d4aef993

Log Message:
-----------
session.conf split follow-up: plugins (PR #3183)

Move plugin layout to session.conf

The plugin related settings can be considered session data. They
encode local paths that wouldn't work on other machines. Also I would
say it's not unusual to have a different set of plugins enabled on a
different machine.

The "load_pluings" key is moved as well to keep things simple. No
idea what's the use case to set this off. Typically you just have no
plugins enabled and the debugging aid `geany -p` bypasses any of this
anyway.


Modified Paths:
--------------
    src/keyfile.c
    src/keyfile.h
    src/plugins.c
    src/search.c
    src/sidebar.c

Modified: src/keyfile.c
14 lines changed, 12 insertions(+), 2 deletions(-)
===================================================================
@@ -153,10 +153,20 @@ void configuration_add_various_pref_group(struct StashGroup *group,
 }
 
 
-/* The group will be free'd on quitting. */
-void configuration_add_session_group(struct StashGroup *group)
+/* The group will be free'd on quitting.
+ *
+ * @a for_prefs_dialog is typically @c FALSE as session configuration is not
+ * well suited for the Preferences dialog. Probably only existing prefs that
+ * migrated to session data should set this to @c TRUE.
+ *
+ * @param for_prefs_dialog is whether the group also has Prefs dialog items.
+ */
+void configuration_add_session_group(struct StashGroup *group, gboolean for_prefs_dialog)
 {
 	g_ptr_array_add(keyfile_groups[SESSION], group);
+
+	if (for_prefs_dialog)
+		g_ptr_array_add(pref_groups, group);
 }
 
 


Modified: src/keyfile.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -40,7 +40,7 @@ void configuration_add_pref_group(struct StashGroup *group, gboolean for_prefs_d
 void configuration_add_various_pref_group(struct StashGroup *group,
 	const gchar *prefix);
 
-void configuration_add_session_group(struct StashGroup *group);
+void configuration_add_session_group(struct StashGroup *group, gboolean for_prefs_dialog);
 
 void configuration_save(void);
 


Modified: src/plugins.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1332,7 +1332,7 @@ void plugins_init(void)
 	g_free(path);
 
 	group = stash_group_new("plugins");
-	configuration_add_pref_group(group, TRUE);
+	configuration_add_session_group(group, TRUE);
 
 	stash_group_add_toggle_button(group, &prefs.load_plugins,
 		"load_plugins", TRUE, "check_plugins");


Modified: src/search.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -201,7 +201,7 @@ static void init_prefs(void)
 
 	/* dialog layout & positions */
 	group = stash_group_new("search");
-	configuration_add_session_group(group);
+	configuration_add_session_group(group, FALSE);
 	stash_group_add_boolean(group, &find_dlg.all_expanded, "find_all_expanded", FALSE);
 	stash_group_add_boolean(group, &replace_dlg.all_expanded, "replace_all_expanded", FALSE);
 	stash_group_add_integer(group, &find_dlg.position[0], "position_find_x", -1);


Modified: src/sidebar.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1089,7 +1089,7 @@ void sidebar_init(void)
 	group = stash_group_new(PACKAGE);
 	stash_group_add_widget_property(group, &ui_prefs.sidebar_page, "sidebar_page", GINT_TO_POINTER(0),
 		main_widgets.sidebar_notebook, "page", 0);
-	configuration_add_session_group(group);
+	configuration_add_session_group(group, FALSE);
 	stash_group = group;
 
 	/* delay building documents treeview until sidebar font has been read */



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list