diff options
author | Milan Crha <mcrha@redhat.com> | 2010-10-07 01:26:08 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-10-07 01:26:08 +0800 |
commit | 1c6f2d154e74f908e2c4a137de0233b5faf4f6b6 (patch) | |
tree | 77a33236e48ed59a7c7c65e8a1c91481dd09f3eb /mail | |
parent | 1b2fefb086c3e34089beb8b89b22d79005cc7725 (diff) | |
download | gsoc2013-evolution-1c6f2d154e74f908e2c4a137de0233b5faf4f6b6.tar.gz gsoc2013-evolution-1c6f2d154e74f908e2c4a137de0233b5faf4f6b6.tar.zst gsoc2013-evolution-1c6f2d154e74f908e2c4a137de0233b5faf4f6b6.zip |
Bug #631320 - GtkObject is gone in GTK3
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-reader.c | 13 | ||||
-rw-r--r-- | mail/em-filter-rule.c | 6 | ||||
-rw-r--r-- | mail/em-folder-selector.c | 12 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 56 | ||||
-rw-r--r-- | mail/mail-mt.c | 10 | ||||
-rw-r--r-- | mail/mail-vfolder.c | 2 | ||||
-rw-r--r-- | mail/message-list.c | 101 |
7 files changed, 80 insertions, 120 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 9eda80a5a5..047f386c19 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -109,14 +109,7 @@ static gchar *default_xfer_messages_uri; static GQuark quark_private; static guint signals[LAST_SIGNAL]; -G_DEFINE_INTERFACE (EMailReader, e_mail_reader, GTK_TYPE_OBJECT) - -static void -mail_reader_destroy (GObject *object) -{ - /* This will free the private struct. */ - g_object_set_qdata (object, quark_private, NULL); -} +G_DEFINE_INTERFACE (EMailReader, e_mail_reader, G_TYPE_OBJECT) static void mail_reader_private_free (EMailReaderPrivate *priv) @@ -3227,10 +3220,6 @@ init_private: G_OBJECT (reader), quark_private, g_slice_new0 (EMailReaderPrivate), (GDestroyNotify) mail_reader_private_free); - - g_signal_connect ( - reader, "destroy", - G_CALLBACK (mail_reader_destroy), NULL); } void diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c index 5a3f3adaf6..9d5ba0a527 100644 --- a/mail/em-filter-rule.c +++ b/mail/em-filter-rule.c @@ -519,7 +519,7 @@ get_widget (EFilterRule *fr, ERuleContext *rc) GtkWidget *widget, *hbox, *add, *label; GtkWidget *parts, *inframe, *w; GtkWidget *scrolledwindow; - GtkObject *hadj, *vadj; + GtkAdjustment *hadj, *vadj; GList *l; EFilterPart *part; struct _rule_data *data; @@ -581,8 +581,8 @@ get_widget (EFilterRule *fr, ERuleContext *rc) hadj = gtk_adjustment_new (0.0, 0.0, 1.0, 1.0 ,1.0, 1.0); vadj = gtk_adjustment_new (0.0, 0.0, 1.0, 1.0 ,1.0, 1.0); - scrolledwindow = gtk_scrolled_window_new ( - GTK_ADJUSTMENT (hadj), GTK_ADJUSTMENT (vadj)); + scrolledwindow = gtk_scrolled_window_new (hadj, vadj); + gtk_scrolled_window_set_policy ( GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c index e20b9f711b..e4e9bbdd3a 100644 --- a/mail/em-folder-selector.c +++ b/mail/em-folder-selector.c @@ -48,7 +48,7 @@ folder_selector_finalize (GObject *object) } static void -folder_selector_destroy (GtkObject *object) +folder_selector_dispose (GObject *object) { EMFolderSelector *emfs = EM_FOLDER_SELECTOR (object); GtkTreeModel *model; @@ -59,23 +59,21 @@ folder_selector_destroy (GtkObject *object) emfs->created_id = 0; } - /* Chain up to parent's destroy() method. */ - GTK_OBJECT_CLASS (parent_class)->destroy (object); + /* Chain up to parent's dispose() method. */ + if (G_OBJECT_CLASS (parent_class)->dispose) + G_OBJECT_CLASS (parent_class)->dispose (object); } static void folder_selector_class_init (EMFolderSelectorClass *class) { GObjectClass *object_class; - GtkObjectClass *gtk_object_class; parent_class = g_type_class_peek_parent (class); object_class = G_OBJECT_CLASS (class); object_class->finalize = folder_selector_finalize; - - gtk_object_class = GTK_OBJECT_CLASS (class); - gtk_object_class->destroy = folder_selector_destroy; + object_class->dispose = folder_selector_dispose; } static void diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 512aa9b026..db23df4969 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -702,8 +702,28 @@ static void folder_tree_dispose (GObject *object) { EMFolderTreePrivate *priv; + GtkTreeModel *model; priv = EM_FOLDER_TREE_GET_PRIVATE (object); + model = gtk_tree_view_get_model (GTK_TREE_VIEW (object)); + + if (priv->loaded_row_id != 0) { + g_signal_handler_disconnect (model, priv->loaded_row_id); + priv->loaded_row_id = 0; + } + + if (priv->autoscroll_id != 0) { + g_source_remove (priv->autoscroll_id); + priv->autoscroll_id = 0; + } + + if (priv->autoexpand_id != 0) { + gtk_tree_row_reference_free (priv->autoexpand_row); + priv->autoexpand_row = NULL; + + g_source_remove (priv->autoexpand_id); + priv->autoexpand_id = 0; + } if (priv->text_renderer != NULL) { g_object_unref (priv->text_renderer); @@ -734,38 +754,6 @@ folder_tree_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } -static void -em_folder_tree_destroy (GtkObject *object) -{ - EMFolderTreePrivate *priv; - GtkTreeModel *model; - - priv = EM_FOLDER_TREE_GET_PRIVATE (object); - - model = gtk_tree_view_get_model (GTK_TREE_VIEW (object)); - - if (priv->loaded_row_id != 0) { - g_signal_handler_disconnect (model, priv->loaded_row_id); - priv->loaded_row_id = 0; - } - - if (priv->autoscroll_id != 0) { - g_source_remove (priv->autoscroll_id); - priv->autoscroll_id = 0; - } - - if (priv->autoexpand_id != 0) { - gtk_tree_row_reference_free (priv->autoexpand_row); - priv->autoexpand_row = NULL; - - g_source_remove (priv->autoexpand_id); - priv->autoexpand_id = 0; - } - - /* Chain up to parent's destroy() method. */ - GTK_OBJECT_CLASS (parent_class)->destroy (object); -} - static gboolean folder_tree_button_press_event (GtkWidget *widget, GdkEventButton *event) @@ -964,7 +952,6 @@ static void folder_tree_class_init (EMFolderTreeClass *class) { GObjectClass *object_class; - GtkObjectClass *gtk_object_class; GtkWidgetClass *widget_class; GtkTreeViewClass *tree_view_class; @@ -975,9 +962,6 @@ folder_tree_class_init (EMFolderTreeClass *class) object_class->dispose = folder_tree_dispose; object_class->finalize = folder_tree_finalize; - gtk_object_class = GTK_OBJECT_CLASS (class); - gtk_object_class->destroy = em_folder_tree_destroy; - widget_class = GTK_WIDGET_CLASS (class); widget_class->button_press_event = folder_tree_button_press_event; widget_class->key_press_event = folder_tree_key_press_event; diff --git a/mail/mail-mt.c b/mail/mail-mt.c index 5a32e155fb..cbf836aa06 100644 --- a/mail/mail-mt.c +++ b/mail/mail-mt.c @@ -227,14 +227,16 @@ mail_msg_unref (gpointer msg) /* hash table of ops->dialogue of active errors */ static GHashTable *active_errors = NULL; -static void error_destroy (GtkObject *o, gpointer data) +static void +error_finalized (gpointer data, GObject *gone_gd) { g_hash_table_remove (active_errors, data); } -static void error_response (GtkObject *o, gint button, gpointer data) +static void +error_response (GtkWidget *dialog, gint button, gpointer data) { - gtk_widget_destroy ((GtkWidget *)o); + gtk_widget_destroy (dialog); } void @@ -284,7 +286,7 @@ mail_msg_check_error (gpointer msg) g_hash_table_insert (active_errors, m->info, gd); g_signal_connect(gd, "response", G_CALLBACK(error_response), m->info); - g_signal_connect(gd, "destroy", G_CALLBACK(error_destroy), m->info); + g_object_weak_ref (G_OBJECT (gd), error_finalized, m->info); if (m->priv->cancelable) m->priv->error = (GtkWidget *) gd; else diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index cb47af8efb..cd9db555e9 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -1189,7 +1189,7 @@ vfolder_edit_rule (const gchar *uri) url = camel_url_new (uri, NULL); if (url && url->fragment && (rule = e_rule_context_find_rule ((ERuleContext *)context, url->fragment, NULL))) { - g_object_ref ((GtkObject *)rule); + g_object_ref (G_OBJECT (rule)); newrule = e_filter_rule_clone (rule); w = e_filter_rule_get_widget ((EFilterRule *)newrule, (ERuleContext *)context); diff --git a/mail/message-list.c b/mail/message-list.c index ad7f527b8b..681cc53dce 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -2430,58 +2430,6 @@ message_list_init (MessageList *message_list) } static void -message_list_destroy (GtkObject *object) -{ - MessageList *message_list = MESSAGE_LIST (object); - MessageListPrivate *p = message_list->priv; - - p->destroyed = TRUE; - - if (message_list->folder) { - mail_regen_cancel (message_list); - - if (message_list->uid_nodemap) { - g_hash_table_foreach (message_list->uid_nodemap, (GHFunc)clear_info, message_list); - g_hash_table_destroy (message_list->uid_nodemap); - message_list->uid_nodemap = NULL; - } - - g_signal_handlers_disconnect_by_func ( - message_list->folder, folder_changed, message_list); - g_object_unref (message_list->folder); - message_list->folder = NULL; - } - - if (p->invisible) { - g_object_unref (p->invisible); - p->invisible = NULL; - } - - if (message_list->extras) { - g_object_unref (message_list->extras); - message_list->extras = NULL; - } - - if (message_list->model) { - g_object_unref (message_list->model); - message_list->model = NULL; - } - - if (message_list->idle_id != 0) { - g_source_remove (message_list->idle_id); - message_list->idle_id = 0; - } - - if (message_list->seen_id) { - g_source_remove (message_list->seen_id); - message_list->seen_id = 0; - } - - /* Chain up to parent's destroy() method. */ - GTK_OBJECT_CLASS (parent_class)->destroy (object); -} - -static void message_list_set_property (GObject *object, guint property_id, const GValue *value, @@ -2530,9 +2478,10 @@ message_list_get_property (GObject *object, static void message_list_dispose (GObject *object) { + MessageList *message_list = MESSAGE_LIST (object); MessageListPrivate *priv; - priv = MESSAGE_LIST_GET_PRIVATE (object); + priv = MESSAGE_LIST_GET_PRIVATE (message_list); if (priv->shell_backend != NULL) { g_object_unref (priv->shell_backend); @@ -2549,6 +2498,48 @@ message_list_dispose (GObject *object) priv->paste_target_list = NULL; } + priv->destroyed = TRUE; + + if (message_list->folder) { + mail_regen_cancel (message_list); + + if (message_list->uid_nodemap) { + g_hash_table_foreach (message_list->uid_nodemap, (GHFunc)clear_info, message_list); + g_hash_table_destroy (message_list->uid_nodemap); + message_list->uid_nodemap = NULL; + } + + g_signal_handlers_disconnect_by_func ( + message_list->folder, folder_changed, message_list); + g_object_unref (message_list->folder); + message_list->folder = NULL; + } + + if (priv->invisible) { + g_object_unref (priv->invisible); + priv->invisible = NULL; + } + + if (message_list->extras) { + g_object_unref (message_list->extras); + message_list->extras = NULL; + } + + if (message_list->model) { + g_object_unref (message_list->model); + message_list->model = NULL; + } + + if (message_list->idle_id != 0) { + g_source_remove (message_list->idle_id); + message_list->idle_id = 0; + } + + if (message_list->seen_id) { + g_source_remove (message_list->seen_id); + message_list->seen_id = 0; + } + /* Chain up to parent's dispose() method. */ G_OBJECT_CLASS (parent_class)->dispose (object); } @@ -2610,7 +2601,6 @@ static void message_list_class_init (MessageListClass *class) { GObjectClass *object_class; - GtkObjectClass *gtk_object_class; gint i; for (i = 0; i < G_N_ELEMENTS (ml_drag_info); i++) @@ -2625,9 +2615,6 @@ message_list_class_init (MessageListClass *class) object_class->dispose = message_list_dispose; object_class->finalize = message_list_finalize; - gtk_object_class = GTK_OBJECT_CLASS (class); - gtk_object_class->destroy = message_list_destroy; - class->message_list_built = NULL; /* Inherited from ESelectableInterface */ |