PKG_CHECK_MODULES(GSTREAMER_TAG, gstreamer-tag-0.10 >= $GSTREAMER_TAG_REQUIRED);
PKG_CHECK_MODULES(GSTREAMER_APP, gstreamer-app-0.10 >= $GSTREAMER_APP_REQUIRED);
RYGEL_CHECK_PACKAGES([sqlite3 gstreamer-tag-0.10 gstreamer-app-0.10])
+ AC_CHECK_HEADER([unistr.h],
+ AC_CHECK_LIB([unistring],
+ [u8_strcoll],
+ [have_unistring=yes],[have_unistring=no]))
+ if test "x$have_unistring" = "xyes"; then
+ AC_DEFINE([HAVE_UNISTRING],[1],[Use libunistring for collation])
+ COLLATION_CFLAGS=
+ COLLATION_LIBS=-lunistring
+ AC_SUBST([COLLATION_CFLAGS])
+ AC_SUBST([COLLATION_LIBS])
+ fi
fi
dnl Gettext
rygel-media-export-item.vala \
rygel-media-export-jpeg-writer.vala \
rygel-media-export-object-factory.vala \
- rygel-media-export-writable-db-container.vala
+ rygel-media-export-writable-db-container.vala \
+ rygel-media-export-collate.c
librygel_media_export_la_VALAFLAGS = \
--pkg gupnp-dlna-1.0 \
$(LIBGUPNP_DLNA_LIBS) \
$(GSTREAMER_TAG_LIBS) \
$(GSTREAMER_APP_LIBS) \
- $(LIBSQLITE3_LIBS)
+ $(LIBSQLITE3_LIBS) \
+ $(COLLATION_LIBS)
librygel_media_export_la_LDFLAGS = $(RYGEL_PLUGIN_LINKER_FLAGS)
--- /dev/null
+/*
+ * Copyright (C) 2012 Jens Georg <mail@jensge.org>.
+ *
+ * Author: Jens Georg <mail@jensge.org>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <glib.h>
+
+#ifdef HAVE_UNISTRING
+#include <unistr.h>
+gint rygel_media_export_utf8_collate_str (const char *a, const char *b)
+{
+ return u8_strcoll (a, b);
+}
+
+#else
+
+gint rygel_media_export_utf8_collate_str (const char *a, const char *b)
+{
+ return g_utf8_collate (a, b);
+}
+#endif
SQLITE_ERROR
}
+namespace Rygel.MediaExport {
+ extern static int utf8_collate_str (string a, string b);
+}
+
/**
* This class is a thin wrapper around SQLite's database object.
*
unowned uint8[] _b = (uint8[]) b;
_b.length = blen;
- var str_a = ((string) _a).casefold ();
- var str_b = ((string) _b).casefold ();
+ var str_a = ((string) _a);
+ var str_b = ((string) _b);
- return str_a.collate (str_b);
+ return utf8_collate_str (str_a, str_b);
}
/**