[gnome-session] Don't use internal GTK+ api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] Don't use internal GTK+ api
- Date: Sun, 16 Jan 2011 16:18:57 +0000 (UTC)
commit d2adb9d3e932473afb164840530595ede6997a8a
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 16 11:02:04 2011 -0500
Don't use internal GTK+ api
GtkTargetPair was always documented as private.
In GTK+ 3, it is gone from the headers. Operate on
GtkTargetEntry tables instead.
capplet/gsm-properties-dialog.c | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/capplet/gsm-properties-dialog.c b/capplet/gsm-properties-dialog.c
index 487250e..81a340c 100644
--- a/capplet/gsm-properties-dialog.c
+++ b/capplet/gsm-properties-dialog.c
@@ -601,19 +601,24 @@ setup_dialog (GsmPropertiesDialog *dialog)
GTK_DEST_DEFAULT_ALL,
NULL, 0,
GDK_ACTION_COPY);
- gtk_drag_dest_add_uri_targets (GTK_WIDGET (treeview));
+ gtk_drag_dest_add_uri_targets (GTK_WIDGET (treeview));
/* we don't want to accept drags coming from this widget */
targetlist = gtk_drag_dest_get_target_list (GTK_WIDGET (treeview));
if (targetlist != NULL) {
- GList *list;
- list = targetlist->list;
- while (list != NULL) {
- GtkTargetPair *targetpair;
- targetpair = list->data;
- targetpair->flags = GTK_TARGET_OTHER_WIDGET;
- list = list->next;
- }
+ GtkTargetEntry *targets;
+ guint n_targets;
+ gint i;
+
+ targets = gtk_target_table_new_from_list (targetlist, &n_targets);
+ for (i = 0; i < n_targets; i++)
+ targets[i].flags = GTK_TARGET_OTHER_WIDGET;
+
+ targetlist = gtk_target_list_new (targets, n_targets);
+ gtk_drag_dest_set_target_list (GTK_WIDGET (treeview), targetlist);
+ gtk_target_list_unref (targetlist);
+
+ gtk_target_table_free (targets, n_targets);
}
g_signal_connect (treeview, "drag_begin",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]