[glib: 17/19] GWin32AppInfo: invert verb comparison function




commit d33c3747dc0ccbb4f6d4bf958257ae190b6a84cb
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Thu Dec 17 16:43:23 2020 +0000

    GWin32AppInfo: invert verb comparison function
    
    The list is sorted in ascending order, which means that to put
    verbs alphabetically we need to sort ealier verbs with -1. Same for
    the "open" verb and the preferred verb (if any).

 gio/gwin32appinfo.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gio/gwin32appinfo.c b/gio/gwin32appinfo.c
index 9e6b36c48..e77db37f4 100644
--- a/gio/gwin32appinfo.c
+++ b/gio/gwin32appinfo.c
@@ -733,18 +733,18 @@ compare_verbs (gconstpointer a,
   if (def != NULL)
     {
       if (_wcsicmp (ca->name, def) == 0)
-        return 1;
-      else if (_wcsicmp (cb->name, def) == 0)
         return -1;
+      else if (_wcsicmp (cb->name, def) == 0)
+        return 1;
     }
 
   is_open_ca = is_open (ca->name);
   is_open_cb = is_open (cb->name);
 
   if (is_open_ca && !is_open_cb)
-    return 1;
-  else if (is_open_ca && !is_open_cb)
     return -1;
+  else if (is_open_ca && !is_open_cb)
+    return 1;
 
   return _wcsicmp (ca->name, cb->name);
 }


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