[alacarte] Fix crash in on_menu_tree_cursor_changed()



commit 1646c1919499c4cbc4b823fdfa05659e8af3455d
Author: Alexandre Rostovtsev <tetromino gmail com>
Date:   Tue Aug 23 21:15:09 2011 +0200

    Fix crash in on_menu_tree_cursor_changed()
    
    This bug is caused by the fact that
    treeview.get_selection().get_selected() can return a None iter when the
    selection has no rows (e.g. if the user has deselected a row by
    Ctrl-clicking on it).
    
    The solution is to use gtk.SELECTION_BROWSE selection mode; it will
    ensure that one row is always selected and valid iters are returned from
    the selection's get_selected().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=652454

 Alacarte/MainWindow.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/Alacarte/MainWindow.py b/Alacarte/MainWindow.py
index be7734d..e6685e1 100644
--- a/Alacarte/MainWindow.py
+++ b/Alacarte/MainWindow.py
@@ -183,6 +183,7 @@ class MainWindow:
 		menus.append_column(column)
 		menus.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, self.dnd_menus, Gdk.DragAction.COPY)
 		menus.enable_model_drag_dest(self.dnd_both, Gdk.DragAction.PRIVATE)
+		menus.get_selection().set_mode(Gtk.SelectionMode.BROWSE)
 
 	def setupItemTree(self):
 		items = self.tree.get_object('item_tree')



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