summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2013-10-02 02:11:57 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2013-10-02 02:11:57 +0200
commit195534385764902751cd45c3748cef885aeaa21c (patch)
tree4f551b24bb1e1a74d9056069147372302c804a7a
parent190c21eabb82dd7571397048077d2b383f30b17d (diff)
downloadtdv-195534385764902751cd45c3748cef885aeaa21c.tar.gz
tdv-195534385764902751cd45c3748cef885aeaa21c.tar.xz
tdv-195534385764902751cd45c3748cef885aeaa21c.zip
Add a workaround for GLib < 2.33.1
I wanted to have it working in Wheezy and this was standing in the way, so I went for the quick fix that I'd made available to myself.
-rw-r--r--src/stardict.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stardict.c b/src/stardict.c
index e54755d..d81848c 100644
--- a/src/stardict.c
+++ b/src/stardict.c
@@ -585,6 +585,12 @@ load_dict (StardictDict *sd, const gchar *filename, gboolean gzipped,
if (!fis)
goto cannot_open;
+ // As a simple workaround for GLib < 2.33.1 and the lack of support for
+ // the GSeekable interface in GDataInputStream, disable dictzip.
+ //
+ // http://lists.gnu.org/archive/html/qemu-devel/2013-06/msg04690.html
+ if (!glib_check_version (2, 33, 1))
+ {
// Try opening it as a dictzip file first
DictzipInputStream *dzis =
dictzip_input_stream_new (G_INPUT_STREAM (fis), NULL);
@@ -598,6 +604,7 @@ load_dict (StardictDict *sd, const gchar *filename, gboolean gzipped,
// If unsuccessful, just read it all, as it is, into memory
if (!g_seekable_seek (G_SEEKABLE (fis), 0, G_SEEK_SET, NULL, error))
goto done;
+ }
GByteArray *ba = g_byte_array_new ();
GZlibDecompressor *zd