summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorAlexander van der Meij <[email protected]>2016-03-07 21:21:44 +0100
committermonsta <[email protected]>2016-03-29 11:52:31 +0300
commit2ca207ea1a91178d28583e2bdab5c3d6aac06d87 (patch)
tree5cccaf8bb06e757f896faec7a5db2c8f8f8b2abb /libcaja-private
parentce7cc9580809d4017c74b0128f7e82f94eb173d9 (diff)
downloadcaja-2ca207ea1a91178d28583e2bdab5c3d6aac06d87.tar.bz2
caja-2ca207ea1a91178d28583e2bdab5c3d6aac06d87.tar.xz
use exposed python filenames to list python extensions separately
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-module.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libcaja-private/caja-module.c b/libcaja-private/caja-module.c
index 8c08741c..023c22ea 100644
--- a/libcaja-private/caja-module.c
+++ b/libcaja-private/caja-module.c
@@ -51,6 +51,7 @@ struct _CajaModule
void (*list_types) (const GType **types,
int *num_types);
+ void (*list_pyfiles) (GList **pyfiles);
};
@@ -98,6 +99,10 @@ caja_module_load (GTypeModule *gmodule)
return FALSE;
}
+ g_module_symbol (module->library,
+ "caja_module_list_pyfiles",
+ (gpointer *)&module->list_pyfiles);
+
module->initialize (gmodule);
return TRUE;
@@ -154,6 +159,7 @@ static void
add_module_objects (CajaModule *module)
{
GObject *object = NULL;
+ GList *pyfiles = NULL;
gchar *filename = NULL;
const GType *types = NULL;
int num_types = 0;
@@ -162,12 +168,24 @@ add_module_objects (CajaModule *module)
module->list_types (&types, &num_types);
filename = g_path_get_basename (module->path);
+ /* fetch extensions details loaded through python-caja module */
+ if (module->list_pyfiles)
+ {
+ module->list_pyfiles(&pyfiles);
+ }
+
for (i = 0; i < num_types; i++)
{
if (types[i] == 0) /* Work around broken extensions */
{
break;
}
+
+ if (module->list_pyfiles)
+ {
+ filename = g_strconcat(g_list_nth_data(pyfiles, i), ".py", NULL);
+ }
+
object = caja_module_add_type (types[i]);
caja_extension_register (filename, object);
}