gnome-control-center r8583 - trunk/capplets/keyboard



Author: jensg
Date: Wed Mar 19 18:09:49 2008
New Revision: 8583
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=8583&view=rev

Log:
2008-03-19  Jens Granseuer  <jensgr gmx net>

	* gnome-keyboard-properties-xkblt.c:
	(xkb_layouts_dnd_data_received): don't crash when called for a
	drag with no selected items (bug #523379)


Modified:
   trunk/capplets/keyboard/ChangeLog
   trunk/capplets/keyboard/gnome-keyboard-properties-xkblt.c

Modified: trunk/capplets/keyboard/gnome-keyboard-properties-xkblt.c
==============================================================================
--- trunk/capplets/keyboard/gnome-keyboard-properties-xkblt.c	(original)
+++ trunk/capplets/keyboard/gnome-keyboard-properties-xkblt.c	Wed Mar 19 18:09:49 2008
@@ -227,7 +227,7 @@
 			  GtkSelectionData * selection_data, guint info,
 			  guint t, GladeXML * dialog)
 {
-	/* Storing the value into selection - 
+	/* Storing the value into selection -
 	 * while it is actually not used
 	 */
 	gint idx = find_selected_layout_idx (dialog);
@@ -248,13 +248,17 @@
 	GtkTreeViewDropPosition pos;
 	gint didx;
 	gchar *id;
-	GSList *layouts_list = xkb_layouts_get_selected_list ();
-	GSList *node2Remove = g_slist_nth (layouts_list, sidx);
+	GSList *layouts_list;
+	GSList *node2Remove;
 
-	layouts_list = g_slist_remove_link (layouts_list, node2Remove);
+	if (sidx == -1)
+		return;
+
+	layouts_list = xkb_layouts_get_selected_list ();
+	node2Remove = g_slist_nth (layouts_list, sidx);
 
 	id = (gchar *) node2Remove->data;
-	g_slist_free_1 (node2Remove);
+	layouts_list = g_slist_delete_link (layouts_list, node2Remove);
 
 	if (!gtk_tree_view_get_dest_row_at_pos
 	    (GTK_TREE_VIEW (tree_view), x, y, &path, &pos)) {



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