[totem] Fix use of GtkTreeView.get_path_at_pos() in the Jamendo plugin



commit 9edfcdeed3cd5d937c15049ed60c8c2a5154e55b
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Oct 23 13:58:32 2010 +0100

    Fix use of GtkTreeView.get_path_at_pos() in the Jamendo plugin
    
    This means it pretty much works now.

 src/plugins/jamendo/jamendo.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/jamendo/jamendo.py b/src/plugins/jamendo/jamendo.py
index 7cf2b11..ef35b5d 100644
--- a/src/plugins/jamendo/jamendo.py
+++ b/src/plugins/jamendo/jamendo.py
@@ -462,15 +462,15 @@ class JamendoPlugin(gobject.GObject, Peas.Activatable, PeasGtk.Configurable):
                 path = tv.get_path_at_pos(int(evt.x), int(evt.y))
                 sel  = tv.get_selection()
                 (rows, _) = sel.get_selected_rows()
-                if path[0] not in rows[1]:
+                if path[1] not in rows[1]:
                     sel.unselect_all()
-                    sel.select_path(path[0])
+                    sel.select_path(path[1])
                 tv.grab_focus()
                 self.popup.popup(None, None, None, evt.button, evt.time)
                 return True
             coords = evt.get_coords()
-            path, c, x, y = tv.get_path_at_pos(int(coords[0]), int(coords[1]))
-            if (len(path) == 1):
+            _, path, c, x, y = tv.get_path_at_pos(int(coords[0]), int(coords[1]))
+            if (path.get_depth() == 1):
                 if tv.row_expanded(path):
                     tv.collapse_row(path)
                 else:
@@ -665,7 +665,7 @@ class JamendoService(threading.Thread):
                 album['url'] = album['url'].replace('/en/', '/' + _('en') + '/')
                 gobject.idle_add(self.loop_cb[0], self.loop_cb[1], album)
             gobject.idle_add(self.done_cb[0], self.done_cb[1], albums)
-        except Exception, exc:
+        except Exception as exc:
             gobject.idle_add(self.error_cb[0], self.error_cb[1], exc)
         finally:
             self.lock.release()



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