ekiga r6538 - in trunk: . lib/engine/gui/gtk-frontend



Author: jpuydt
Date: Wed Jul 30 15:06:18 2008
New Revision: 6538
URL: http://svn.gnome.org/viewvc/ekiga?rev=6538&view=rev

Log:
Made the code handling object selection better in the roster view

Modified:
   trunk/ChangeLog
   trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp

Modified: trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp
==============================================================================
--- trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp	(original)
+++ trunk/lib/engine/gui/gtk-frontend/roster-view-gtk.cpp	Wed Jul 30 15:06:18 2008
@@ -534,26 +534,39 @@
 
   if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
 
+    gint column_type;
     Ekiga::Heap* heap = NULL;
     Ekiga::Presentity *presentity = NULL;
     gtk_tree_model_get (model, &iter,
+			COLUMN_TYPE, &column_type,
 			COLUMN_HEAP, &heap,
 			COLUMN_PRESENTITY, &presentity,
 			-1);
     gtk_container_foreach (GTK_CONTAINER (self->priv->toolbar),
 			   (GtkCallback)remove_child, self->priv->toolbar);
-    if (presentity != NULL) {
+
+    switch (column_type) {
+
+    case TYPE_PRESENTITY: {
 
       ToolbarBuilderGtk builder(self->priv->toolbar);
       Ekiga::ShortMenuBuilder shorter(builder);
       presentity->populate_menu (shorter);
       gtk_widget_show_all (self->priv->toolbar);
-    } else if (heap != NULL) {
+      break;
+    }
+    case TYPE_HEAP: {
 
       ToolbarBuilderGtk builder(self->priv->toolbar);
       Ekiga::ShortMenuBuilder shorter(builder);
       heap->populate_menu (shorter);
       gtk_widget_show_all (self->priv->toolbar);
+      break;
+    }
+
+    case TYPE_GROUP:
+    default:
+      break;
     }
     g_signal_emit (self, signals[PRESENTITY_SELECTED_SIGNAL], 0, presentity);
   }



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