summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-extensions.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-09-19 18:06:59 +0200
committerraveit65 <[email protected]>2019-09-28 09:02:40 +0200
commitd928125874471aa04d10e0a45f5bf304e451c622 (patch)
tree1b9b72fd131f39557135e01cbfa552a1af9a9d54 /libcaja-private/caja-extensions.c
parent0d08735bcd1c0f48a29faac30e3a7cca3ae72f05 (diff)
downloadcaja-d928125874471aa04d10e0a45f5bf304e451c622.tar.bz2
caja-d928125874471aa04d10e0a45f5bf304e451c622.tar.xz
caja-extensions: allows the translation of copyright
Diffstat (limited to 'libcaja-private/caja-extensions.c')
-rw-r--r--libcaja-private/caja-extensions.c13
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)