Setting MIDORI_EXTENSION_PATH is no longer needed.
To disable Netscape plugins, use MOZ_PLUGIN_PATH=/.
-To debug extensions you can specify the path:
-
-'export MIDORI_EXTENSION_PATH=_build/default/extensions'
+When running from the build folder, extensions will also be located
+in the build folder (setting MIDORI_EXTENSION_PATH is no longer needed).
For further information a tutorial for gdb and
reading up on how you can install debugging
gchar* extension_path;
GDir* extension_dir = NULL;
- if (!(extension_path = g_strdup (g_getenv ("MIDORI_EXTENSION_PATH"))))
- extension_path = sokoke_find_lib_path (PACKAGE_NAME);
- if (extension_path != NULL)
+ if ((extension_path = midori_app_get_lib_path (PACKAGE_NAME)))
extension_dir = g_dir_open (extension_path, 0, NULL);
if (extension_dir != NULL)
{
return g_build_filename (MDATADIR, PACKAGE_NAME, "res", filename, NULL);
}
+/**
+ * midori_app_get_lib_path:
+ * @package: a filename or relative path
+ *
+ * Looks for the specified filename in Midori's library path.
+ *
+ * Return value: a newly allocated full path
+ *
+ * Since: 0.4.7
+ **/
+gchar*
+midori_app_get_lib_path (const gchar* package)
+{
+ gchar* path;
+
+ path = g_build_filename (exec_path, "lib", package, NULL);
+ if (g_access (path, F_OK) == 0)
+ return path;
+
+ g_free (path);
+
+ if (!strcmp (package, PACKAGE_NAME))
+ {
+ /* Fallback to build folder */
+ path = g_build_filename (g_file_get_path (
+ g_file_new_for_path (exec_path)),
+ "extensions", NULL);
+ if (g_access (path, F_OK) == 0)
+ return path;
+ g_free (path);
+ }
+
+ return g_build_filename (MDATADIR, package, "lib", NULL);
+}
/**
* midori_app_setup:
gchar*
midori_app_find_res_filename (const gchar* filename);
+gchar*
+midori_app_get_lib_path (const gchar* package);
+
G_END_DECLS
#endif /* __MIDORI_APP_H__ */
#include "midori-preferences.h"
+#include "midori-app.h"
#include "midori-platform.h"
#include <string.h>
SPANNED_ADD (button);
/* Disable spell check option if there are no enchant modules */
{
- gchar* enchant_path = sokoke_find_lib_path ("enchant");
+ gchar* enchant_path = midori_app_get_lib_path ("enchant");
if (enchant_path == NULL)
{
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
return g_build_filename (SYSCONFDIR, "xdg", PACKAGE_NAME, folder, filename, NULL);
}
-/**
- * sokoke_find_lib_path:
- * @folder: the lib subfolder
- *
- * Looks for the specified folder in the lib directories.
- *
- * Return value: a newly allocated full path, or %NULL
- **/
-gchar* sokoke_find_lib_path (const gchar* folder)
-{
- #ifdef G_OS_WIN32
- gchar* path = g_win32_get_package_installation_directory_of_module (NULL);
- gchar* lib_path = g_build_filename (path, "lib", folder ? folder : "", NULL);
- g_free (path);
- if (g_access (lib_path, F_OK) == 0)
- return lib_path;
- #else
- const gchar* lib_dirs[] =
- {
- LIBDIR,
- "/usr/local/lib",
- "/usr/lib",
- NULL
- };
- guint i;
-
- for (i = 0; i < G_N_ELEMENTS (lib_dirs); i++)
- {
- gchar* lib_path = g_build_filename (lib_dirs[i], folder ? folder : "", NULL);
- if (g_access (lib_path, F_OK) == 0)
- return lib_path;
- else
- g_free (lib_path);
- }
- #endif
-
- return NULL;
-}
-
/**
* sokoke_find_data_filename:
* @filename: a filename or relative path
sokoke_find_config_filename (const gchar* folder,
const gchar* filename);
-gchar*
-sokoke_find_lib_path (const gchar* folder);
-
gchar*
sokoke_find_data_filename (const gchar* filename,
gboolean res);
except:
pass
try:
- ext = 'MIDORI_EXTENSION_PATH=' + relfolder + os.sep + 'extensions'
nls = 'MIDORI_NLSPATH=' + relfolder + os.sep + 'po'
lang = os.environ['LANG']
try:
'LC_MESSAGES' + os.sep + APPNAME + '.mo')
except:
pass
- command = ext + ' ' + nls + ' '
+ command = nls + ' '
if is_mingw (Build.bld.env):
# This works only if everything is installed to that prefix
os.chdir (Build.bld.env['PREFIX'] + os.sep + 'bin')