diff options
author | Alexander van der Meij <[email protected]> | 2016-03-13 14:27:04 +0100 |
---|---|---|
committer | monsta <[email protected]> | 2016-03-29 11:59:40 +0300 |
commit | c0bfecbb6f70bc732d35b477c57d538730c358bd (patch) | |
tree | 17afa99cdb53de5102dbc51aa55b03adb87a124e /libcaja-private | |
parent | 2ca207ea1a91178d28583e2bdab5c3d6aac06d87 (diff) | |
download | caja-c0bfecbb6f70bc732d35b477c57d538730c358bd.tar.bz2 caja-c0bfecbb6f70bc732d35b477c57d538730c358bd.tar.xz |
add default name/description for python extensions
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/caja-extensions.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/libcaja-private/caja-extensions.c b/libcaja-private/caja-extensions.c index ef23a3c1..580cd582 100644 --- a/libcaja-private/caja-extensions.c +++ b/libcaja-private/caja-extensions.c @@ -34,7 +34,7 @@ static GList *caja_extensions = NULL; static Extension * -extension_new (gchar *filename, gboolean state, GObject *module) +extension_new (gchar *filename, gboolean state, gboolean python, GObject *module) { Extension *ext; GKeyFile *extension_file; @@ -66,6 +66,12 @@ extension_new (gchar *filename, gboolean state, GObject *module) g_key_file_free (extension_file); g_free (extension_filename); + if (python) + { + ext->name = g_strconcat("Python: ", filename, NULL); + ext->description = "Python-caja extension"; + } + return ext; } @@ -192,13 +198,18 @@ caja_extensions_get_list (void) void caja_extension_register (gchar *filename, GObject *module) { - gboolean state = TRUE; // new extensions are enabled by default. - gchar *extname; - - extname = g_strndup (filename, strlen(filename) - 3); - state = caja_extension_get_state (extname); + gboolean ext_state = TRUE; // new extensions are enabled by default. + gboolean ext_python = FALSE; + gchar *ext_filename; + + ext_filename = g_strndup (filename, strlen(filename) - 3); + ext_state = caja_extension_get_state (ext_filename); + + if (g_str_has_suffix (filename, ".py")) { + ext_python = TRUE; + } - Extension *ext = extension_new (extname, state, module); + Extension *ext = extension_new (ext_filename, ext_state, ext_python, module); caja_extensions = g_list_append (caja_extensions, ext); } |