1
From 6376360bd33778c751d878a1c722fcaedbe69512 Mon Sep 17 00:00:00 2001
2
From: Lionel Le Folgoc <lionel@lefolgoc.net>
3
Date: Tue, 11 Oct 2011 21:30:17 +0200
4
Subject: Look for plugins in {non-,}multiarch THUNARX_DIRECTORY
6
This will let a multiarch enabled libthunarx find plugins built against a
7
non-multiarch thunar (load plugins from both /usr/lib/$triplet and /usr/lib).
9
thunarx/thunarx-provider-factory.c | 12 +++++++++++-
10
thunarx/thunarx-provider-module.c | 6 ++++++
11
2 files changed, 17 insertions(+), 1 deletions(-)
13
diff --git a/thunarx/thunarx-provider-factory.c b/thunarx/thunarx-provider-factory.c
14
index f2588eb..cbcf642 100644
15
--- a/thunarx/thunarx-provider-factory.c
16
+++ b/thunarx/thunarx-provider-factory.c
17
@@ -145,8 +145,17 @@ thunarx_provider_factory_load_modules (ThunarxProviderFactory *factory)
18
GList *modules = NULL;
22
+ const gchar *thunarx_dirs[] =
25
+ "/usr/lib/thunarx-2"
28
- dp = g_dir_open (THUNARX_DIRECTORY, 0, NULL);
29
+ /* Search both multiarch and non-multiarch THUNARX_DIRECTORYs */
30
+ for (i = 0; i < G_N_ELEMENTS (thunarx_dirs); ++i)
32
+ dp = g_dir_open (thunarx_dirs[i], 0, NULL);
33
if (G_LIKELY (dp != NULL))
35
/* determine the types for all existing plugins */
36
@@ -192,6 +201,7 @@ thunarx_provider_factory_load_modules (ThunarxProviderFactory *factory)
44
diff --git a/thunarx/thunarx-provider-module.c b/thunarx/thunarx-provider-module.c
45
index 4f96ffd..dbb693b 100644
46
--- a/thunarx/thunarx-provider-module.c
47
+++ b/thunarx/thunarx-provider-module.c
48
@@ -178,6 +178,12 @@ thunarx_provider_module_load (GTypeModule *type_module)
50
/* load the module using the runtime link editor */
51
path = g_build_filename (THUNARX_DIRECTORY, type_module->name, NULL);
52
+ if (!g_file_test (path, G_FILE_TEST_EXISTS))
54
+ /* if it doesn't exist in the default dir, try non-multiarch THUNARX_DIRECTORY */
56
+ path = g_build_filename ("/usr/lib/thunarx-2", type_module->name, NULL);
58
module->library = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);