correctly paint toolbar separators with gtk-2.8 (bnc#770013)
[LibreOffice.git] / liblangtag / liblangtag-0.2-datadir.patch
blob55b2a3a3d06b4c7af49c274721cae40937d94f4f
1 --- misc/liblangtag-0.2/liblangtag/lt-database.c 2012-01-31 11:27:16.000000000 +0100
2 +++ misc/build/liblangtag-0.2/liblangtag/lt-database.c 2012-06-12 01:32:57.354123185 +0200
3 @@ -26,6 +26,7 @@
4 #include "lt-mem.h"
5 #include "lt-ext-module.h"
6 #include "lt-database.h"
7 +#include <string.h>
10 /**
11 @@ -44,10 +45,41 @@
12 static lt_grandfathered_db_t *__db_grandfathered = NULL;
13 static lt_redundant_db_t *__db_redundant = NULL;
15 +/* this is a hack and might need some proper runtime de/allocation, but ... */
16 +#define DATADIR_MAX_PATH_LEN 512
17 +static char lt_db_datadir[DATADIR_MAX_PATH_LEN] = { 0 };
20 /*< private >*/
22 /*< public >*/
24 +/**
25 + * lt_db_set_datadir:
26 + *
27 + * Set the directory where database files are installed.
28 + * This overrides the default prefix= location if called before
29 + * lt_db_initialize().
30 + */
31 +void
32 +lt_db_set_datadir(const char* path)
34 + strncpy( lt_db_datadir, path, DATADIR_MAX_PATH_LEN-1);
35 + lt_db_datadir[DATADIR_MAX_PATH_LEN-1] = 0;
38 +/**
39 + * lt_db_get_datadir:
40 + *
41 + * Obtain the directory where database files are installed.
42 + * Only if set with lt_db_set_datadir().
43 + */
44 +const char*
45 +lt_db_get_datadir(void)
47 + return lt_db_datadir;
50 /**
51 * lt_db_initialize:
53 --- misc/liblangtag-0.2/liblangtag/lt-database.h 2012-01-31 11:27:04.000000000 +0100
54 +++ misc/build/liblangtag-0.2/liblangtag/lt-database.h 2012-06-12 00:23:04.345618028 +0200
55 @@ -37,6 +37,8 @@
57 G_BEGIN_DECLS
59 +void lt_db_set_datadir (const char*);
60 +const char* lt_db_get_datadir (void);
61 void lt_db_initialize (void);
62 void lt_db_finalize (void);
63 lt_lang_db_t *lt_db_get_lang (void);
64 --- misc/liblangtag-0.2/liblangtag/lt-xml.c 2012-02-02 09:54:51.000000000 +0100
65 +++ misc/build/liblangtag-0.2/liblangtag/lt-xml.c 2012-06-12 00:23:04.477618565 +0200
66 @@ -45,7 +45,20 @@
68 G_LOCK_DEFINE_STATIC (lt_xml);
71 +/* defined in lt-database.c */
72 +extern const char* lt_db_get_datadir(void);
74 /*< private >*/
75 +static const char*
76 +lt_xml_get_datadir()
78 + const char* datadir = lt_db_get_datadir();
79 + if (datadir && *datadir)
80 + return datadir;
81 + return REGDATADIR;
84 static gboolean
85 lt_xml_read_subtag_registry(lt_xml_t *xml,
86 GError **error)
87 @@ -62,7 +75,7 @@
88 if (!g_file_test(regfile, G_FILE_TEST_EXISTS)) {
89 g_free(regfile);
90 #endif
91 - regfile = g_build_filename(REGDATADIR, "language-subtag-registry.xml", NULL);
92 + regfile = g_build_filename(lt_xml_get_datadir(), "language-subtag-registry.xml", NULL);
93 #ifdef GNOME_ENABLE_DEBUG
95 #endif
96 @@ -120,7 +133,7 @@
97 if (!g_file_test(regfile, G_FILE_TEST_EXISTS)) {
98 g_free(regfile);
99 #endif
100 - regfile = g_build_filename(REGDATADIR, "common", "bcp47", filename, NULL);
101 + regfile = g_build_filename(lt_xml_get_datadir(), "common", "bcp47", filename, NULL);
102 #ifdef GNOME_ENABLE_DEBUG
104 #endif