SongSort, ...: use libicu instead of GLib's g_utf8_*()

This commit is contained in:
Max Kellermann
2014-02-23 19:27:08 +01:00
parent 6d9739165e
commit 33fc3af775
11 changed files with 310 additions and 38 deletions

View File

@@ -27,6 +27,7 @@
#include "SongSort.hxx"
#include "Song.hxx"
#include "LightSong.hxx"
#include "lib/icu/Collate.hxx"
#include "fs/Traits.hxx"
#include "util/Alloc.hxx"
#include "util/Error.hxx"
@@ -35,8 +36,6 @@ extern "C" {
#include "util/list_sort.h"
}
#include <glib.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
@@ -229,7 +228,8 @@ directory_cmp(gcc_unused void *priv,
{
const Directory *a = (const Directory *)_a;
const Directory *b = (const Directory *)_b;
return g_utf8_collate(a->path.c_str(), b->path.c_str());
return IcuCollate(a->path.c_str(), b->path.c_str());
}
void

View File

@@ -21,13 +21,12 @@
#include "SongSort.hxx"
#include "Song.hxx"
#include "tag/Tag.hxx"
#include "lib/icu/Collate.hxx"
extern "C" {
#include "util/list_sort.h"
}
#include <glib.h>
#include <stdlib.h>
static int
@@ -39,7 +38,7 @@ compare_utf8_string(const char *a, const char *b)
if (b == nullptr)
return 1;
return g_utf8_collate(a, b);
return IcuCollate(a, b);
}
/**
@@ -104,7 +103,7 @@ song_cmp(gcc_unused void *priv, struct list_head *_a, struct list_head *_b)
return ret;
/* still no difference? compare file name */
return g_utf8_collate(a->uri, b->uri);
return IcuCollate(a->uri, b->uri);
}
void