/pidgin/main: 37f787f5d4ac: blist: don't store default group nam...

Tomasz Wasilczyk twasilczyk at pidgin.im
Wed Apr 30 12:50:01 EDT 2014


Changeset: 37f787f5d4ac95207835be7f23d6aa3e76f00ce7
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-30 18:49 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/37f787f5d4ac

Description:

blist: don't store default group name; some tiny fixes

diffstat:

 libpurple/buddylist.c |  6 +++++-
 libpurple/buddylist.h |  7 +++++++
 2 files changed, 12 insertions(+), 1 deletions(-)

diffs (40 lines):

diff --git a/libpurple/buddylist.c b/libpurple/buddylist.c
--- a/libpurple/buddylist.c
+++ b/libpurple/buddylist.c
@@ -286,7 +286,8 @@ group_to_xmlnode(PurpleGroup *group)
 	PurpleBlistNode *cnode;
 
 	node = purple_xmlnode_new("group");
-	purple_xmlnode_set_attrib(node, "name", purple_group_get_name(group));
+	if (group != purple_blist_get_default_group())
+		purple_xmlnode_set_attrib(node, "name", purple_group_get_name(group));
 
 	/* Write settings */
 	g_hash_table_foreach(purple_blist_node_get_settings(PURPLE_BLIST_NODE(group)),
@@ -1458,6 +1459,9 @@ void purple_blist_remove_group(PurpleGro
 
 	g_return_if_fail(PURPLE_IS_GROUP(group));
 
+	if (group == purple_blist_get_default_group())
+		purple_debug_warning("buddylist", "cannot remove default group");
+
 	node = (PurpleBlistNode *)group;
 
 	/* Make sure the group is empty */
diff --git a/libpurple/buddylist.h b/libpurple/buddylist.h
--- a/libpurple/buddylist.h
+++ b/libpurple/buddylist.h
@@ -400,6 +400,13 @@ GSList *purple_blist_find_buddies(Purple
  */
 PurpleGroup *purple_blist_find_group(const char *name);
 
+/**
+ * purple_blist_get_default_group:
+ *
+ * Finds or creates default group.
+ *
+ * Returns: The default group.
+ */
 PurpleGroup *purple_blist_get_default_group(void);
 
 /**



More information about the Commits mailing list