[gnome-software] Fix the sort function for the plugins



commit 5775152647b0e455101edb25d9d93d317ce98e18
Author: Richard Hughes <richard hughsie com>
Date:   Mon Sep 2 11:22:46 2013 +0100

    Fix the sort function for the plugins

 src/gs-plugin-loader.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 32d7f7b..df2dfe2 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -1720,7 +1720,11 @@ gs_plugin_loader_plugin_sort_fn (gconstpointer a, gconstpointer b)
 {
        GsPlugin **pa = (GsPlugin **) a;
        GsPlugin **pb = (GsPlugin **) b;
-       return (*pa)->priority - (*pb)->priority;
+       if ((*pa)->priority < (*pb)->priority)
+               return -1;
+       if ((*pa)->priority > (*pb)->priority)
+               return 1;
+       return 0;
 }
 
 /**


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