changeset 19177:19a4594e939c

Fix a memory leak. Fix a compile warning. Make sure there's no new API nor nothing.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 11 Aug 2007 10:52:07 +0000
parents 33201366bcd4
children c8ad802a6167
files finch/gntsound.c finch/gntsound.h finch/libgnt/gntbindable.c
diffstat 3 files changed, 13 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntsound.c	Sat Aug 11 10:22:37 2007 +0000
+++ b/finch/gntsound.c	Sat Aug 11 10:52:07 2007 +0000
@@ -281,7 +281,7 @@
 	mute_login_sounds_timeout = purple_timeout_add_seconds(10, unmute_login_sounds_cb, NULL);
 }
 
-void *
+static void *
 finch_sound_get_handle()
 {
 	static int handle;
@@ -619,7 +619,7 @@
 	purple_prefs_set_string(FINCH_PREFS_ROOT "/sound/actprofile", name);
 }
 
-gboolean
+static gboolean
 finch_sound_profile_exists(const char *name)
 {
 	gchar * tmp;
@@ -897,6 +897,7 @@
 	itr = list = finch_sound_get_profiles();
 	for (; itr; itr = itr->next) {
 		gnt_tree_add_row_after(GNT_TREE(tree), itr->data, gnt_tree_create_row(GNT_TREE(tree), itr->data), NULL, NULL);
+		g_free(itr->data);
 	}
 	g_list_free(list);
 
@@ -1036,7 +1037,6 @@
 	load_pref_window(finch_sound_get_active_profile());
 
 	gnt_widget_show(win);
-
 }	
 
 static PurpleSoundUiOps sound_ui_ops =
--- a/finch/gntsound.h	Sat Aug 11 10:22:37 2007 +0000
+++ b/finch/gntsound.h	Sat Aug 11 10:52:07 2007 +0000
@@ -28,62 +28,37 @@
 #include "sound.h"
 
 /**********************************************************************/
-/** @name GNT Sound API																								*/
+/** @name GNT Sound API                                               */
 /**********************************************************************/
 /*@{*/
 
 /**
-* Get the prefs option for an event.
-*
-* @param event The event.
-* @return The option.
-*/
-const char *finch_sound_get_event_option(PurpleSoundEventID event);
-
-/**
-* Get the label for an event.
-*
-* @param event The event.
-* @return The label.
-*/
-const char *finch_sound_get_event_label(PurpleSoundEventID event);
-
-/*
  * Get the name of the active sound profile.
  *
- * @return the name
+ * @return The name of the profile
  */
 const char *finch_sound_get_active_profile(void);
 
 /**
  * Set the active profile.  If the profile doesn't exist, nothing is changed.
  * 
- * 
+ * @param name  The name of the profile
  */
 void finch_sound_set_active_profile(const char *name);
 
 /**
- * Returns whether a profile exists or not.
- *
- * @parame name The name of the profile to check for
- * return Existance value
- *
- */
-gboolean finch_sound_profile_exists(const char *name);
-
-
-/**
  * Get a list of available sound profiles.
  *
- * @return A list of strings denoting sound profile names.  Free this list when you're done with it.
+ * @return A list of strings denoting sound profile names.
+ *         Caller must free the list (but not the data).
  */
 GList *finch_sound_get_profiles(void);
 
 /**
-* Gets GNT sound UI ops.
-*
-* @return The UI operations structure.
-*/
+ * Gets GNT sound UI ops.
+ *
+ * @return The UI operations structure.
+ */
 PurpleSoundUiOps *finch_sound_get_ui_ops(void);
 
 /**
@@ -91,13 +66,6 @@
  */
 void finch_sounds_show_all(void);
 
-/**
-* Get the handle for the GNT sound system.
-*
-* @return The handle to the sound system
-*/
-void *finch_sound_get_handle(void);
-
 /*@}*/
 
 #endif
--- a/finch/libgnt/gntbindable.c	Sat Aug 11 10:22:37 2007 +0000
+++ b/finch/libgnt/gntbindable.c	Sat Aug 11 10:52:07 2007 +0000
@@ -111,7 +111,7 @@
 	GntWidget *label;
 	GntWidget *bind_button, *cancel_button;
 	GntWidget *button_box;
-	GList *current_row_data, *itr;
+	GList *current_row_data;
 	char *tmp;
 	GntWidget *win = gnt_window_new();
 	GntTree *tree = GNT_TREE(data);
@@ -450,7 +450,6 @@
 gboolean
 gnt_bindable_build_help_window(GntBindable *bindable)
 {
-
 	GntWidget *tree;
 	GntBindableClass *klass = GNT_BINDABLE_GET_CLASS(bindable);
 	char *title;