[gnac/devel] Fixed warnings



commit ce4ff31364b372a08c623d6a3bf41e2e31ae1117
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date:   Thu Oct 27 15:57:35 2011 +0100

    Fixed warnings

 src/profiles/gnac-profiles-manager.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/src/profiles/gnac-profiles-manager.c b/src/profiles/gnac-profiles-manager.c
index 0af953b..19397e0 100644
--- a/src/profiles/gnac-profiles-manager.c
+++ b/src/profiles/gnac-profiles-manager.c
@@ -148,6 +148,15 @@ static void
 gnac_profiles_mgr_on_treeselection_changed(void);
 
 
+static GObject *
+gnac_profiles_mgr_get_object(const gchar *object_name)
+{
+  GObject *object;
+  object = gtk_builder_get_object(profiles_mgr_builder, object_name);
+  return object;
+}
+
+
 static GtkWidget *
 gnac_profiles_mgr_get_widget(const gchar *widget_name)
 {
@@ -514,7 +523,7 @@ gnac_profiles_mgr_get_profiles_list(void)
   GtkTreeIter   iter;
   AudioProfileGeneric *profile;
   
-  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_widget("liststore"));
+  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_object("liststore"));
   if (gtk_tree_model_get_iter_first(model, &iter)) {
     do {
       gtk_tree_model_get(model, &iter, COL_PROFILE, (gpointer*)&profile, -1);
@@ -575,7 +584,7 @@ gnac_profiles_mgr_clear(void)
   GtkTreeIter   iter;
   AudioProfileGeneric *profile;
   
-  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_widget("liststore"));
+  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_object("liststore"));
   if (gtk_tree_model_get_iter_first(model, &iter)) {
     do {
       gtk_tree_model_get(model, &iter, COL_PROFILE, (gpointer*)&profile, -1);
@@ -595,7 +604,7 @@ gnac_profiles_mgr_insert(gpointer profile)
   gchar *formatted_name;
 
   generic = ((AudioProfileGeneric*) profile)->generic;
-  model = GTK_LIST_STORE(gnac_profiles_mgr_get_widget("liststore"));
+  model = GTK_LIST_STORE(gnac_profiles_mgr_get_object("liststore"));
 
   formatted_name = gnac_profiles_properties_filter_text_for_displaying(
       generic->name, MAX_NAME_DISPLAY_SIZE);
@@ -619,7 +628,7 @@ gnac_profiles_mgr_remove(GtkTreeRowReference *ref)
 
   g_return_if_fail(ref);
 
-  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_widget("liststore"));
+  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_object("liststore"));
   path = gtk_tree_row_reference_get_path(ref);
 
   if (path) {
@@ -649,7 +658,7 @@ gnac_profiles_mgr_get(GtkTreeRowReference *ref,
 
   g_return_if_fail(ref);
 
-  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_widget("liststore"));
+  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_object("liststore"));
   path = gtk_tree_row_reference_get_path(ref);
 
   if (path) {
@@ -673,7 +682,7 @@ gnac_profiles_mgr_set(GtkTreeRowReference *ref, ...)
 
   g_return_if_fail(ref);
 
-  list_store = GTK_LIST_STORE(gnac_profiles_mgr_get_widget("liststore"));
+  list_store = GTK_LIST_STORE(gnac_profiles_mgr_get_object("liststore"));
   path = gtk_tree_row_reference_get_path(ref);
 
   if (path) {
@@ -700,7 +709,7 @@ gnac_profiles_mgr_get_selected_rows(void)
   GList *next;
   GList *next_temp;
   
-  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_widget("liststore"));
+  model = GTK_TREE_MODEL(gnac_profiles_mgr_get_object("liststore"));
   view = GTK_TREE_VIEW(gnac_profiles_mgr_get_widget("profile_treeview"));
   selection = gtk_tree_view_get_selection(view);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]