commit 5cfeb293164dfc8e85bb1f65f089b55e7f13f00b
Author: phantomjinx <p.g.richard...@phantomjinx.co.uk>
Date:   Tue Nov 8 21:15:20 2011 +0000

    Remove obsolete workaround for gtk 2.54
    
    * BROKEN_GTK_TREE_SORT is no longer necessary since required gtk version is
      for gtk 3.0+

 libgtkpod/gp_private.h                     |    4 ---
 plugins/sorttab_display/display_sorttabs.c |   14 +---------
 plugins/track_display/display_tracks.c     |   35 ++++++---------------------
 3 files changed, 10 insertions(+), 43 deletions(-)
---
diff --git a/libgtkpod/gp_private.h b/libgtkpod/gp_private.h
index 3301707..e0cad55 100644
--- a/libgtkpod/gp_private.h
+++ b/libgtkpod/gp_private.h
@@ -36,10 +36,6 @@
 
 #include <gtk/gtk.h>
 
-/* tree sort cannot be unsorted by choosing the default sort
- * column. Set to 1 if it's broken, 0 if it's not broken */
-#define BROKEN_GTK_TREE_SORT (!RUNTIME_GTK_CHECK_VERSION(2,5,4))
-
 /* Drag and drop definitions */
 #define TGNR(a) (guint)(sizeof(a)/sizeof(GtkTargetEntry))
 #define DND_GTKPOD_TRACKLIST_TYPE "application/gtkpod-tracklist"
diff --git a/plugins/sorttab_display/display_sorttabs.c 
b/plugins/sorttab_display/display_sorttabs.c
index 5db6f52..8497a2e 100644
--- a/plugins/sorttab_display/display_sorttabs.c
+++ b/plugins/sorttab_display/display_sorttabs.c
@@ -2199,12 +2199,7 @@ void st_enable_disable_view_sort(gint inst, gboolean 
enable) {
             if (prefs_get_int("st_sort") != SORT_NONE) {
                 SortTab *st = sorttab[inst];
                 if (st && (st->current_category != ST_CAT_SPECIAL) && 
st->model) {
-                    if (BROKEN_GTK_TREE_SORT) {
-                        gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE 
(st->model), ST_COLUMN_ENTRY, st_data_compare_func, GINT_TO_POINTER(inst), 
NULL);
-                    }
-                    else {
-                        gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(st->model), ST_COLUMN_ENTRY, prefs_get_int("st_sort"));
-                    }
+                    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(st->model), ST_COLUMN_ENTRY, prefs_get_int("st_sort"));
                 }
             }
             st_enable_disable_view_sort(inst + 1, enable);
@@ -2216,12 +2211,7 @@ void st_enable_disable_view_sort(gint inst, gboolean 
enable) {
             if (prefs_get_int("st_sort") != SORT_NONE) {
                 SortTab *st = sorttab[inst];
                 if (st && (st->current_category != ST_CAT_SPECIAL) && 
st->model) {
-                    if (BROKEN_GTK_TREE_SORT) {
-                        gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE 
(st->model), ST_COLUMN_ENTRY, st_nosort_comp, NULL, NULL);
-                    }
-                    else {
-                        gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(st->model), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, 
prefs_get_int("st_sort"));
-                    }
+                    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(st->model), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, 
prefs_get_int("st_sort"));
                 }
             }
             st_enable_disable_view_sort(inst + 1, enable);
diff --git a/plugins/track_display/display_tracks.c 
b/plugins/track_display/display_tracks.c
index 57ca1f6..095a050 100644
--- a/plugins/track_display/display_tracks.c
+++ b/plugins/track_display/display_tracks.c
@@ -1588,17 +1588,13 @@ static void tm_unsort(void) {
         }
 
         prefs_set_int("tm_sort", SORT_NONE);
-        if (!BROKEN_GTK_TREE_SORT) {
-            /* no need to comment this out -- searching still works, but for 
lack
+
+        /* no need to comment this out -- searching still works, but for lack
              of a ctrl-g only the first occurence will be found */
-            /*     gtk_tree_view_set_enable_search (GTK_TREE_VIEW
-             * (track_treeview), FALSE);*/
-            gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE (model), 
GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, GTK_SORT_ASCENDING);
-            tm_adopt_order();
-        }
-        else {
-            gtkpod_warning(_("Cannot unsort track view because of a bug in the 
GTK lib you are using (%d.%d.%d < 2.5.4). Once you sort the track view, you 
cannot go back to the unsorted state.\n\n"), gtk_major_version, 
gtk_minor_version, gtk_micro_version);
-        }
+        /*         gtk_tree_view_set_enable_search (GTK_TREE_VIEW
+         * (track_treeview), FALSE);*/
+        gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE (model), 
GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, GTK_SORT_ASCENDING);
+        tm_adopt_order();
         tm_sort_counter(-1);
     }
 }
@@ -2236,11 +2232,6 @@ static TM_item tm_lookup_col_id(GtkTreeViewColumn 
*column) {
     return -1;
 }
 
-/* Compare function to avoid sorting */
-static gint tm_nosort_comp(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter 
*b, gpointer user_data) {
-    return 0;
-}
-
 /* Disable sorting of the view during lengthy updates. */
 /* @enable: TRUE: enable, FALSE: disable */
 void tm_enable_disable_view_sort(gboolean enable) {
@@ -2259,12 +2250,7 @@ void tm_enable_disable_view_sort(gboolean enable) {
                     model = 
gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(model));
                 }
 
-                if (BROKEN_GTK_TREE_SORT) {
-                    gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE (model), 
prefs_get_int("tm_sortcol"), tm_data_compare_func, NULL, NULL);
-                }
-                else {
-                    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(model), prefs_get_int("tm_sortcol"), prefs_get_int("tm_sort"));
-                }
+                gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(model), prefs_get_int("tm_sortcol"), prefs_get_int("tm_sort"));
             }
         }
     }
@@ -2278,12 +2264,7 @@ void tm_enable_disable_view_sort(gboolean enable) {
                     model = 
gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(model));
                 }
 
-                if (BROKEN_GTK_TREE_SORT) {
-                    gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE (model), 
prefs_get_int("tm_sortcol"), tm_nosort_comp, NULL, NULL);
-                }
-                else {
-                    gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(model), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, prefs_get_int("tm_sort"));
-                }
+                gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE 
(model), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, prefs_get_int("tm_sort"));
             }
         }
         disable_count++;

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to