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.
This commit is contained in:
parent
190c21eabb
commit
1955343857
|
@ -585,6 +585,12 @@ load_dict (StardictDict *sd, const gchar *filename, gboolean gzipped,
|
||||||
if (!fis)
|
if (!fis)
|
||||||
goto cannot_open;
|
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
|
// Try opening it as a dictzip file first
|
||||||
DictzipInputStream *dzis =
|
DictzipInputStream *dzis =
|
||||||
dictzip_input_stream_new (G_INPUT_STREAM (fis), NULL);
|
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 unsuccessful, just read it all, as it is, into memory
|
||||||
if (!g_seekable_seek (G_SEEKABLE (fis), 0, G_SEEK_SET, NULL, error))
|
if (!g_seekable_seek (G_SEEKABLE (fis), 0, G_SEEK_SET, NULL, error))
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
GByteArray *ba = g_byte_array_new ();
|
GByteArray *ba = g_byte_array_new ();
|
||||||
GZlibDecompressor *zd
|
GZlibDecompressor *zd
|
||||||
|
|
Loading…
Reference in New Issue