diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-07-15 22:00:55 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-07-15 22:00:55 +0800 |
commit | 830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4 (patch) | |
tree | 559aeab83098bcbb33be3ba1824fec294d530146 | |
parent | a88e050a3bc3178a146e259fa9e284c0980658d6 (diff) | |
download | gsoc2013-empathy-830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4.tar gsoc2013-empathy-830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4.tar.gz gsoc2013-empathy-830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4.tar.bz2 gsoc2013-empathy-830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4.tar.lz gsoc2013-empathy-830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4.tar.xz gsoc2013-empathy-830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4.tar.zst gsoc2013-empathy-830f6c3ed9d4e1a32ea1030b2baf7c85a2e60ff4.zip |
Add a comment for the usage of row_activated class method and optimise a bit that method.
svn path=/trunk/; revision=1256
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index ddb5d24e6..359f708d5 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -515,23 +515,21 @@ contact_list_view_row_activated (GtkTreeView *view, GtkTreeModel *model; GtkTreeIter iter; + if (!(priv->contact_features & EMPATHY_CONTACT_FEATURE_CHAT)) { + return; + } + model = GTK_TREE_MODEL (priv->store); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact, -1); - if (!contact) { - return; - } - - /* There is no event for the contact, default action is starting a chat */ - if (priv->contact_features & EMPATHY_CONTACT_FEATURE_CHAT) { + if (contact) { DEBUG ("Starting a chat"); empathy_dispatcher_chat_with_contact (contact); + g_object_unref (contact); } - - g_object_unref (contact); } static void @@ -1042,6 +1040,9 @@ empathy_contact_list_view_class_init (EmpathyContactListViewClass *klass) widget_class->drag_end = contact_list_view_drag_end; widget_class->drag_motion = contact_list_view_drag_motion; + /* We use the class method to let user of this widget to connect to + * the signal and stop emission of the signal so the default handler + * won't be called. */ tree_view_class->row_activated = contact_list_view_row_activated; signals[DRAG_CONTACT_RECEIVED] = |