xdgmime: sort glob hits with larger weight first
authorAlexander Larsson <alexl@redhat.com>
Thu, 8 Oct 2009 09:59:23 +0000 (11:59 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 8 Oct 2009 10:02:52 +0000 (12:02 +0200)
Higher weight is more important, so return these first meaning
they will be used as the default.

gio/xdgmime/xdgmimecache.c
gio/xdgmime/xdgmimeglob.c

index 676578774cba0b542c9890868113f82cd26b1532..97fe9751bd446514011fcaff2398755ec3781d3d 100644 (file)
@@ -565,7 +565,7 @@ static int compare_mime_weight (const void *a, const void *b)
   const MimeWeight *aa = (const MimeWeight *)a;
   const MimeWeight *bb = (const MimeWeight *)b;
 
-  return aa->weight - bb->weight;
+  return bb->weight - aa->weight;
 }
 
 #define ISUPPER(c)             ((c) >= 'A' && (c) <= 'Z')
index 2a0c7777b754314d929d8c4cc3326c7a46860c34..c82bf222c80978b15e5ac51fbc35f0afb63965e8 100644 (file)
@@ -381,7 +381,7 @@ static int compare_mime_weight (const void *a, const void *b)
   const MimeWeight *aa = (const MimeWeight *)a;
   const MimeWeight *bb = (const MimeWeight *)b;
 
-  return aa->weight - bb->weight;
+  return bb->weight - aa->weight;
 }
 
 #define ISUPPER(c)             ((c) >= 'A' && (c) <= 'Z')