Comment 24 for bug 990949

Revision history for this message
Gabriele N. Tornetta (phoenix1987) wrote :

Please find attached my patch for this bug. I have basically redefined the old _on_cursor_changed into a new method, _cursor_changed_event, and used it inside _on_row_activated. This seems to work nicely, for no stuff is being disconnected and such.

Here's the code (file is outline.py in the main plugin directory):

    def _on_cursor_changed(self, view):
        #Uncomment the line below to get the old behaviour
        #self._cursor_changed_event(view)
        pass

    def _cursor_changed_event(self, view):
        selection = view.get_selection()
        if not selection:
            return

        store, it = selection.get_selected()
        if not it:
            return

        outline_node = store.get_value(it, 2)
        self._on_node_selected(outline_node)

    def _on_row_activated(self, view, path, column):
        it = self._store.get_iter(path)
        node = self._store.get(it, 2)[0]

        self._on_node_activated(node)

        #Comment the line below to get the old behaviour
        self._cursor_changed_event(view)