/pidgin/main: 8dcd0006002f: Remove unused and unneeded purple_pr...
Mark Doliner
mark at kingant.net
Thu Jan 9 01:55:34 EST 2014
Changeset: 8dcd0006002f0e5a4e06c11c8a8a210b0759816d
Author: Mark Doliner <mark at kingant.net>
Date: 2014-01-08 22:55 -0800
Branch: default
URL: https://hg.pidgin.im/pidgin/main/rev/8dcd0006002f
Description:
Remove unused and unneeded purple_prefs_set_generic function.
diffstat:
ChangeLog.API | 1 +
libpurple/plugins/perl/common/Prefs.xs | 5 -----
libpurple/prefs.c | 20 +++++---------------
libpurple/prefs.h | 17 -----------------
4 files changed, 6 insertions(+), 37 deletions(-)
diffs (90 lines):
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -343,6 +343,7 @@ version 3.0.0 (??/??/????):
* purple_plugins_unregister_probe_notify_cb
* purple_plugins_unregister_unload_notify_cb
* purple_pounces_load
+ * purple_prefs_set_generic
* purple_presence_add_status
* purple_presence_add_list
* PurplePresenceContext
diff --git a/libpurple/plugins/perl/common/Prefs.xs b/libpurple/plugins/perl/common/Prefs.xs
--- a/libpurple/plugins/perl/common/Prefs.xs
+++ b/libpurple/plugins/perl/common/Prefs.xs
@@ -179,11 +179,6 @@ purple_prefs_set_bool(name, value)
gboolean value
void
-purple_prefs_set_generic(name, value)
- const char *name
- gpointer value
-
-void
purple_prefs_set_int(name, value)
const char *name
int value
diff --git a/libpurple/prefs.c b/libpurple/prefs.c
--- a/libpurple/prefs.c
+++ b/libpurple/prefs.c
@@ -51,6 +51,11 @@ struct purple_pref {
PurplePrefType type;
char *name;
union {
+ /* 'generic' is kind of ugly. We use it as an elegant way to refer to
+ the value of this pref when calling callback functions. We could
+ use 'boolean' or 'integer' or any other field... but it feels
+ mildly cleaner to use a gpointer. Maybe it would be best to use a
+ GValue? */
gpointer generic;
gboolean boolean;
int integer;
@@ -782,21 +787,6 @@ purple_prefs_trigger_callback(const char
}
void
-purple_prefs_set_generic(const char *name, gpointer value)
-{
- struct purple_pref *pref = find_pref(name);
-
- if(!pref) {
- purple_debug_error("prefs",
- "purple_prefs_set_generic: Unknown pref %s\n", name);
- return;
- }
-
- pref->value.generic = value;
- do_callbacks(name, pref);
-}
-
-void
purple_prefs_set_bool(const char *name, gboolean value)
{
struct purple_pref *pref = find_pref(name);
diff --git a/libpurple/prefs.h b/libpurple/prefs.h
--- a/libpurple/prefs.h
+++ b/libpurple/prefs.h
@@ -179,23 +179,6 @@ void purple_prefs_rename_boolean_toggle(
void purple_prefs_destroy(void);
/**
- * Set raw pref value
- *
- * @param name The name of the pref
- * @param value The value to set
- *
- * @deprecated We're not really sure what purpose this function serves, so it
- * will be removed in 3.0.0. Preferences values set using this
- * function aren't serialized to prefs.xml, which could be
- * misleading. There is also no purple_prefs_get_generic, which
- * means that if you can't really get the value (other in a
- * connected callback). If you think you have a use for this then
- * please let us know.
- */
-/* TODO: When this is removed, also remove struct purple_pref->value.generic */
-void purple_prefs_set_generic(const char *name, gpointer value);
-
-/**
* Set boolean pref value
*
* @param name The name of the pref
More information about the Commits
mailing list