[pitivi] medialibrary: Rework the way we sort files in the view



commit 1f766abc7125eb975ad79a195272db8421c7cc9f
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Fri Jan 11 12:57:54 2013 -0300

    medialibrary: Rework the way we sort files in the view
    
    We do not care about the case and the full path, but we only care about the basename
    of the uris (with the same case)

 pitivi/medialibrary.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 39ba62c..7cac4dd 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -24,6 +24,7 @@
 
 from gi.repository import Gst
 from gi.repository import GES
+from gi.repository import GLib
 from gi.repository import GObject
 from gi._glib import GError
 from gi.repository import Gtk
@@ -111,7 +112,9 @@ OTHER_KNOWN_FORMATS = ("video/mp2t")
 
 
 def compare_simple(model, iter1, iter2, user_data):
-    if model[iter1][user_data] < model[iter2][user_data]:
+    a_basename = GLib.path_get_basename(model[iter1][user_data]).lower()
+    b_basename = GLib.path_get_basename(model[iter2][user_data]).lower()
+    if a_basename < b_basename:
         return -1
     # Each element is unique, there is a strict order.
     return 1



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