summaryrefslogtreecommitdiffstats
path: root/src/path-prefix.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-03-30 18:57:35 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-03-30 20:30:51 +0000
commit09b38582c874646b49d10a8f11850c10b9c6ad39 (patch)
tree6d79e6334315cbf1b5453bef2b111c3587e86647 /src/path-prefix.cpp
parentRemove unused "get_datadir_path()" (diff)
downloadinkscape-09b38582c874646b49d10a8f11850c10b9c6ad39.tar.gz
inkscape-09b38582c874646b49d10a8f11850c10b9c6ad39.zip
Remove "get_extensions_path()"
Contrary to what the name and placing suggest it's not a general utility function but a specialized function that constructs the full value to set for PYTHONPATH. Despite the misleading placement most functionality is unneeded: * INKSCAPE_EXTENSIONDIR should always be absolute * g_setenv recommends UTF-8 on Windows
Diffstat (limited to '')
-rw-r--r--src/path-prefix.cpp40
1 files changed, 2 insertions, 38 deletions
diff --git a/src/path-prefix.cpp b/src/path-prefix.cpp
index 92efcb895..b44bc42f8 100644
--- a/src/path-prefix.cpp
+++ b/src/path-prefix.cpp
@@ -20,10 +20,10 @@
#include <mach-o/dyld.h> // for _NSGetExecutablePath
#endif
-#include "io/resource.h"
-#include "path-prefix.h"
#include <glib.h>
+#include "path-prefix.h"
+
/**
* Determine the location of the Inkscape data directory (typically the share/ folder
* from where Inkscape should be loading resources) and append a relative path
@@ -62,42 +62,6 @@ char *append_inkscape_datadir(const char *relative_path)
return g_build_filename(inkscape_datadir, relative_path, NULL);
}
-gchar *get_extensions_path()
-{
- using namespace Inkscape::IO::Resource;
- gchar const *pythonpath = g_getenv("PYTHONPATH");
- gchar *extdir;
- gchar *new_pythonpath;
-
-#ifdef _WIN32
- extdir = g_win32_locale_filename_from_utf8(INKSCAPE_EXTENSIONDIR);
-#else
- extdir = g_strdup(INKSCAPE_EXTENSIONDIR);
-#endif
-
- // On some platforms, INKSCAPE_EXTENSIONDIR is not absolute,
- // but relative to the directory that contains the Inkscape executable.
- // Since we spawn Python chdir'ed into the script's directory,
- // we need to obtain the absolute path here.
- if (!g_path_is_absolute(extdir)) {
- gchar *curdir = g_get_current_dir();
- gchar *extdir_new = g_build_filename(curdir, extdir, NULL);
- g_free(extdir);
- g_free(curdir);
- extdir = extdir_new;
- }
-
- if (pythonpath) {
- new_pythonpath = g_strdup_printf("%s" G_SEARCHPATH_SEPARATOR_S "%s", extdir, pythonpath);
- g_free(extdir);
- }
- else {
- new_pythonpath = extdir;
- }
-
- return new_pythonpath;
-}
-
/**
* Gets the the currently running program's executable name (including full path)
*