diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2012-01-17 17:10:43 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2012-01-17 17:10:43 +0800 |
commit | 25a44d2984058a38f54ab6bd68027e524342e34b (patch) | |
tree | a698ac149fa82e1c93f0d1d25c45bc68d1ff9fc7 /libempathy-gtk | |
parent | f17363e49737c2ad6bf304d7ed1dd2ccf8ca2b4c (diff) | |
parent | 5c615ca9c2ffcff23925c154e36dfeccf416ec30 (diff) | |
download | gsoc2013-empathy-25a44d2984058a38f54ab6bd68027e524342e34b.tar gsoc2013-empathy-25a44d2984058a38f54ab6bd68027e524342e34b.tar.gz gsoc2013-empathy-25a44d2984058a38f54ab6bd68027e524342e34b.tar.bz2 gsoc2013-empathy-25a44d2984058a38f54ab6bd68027e524342e34b.tar.lz gsoc2013-empathy-25a44d2984058a38f54ab6bd68027e524342e34b.tar.xz gsoc2013-empathy-25a44d2984058a38f54ab6bd68027e524342e34b.tar.zst gsoc2013-empathy-25a44d2984058a38f54ab6bd68027e524342e34b.zip |
Merge branch 'master' into call1
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-account-chooser.c | 4 | ||||
-rw-r--r-- | libempathy-gtk/empathy-account-widget-irc.ui | 1 | ||||
-rw-r--r-- | libempathy-gtk/empathy-groups-widget.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 74 | ||||
-rw-r--r-- | libempathy-gtk/empathy-irc-network-chooser-dialog.c | 5 | ||||
-rw-r--r-- | libempathy-gtk/empathy-irc-network-chooser.c | 41 | ||||
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 21 |
7 files changed, 64 insertions, 84 deletions
diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c index c21a22ebc..ae3f1dd15 100644 --- a/libempathy-gtk/empathy-account-chooser.c +++ b/libempathy-gtk/empathy-account-chooser.c @@ -90,6 +90,10 @@ filter_result_callback_data_new (EmpathyAccountChooser *self, { FilterResultCallbackData *data; + g_return_val_if_fail (self != NULL, NULL); + g_return_val_if_fail (account != NULL, NULL); + g_return_val_if_fail (iter != NULL, NULL); + data = g_slice_new0 (FilterResultCallbackData); data->self = g_object_ref (self); data->account = g_object_ref (account); diff --git a/libempathy-gtk/empathy-account-widget-irc.ui b/libempathy-gtk/empathy-account-widget-irc.ui index aa6e643ec..999fd320a 100644 --- a/libempathy-gtk/empathy-account-widget-irc.ui +++ b/libempathy-gtk/empathy-account-widget-irc.ui @@ -81,6 +81,7 @@ </object> <packing> <property name="top_attach">1</property> + <property name="left_attach">0</property> </packing> </child> <child> diff --git a/libempathy-gtk/empathy-groups-widget.c b/libempathy-gtk/empathy-groups-widget.c index efb58fa99..5d87ef4f4 100644 --- a/libempathy-gtk/empathy-groups-widget.c +++ b/libempathy-gtk/empathy-groups-widget.c @@ -182,8 +182,6 @@ populate_data (EmpathyGroupsWidget *self) COL_EDITABLE, TRUE, COL_ENABLED, enabled, -1); - - g_free (l->data); } g_list_free (all_groups); diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 1a837cf83..dad975b3c 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -219,8 +219,10 @@ individual_view_query_tooltip_cb (EmpathyIndividualView *view, EMPATHY_INDIVIDUAL_WIDGET_SHOW_CLIENT_TYPES); gtk_container_set_border_width (GTK_CONTAINER (priv->tooltip_widget), 8); g_object_ref (priv->tooltip_widget); - g_signal_connect (priv->tooltip_widget, "destroy", - G_CALLBACK (individual_view_tooltip_destroy_cb), view); + + tp_g_signal_connect_object (priv->tooltip_widget, "destroy", + G_CALLBACK (individual_view_tooltip_destroy_cb), view, 0); + gtk_widget_show (priv->tooltip_widget); } else @@ -1635,54 +1637,6 @@ individual_view_row_has_child_toggled_cb (GtkTreeModel *model, g_free (name); } -/* FIXME: This is a workaround for bgo#621076 */ -static void -individual_view_verify_group_visibility (EmpathyIndividualView *view, - GtkTreePath *path) -{ - EmpathyIndividualViewPriv *priv = GET_PRIV (view); - GtkTreeModel *model; - GtkTreePath *parent_path; - GtkTreeIter parent_iter; - - if (gtk_tree_path_get_depth (path) < 2) - return; - - /* A group row is visible if and only if at least one if its child is visible. - * So when a row is inserted/deleted/changed in the base model, that could - * modify the visibility of its parent in the filter model. - */ - - model = GTK_TREE_MODEL (priv->store); - parent_path = gtk_tree_path_copy (path); - gtk_tree_path_up (parent_path); - if (gtk_tree_model_get_iter (model, &parent_iter, parent_path)) - { - /* This tells the filter to verify the visibility of that row, and - * show/hide it if necessary */ - gtk_tree_model_row_changed (GTK_TREE_MODEL (priv->store), - parent_path, &parent_iter); - } - gtk_tree_path_free (parent_path); -} - -static void -individual_view_store_row_changed_cb (GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter, - EmpathyIndividualView *view) -{ - individual_view_verify_group_visibility (view, path); -} - -static void -individual_view_store_row_deleted_cb (GtkTreeModel *model, - GtkTreePath *path, - EmpathyIndividualView *view) -{ - individual_view_verify_group_visibility (view, path); -} - static gboolean individual_view_is_visible_individual (EmpathyIndividualView *self, FolksIndividual *individual, @@ -1813,14 +1767,6 @@ individual_view_filter_visible_func (GtkTreeModel *model, g_object_unref (individual); g_free (group); - /* FIXME: Work around bgo#626552/bgo#621076 */ - if (visible) - { - GtkTreePath *path = gtk_tree_model_get_path (model, iter); - individual_view_verify_group_visibility (self, path); - gtk_tree_path_free (path); - } - return visible; } @@ -2818,11 +2764,6 @@ empathy_individual_view_set_store (EmpathyIndividualView *self, /* Destroy the old filter and remove the old store */ if (priv->store != NULL) { - g_signal_handlers_disconnect_by_func (priv->store, - individual_view_store_row_changed_cb, self); - g_signal_handlers_disconnect_by_func (priv->store, - individual_view_store_row_deleted_cb, self); - g_signal_handlers_disconnect_by_func (priv->filter, individual_view_row_has_child_toggled_cb, self); @@ -2849,13 +2790,6 @@ empathy_individual_view_set_store (EmpathyIndividualView *self, G_CALLBACK (individual_view_row_has_child_toggled_cb), self); gtk_tree_view_set_model (GTK_TREE_VIEW (self), GTK_TREE_MODEL (priv->filter)); - - tp_g_signal_connect_object (priv->store, "row-changed", - G_CALLBACK (individual_view_store_row_changed_cb), self, 0); - tp_g_signal_connect_object (priv->store, "row-inserted", - G_CALLBACK (individual_view_store_row_changed_cb), self, 0); - tp_g_signal_connect_object (priv->store, "row-deleted", - G_CALLBACK (individual_view_store_row_deleted_cb), self, 0); } } diff --git a/libempathy-gtk/empathy-irc-network-chooser-dialog.c b/libempathy-gtk/empathy-irc-network-chooser-dialog.c index 9d29aff4a..755eb584e 100644 --- a/libempathy-gtk/empathy-irc-network-chooser-dialog.c +++ b/libempathy-gtk/empathy-irc-network-chooser-dialog.c @@ -132,6 +132,9 @@ dup_selected_network (EmpathyIrcNetworkChooserDialog *self, GtkTreeModel *model; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview)); + if (selection == NULL) + return NULL; + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) return NULL; @@ -157,7 +160,7 @@ treeview_changed_cb (GtkTreeView *treeview, network = dup_selected_network (self, NULL); if (network == priv->network) { - g_object_unref (network); + g_clear_object (&network); return; } diff --git a/libempathy-gtk/empathy-irc-network-chooser.c b/libempathy-gtk/empathy-irc-network-chooser.c index 7a6bd7898..74c9685e8 100644 --- a/libempathy-gtk/empathy-irc-network-chooser.c +++ b/libempathy-gtk/empathy-irc-network-chooser.c @@ -118,6 +118,40 @@ unset_server_params (EmpathyIrcNetworkChooser *self) empathy_account_settings_unset (priv->settings, "use-ssl"); } +static gchar * +dup_network_service (EmpathyIrcNetwork *network) +{ + /* Account.Service has to be a lower case alphanumeric string which may + * also contain '-' but not start with it. */ +#define VALID G_CSET_a_2_z G_CSET_DIGITS "-" + gchar *service, *tmp; + + service = g_strdup (empathy_irc_network_get_name (network)); + service = g_strstrip (service); + + if (tp_str_empty (service)) + { + g_free (service); + return NULL; + } + + tmp = service; + service = g_ascii_strdown (service, -1); + g_free (tmp); + + service = g_strcanon (service, VALID, '-'); + + if (service[0] == '-') + { + tmp = service; + service = g_strdup (service + 1); + + g_free (tmp); + } + + return service; +} + static void update_server_params (EmpathyIrcNetworkChooser *self) { @@ -139,6 +173,7 @@ update_server_params (EmpathyIrcNetworkChooser *self) gchar *address; guint port; gboolean ssl; + gchar *service; g_object_get (server, "address", &address, @@ -153,7 +188,13 @@ update_server_params (EmpathyIrcNetworkChooser *self) DEBUG ("Setting use-ssl to %s", ssl ? "TRUE": "FALSE" ); empathy_account_settings_set_boolean (priv->settings, "use-ssl", ssl); + /* Set Account.Service */ + service = dup_network_service (priv->network); + DEBUG ("Setting Service to %s", service); + empathy_account_settings_set_service (priv->settings, service); + g_free (address); + g_free (service); } else { diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index 4d6168745..f3761e5cd 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -718,26 +718,25 @@ empathy_pixbuf_avatar_from_individual_scaled_async ( avatar_icon = folks_avatar_details_get_avatar (FOLKS_AVATAR_DETAILS (individual)); - if (avatar_icon == NULL) - goto out; + if (avatar_icon == NULL) { + g_simple_async_result_set_error (result, TP_ERRORS, + TP_ERROR_INVALID_ARGUMENT, "no avatar found"); + + g_simple_async_result_complete (result); + g_object_unref (result); + return; + } closure = pixbuf_avatar_from_individual_closure_new (individual, result, width, height, cancellable); - if (closure == NULL) - goto out; + + g_return_if_fail (closure != NULL); g_loadable_icon_load_async (avatar_icon, width, cancellable, avatar_icon_load_cb, closure); g_object_unref (result); - - return; - -out: - g_simple_async_result_set_op_res_gpointer (result, NULL, NULL); - g_simple_async_result_complete (result); - g_object_unref (result); } /* Return a ref on the GdkPixbuf */ |