compare plugin/creator/category names UTF8-aware
[ardour.git] / gtk2_ardour / plugin_selector.cc
index ebfcc677ac6c4de2331cfb219ef22982bca826e0..bb96c7f392dc97e26b8d97d15f90f645f6bd42d9 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "ardour/plugin_manager.h"
 #include "ardour/plugin.h"
+#include "ardour/utils.h"
 
 #include "ardour_ui.h"
 #include "plugin_selector.h"
@@ -538,13 +539,13 @@ struct PluginMenuCompareByCreator {
     bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
            int cmp;
 
-           cmp = g_strcasecmp (a->creator.c_str(), b->creator.c_str());
+           cmp = cmp_nocase_utf8 (a->creator, b->creator);
 
            if (cmp < 0) {
                    return true;
            } else if (cmp == 0) {
                    /* same creator ... compare names */
-                   if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
+                   if (cmp_nocase_utf8 (a->name, b->name) < 0) {
                            return true;
                    }
            }
@@ -556,7 +557,7 @@ struct PluginMenuCompareByName {
     bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
            int cmp;
 
-           cmp = g_strcasecmp (a->name.c_str(), b->name.c_str());
+           cmp = cmp_nocase_utf8 (a->name, b->name);
 
            if (cmp < 0) {
                    return true;
@@ -574,13 +575,13 @@ struct PluginMenuCompareByCategory {
     bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
            int cmp;
 
-           cmp = g_strcasecmp (a->category.c_str(), b->category.c_str());
+           cmp = cmp_nocase_utf8 (a->category, b->category);
 
            if (cmp < 0) {
                    return true;
            } else if (cmp == 0) {
                    /* same category ... compare names */
-                   if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
+                   if (cmp_nocase_utf8 (a->name, b->name) < 0) {
                            return true;
                    }
            }