[network-manager-applet] editor: fix listing connections in the editor on ppc64 platform (rh #608663)



commit e7750a891da8d930e26b806c21707bc4f1050aa3
Author: JiÅ?í KlimeÅ¡ <jklimes redhat com>
Date:   Thu Jul 1 19:54:46 2010 +0200

    editor: fix listing connections in the editor on ppc64 platform (rh #608663)
    
    Getting candidate_type in get_treeview_for_type() was done via GPOINTER_TO_UINT,
    that truncated the GType (actually gsize, i.e. ungigned long). Changed to
    GPOINTER_TO_SIZE, other ocurrences as well.  It worked on other platforms,
    because the type usually fits in 32-bits there.
    When setting the type, GUINT_TO_POINTER is safe, but changed to GSIZE_TO_POINTER
    to be more clear.

 src/connection-editor/nm-connection-list.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index a6b20b5..99313fc 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -142,7 +142,7 @@ get_treeview_for_type (NMConnectionList *list, GType ctype)
 		GtkTreeView *candidate = GTK_TREE_VIEW (iter->data);
 		GType candidate_type;
 
-		candidate_type = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (candidate), TV_TYPE_TAG));
+		candidate_type = GPOINTER_TO_SIZE (g_object_get_data (G_OBJECT (candidate), TV_TYPE_TAG));
 		if (candidate_type == ctype)
 			return candidate;
 	}
@@ -700,7 +700,7 @@ add_clicked (GtkButton *button, gpointer user_data)
 	GType ctype;
 
 	if (!info->new_func) {
-		ctype = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (info->treeview), TV_TYPE_TAG));
+		ctype = GPOINTER_TO_SIZE (g_object_get_data (G_OBJECT (info->treeview), TV_TYPE_TAG));
 		g_warning ("No new-connection function registered for type '%s'",
 		           g_type_name (ctype));
 		return;
@@ -1377,7 +1377,7 @@ add_connection_tab (NMConnectionList *self,
 	add_connection_buttons (self, prefix, treeview, ctype, new_func);
 	gtk_widget_show_all (GTK_WIDGET (notebook));
 
-	g_object_set_data (G_OBJECT (treeview), TV_TYPE_TAG, GUINT_TO_POINTER (ctype));
+	g_object_set_data (G_OBJECT (treeview), TV_TYPE_TAG, GSIZE_TO_POINTER (ctype));
 	self->treeviews = g_slist_prepend (self->treeviews, treeview);
 
 	if (def_type == ctype) {
@@ -1574,7 +1574,7 @@ nm_connection_list_set_type (NMConnectionList *self, GType ctype)
 		GType child_type;
 
 		child = gtk_notebook_get_nth_page (notebook, i);
-		child_type = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (child), TV_TYPE_TAG));
+		child_type = GPOINTER_TO_SIZE (g_object_get_data (G_OBJECT (child), TV_TYPE_TAG));
 		if (child_type == ctype) {
 			gtk_notebook_set_current_page (notebook, i);
 			break;



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