mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-11-02 09:49:06 -06:00
Lessen restriction of the parameter whoami of the gnc_gconf_add/
remove_notification functions. Now the pair of section and whoami has to be unique, as GncMainWindow adds notifications to two different sections. Extends r14675. Remove a superfluous leading slash and doubly defined gconf key macros. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14945 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
1 parent
56dde9935b
commit
38d082642c
4 files changed
+11
-15
No files matched your search
@@ -29,8 +29,8 @@
|
||||
#include "gnc-gconf-utils.h"
|
||||
|
||||
#define APP_GNUCASH "/apps/gnucash"
|
||||
#define CLIENT_TAG "%s-client"
|
||||
#define NOTIFY_TAG "%s-notify_id"
|
||||
#define CLIENT_TAG "%s-%s-client"
|
||||
#define NOTIFY_TAG "%s-%s-notify_id"
|
||||
|
||||
static GConfClient *our_client = NULL;
|
||||
static guint gconf_general_cb_id = 0;
|
||||
@@ -787,8 +787,8 @@ gnc_gconf_add_notification (GObject *object,
|
||||
/*
|
||||
* Save the values needed to undo this later.
|
||||
*/
|
||||
client_tag = g_strdup_printf(CLIENT_TAG, whoami);
|
||||
notify_tag = g_strdup_printf(NOTIFY_TAG, whoami);
|
||||
client_tag = g_strdup_printf(CLIENT_TAG, section, whoami);
|
||||
notify_tag = g_strdup_printf(NOTIFY_TAG, section, whoami);
|
||||
g_object_set_data(object, client_tag, client);
|
||||
g_object_set_data(object, notify_tag, GUINT_TO_POINTER(id));
|
||||
g_free(notify_tag);
|
||||
@@ -858,11 +858,11 @@ gnc_gconf_remove_notification (GObject *object,
|
||||
/*
|
||||
* Remove any gconf notifications
|
||||
*/
|
||||
client_tag = g_strdup_printf(CLIENT_TAG, whoami);
|
||||
client_tag = g_strdup_printf(CLIENT_TAG, section, whoami);
|
||||
client = g_object_get_data(object, client_tag);
|
||||
path = gnc_gconf_section_name(section);
|
||||
if (client) {
|
||||
notify_tag = g_strdup_printf(NOTIFY_TAG, whoami);
|
||||
notify_tag = g_strdup_printf(NOTIFY_TAG, section, whoami);
|
||||
id = GPOINTER_TO_UINT(g_object_get_data(object, notify_tag));
|
||||
gconf_client_notify_remove(client, id);
|
||||
gconf_client_remove_dir(client, path, NULL);
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#define GCONF_WARNINGS_PERM "general/warnings/permanent"
|
||||
|
||||
/* Keys used across multiple modules */
|
||||
#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
|
||||
#define DESKTOP_GNOME_INTERFACE "desktop/gnome/interface"
|
||||
#define KEY_TOOLBAR_STYLE "toolbar_style"
|
||||
#define KEY_SAVE_GEOMETRY "save_window_geometry"
|
||||
#define KEY_LAST_PATH "last_path"
|
||||
@@ -767,8 +767,8 @@ void gnc_gconf_unset_dir (const gchar *section,
|
||||
* 'object' argument to this function as another of its arguments.
|
||||
*
|
||||
* @param whoami A magic value that must match up this call to the
|
||||
* corresponding call to gnc_gconf_remove_notification(). This value
|
||||
* should be unique across all callers.
|
||||
* corresponding call to gnc_gconf_remove_notification(). The pair of
|
||||
* section and whoami should be unique across all callers.
|
||||
*/
|
||||
void gnc_gconf_add_notification (GObject *object,
|
||||
const gchar *section,
|
||||
@@ -827,8 +827,8 @@ guint gnc_gconf_add_anon_notification (const gchar *section,
|
||||
* notification function to remove from GConf.
|
||||
*
|
||||
* @param whoami A magic value that must match up this call to the
|
||||
* corresponding call to gnc_gconf_add_notification(). This value
|
||||
* should be unique across all callers.
|
||||
* corresponding call to gnc_gconf_add_notification(). The pair of
|
||||
* section and whoami should be unique across all callers.
|
||||
*/
|
||||
void gnc_gconf_remove_notification (GObject *object,
|
||||
const gchar *section,
|
||||
|
||||
@@ -50,9 +50,6 @@ static QofLogModule log_module = GNC_MOD_GUI;
|
||||
#define WINDOW_POSITION "window_position"
|
||||
#define WINDOW_GEOMETRY "window_geometry"
|
||||
|
||||
#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
|
||||
#define KEY_TOOLBAR_STYLE "toolbar_style"
|
||||
|
||||
/* =========================================================== */
|
||||
|
||||
static void
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
#define GCONF_SECTION "dialogs/print_checks"
|
||||
#define KEY_CHECK_FORMAT "check_format"
|
||||
#define KEY_CHECK_POSITION "check_position"
|
||||
#define KEY_DATE_FORMAT "date_format"
|
||||
#define KEY_DATE_FORMAT_USER "date_format_custom"
|
||||
#define KEY_CUSTOM_PAYEE "custom_payee"
|
||||
#define KEY_CUSTOM_DATE "custom_date"
|
||||
|
||||
Reference in new issue
Block a user