diff options
author | rbuj <[email protected]> | 2019-09-19 18:06:59 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-20 21:40:42 +0200 |
commit | b49f703b6a3f61fc20de310b0343dd2f6661fbed (patch) | |
tree | 3c8200276eca789717b0bed08795b51e57edb6c2 /libcaja-private/caja-extensions.c | |
parent | a68b35c0bb7a6b3b8962538445689147aa41b88d (diff) | |
download | caja-b49f703b6a3f61fc20de310b0343dd2f6661fbed.tar.bz2 caja-b49f703b6a3f61fc20de310b0343dd2f6661fbed.tar.xz |
caja-extensions: allows the translation of copyright
Diffstat (limited to 'libcaja-private/caja-extensions.c')
-rw-r--r-- | libcaja-private/caja-extensions.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libcaja-private/caja-extensions.c b/libcaja-private/caja-extensions.c index 9b34fdcd..b1a1bbe5 100644 --- a/libcaja-private/caja-extensions.c +++ b/libcaja-private/caja-extensions.c @@ -25,6 +25,7 @@ #include "caja-global-preferences.h" #include "caja-module.h" +#include "caja-debug-log.h" #include <string.h> @@ -36,6 +37,7 @@ static GList *caja_extensions = NULL; static Extension * extension_new (gchar *filename, gboolean state, gboolean python, GObject *module) { + GError *error = NULL; Extension *ext; GKeyFile *extension_file; gchar *extension_filename; @@ -53,17 +55,22 @@ extension_new (gchar *filename, gboolean state, gboolean python, GObject *module extension_file = g_key_file_new (); extension_filename = g_strdup_printf(CAJA_DATADIR "/extensions/%s.caja-extension", filename); - if (g_key_file_load_from_file (extension_file, extension_filename, G_KEY_FILE_NONE, NULL)) + if (g_key_file_load_from_file (extension_file, extension_filename, G_KEY_FILE_NONE, &error)) { ext->name = g_key_file_get_locale_string (extension_file, CAJA_EXTENSION_GROUP, "Name", NULL, NULL); ext->description = g_key_file_get_locale_string (extension_file, CAJA_EXTENSION_GROUP, "Description", NULL, NULL); ext->icon = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Icon", NULL); ext->author = g_key_file_get_string_list (extension_file, CAJA_EXTENSION_GROUP, "Author", NULL, NULL); - ext->copyright = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Copyright", NULL); + ext->copyright = g_key_file_get_locale_string (extension_file, CAJA_EXTENSION_GROUP, "Copyright", NULL, NULL); ext->version = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Version", NULL); ext->website = g_key_file_get_string (extension_file, CAJA_EXTENSION_GROUP, "Website", NULL); + g_key_file_free (extension_file); + } + else + { + caja_debug_log (FALSE, CAJA_DEBUG_LOG_DOMAIN_USER, "Error loading keys from file: %s\n", error->message); + g_error_free (error); } - g_key_file_free (extension_file); g_free (extension_filename); if (python) |