X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fextension%2Fdependency.cpp;h=a83cac88d039cb430256fc76b00c7c0495a679c6;hb=c44173a5bb8a1c0ae9b89fed53701deb246e2d03;hp=4396017fac4b0fe199ce1c95c605bb2d34a7ac60;hpb=78023b76d7395f1b2dc1c64e1e7ad538be13c62c;p=inkscape.git diff --git a/src/extension/dependency.cpp b/src/extension/dependency.cpp index 4396017fa..a83cac88d 100644 --- a/src/extension/dependency.cpp +++ b/src/extension/dependency.cpp @@ -26,7 +26,6 @@ gchar const * Dependency::_type_str[] = { "executable", "file", "extension", - "plugin", }; // These strings are for XML attribute comparisons and should not be translated @@ -101,10 +100,6 @@ Dependency::~Dependency (void) looked up in the database. If the extension is found, and it is not deactivated, the dependency passes. - If the type is \c TYPE_PLUGIN then the path for the plugin is found - using the Glib::Module routines. When the path is found, then there - is a check to see if the file exists using the \c file_test function. - If the type is \c TYPE_EXECUTABLE or \c TYPE_FILE things are getting even more interesting because now the \c _location variable is also taken into account. First, the difference between the two is that @@ -138,16 +133,6 @@ Dependency::check (void) const if (myext->deactivated()) return FALSE; break; } - case TYPE_PLUGIN: { - if (!Glib::Module::get_supported()) { - return FALSE; - } - - std::string path = Glib::Module::build_path(INKSCAPE_PLUGINDIR, _string); - if (!Glib::file_test(path, Glib::FILE_TEST_EXISTS)) - return FALSE; - break; - } case TYPE_EXECUTABLE: case TYPE_FILE: { Glib::FileTest filetest = Glib::FILE_TEST_EXISTS; @@ -213,17 +198,29 @@ Dependency::check (void) const g_free(orig_path); return TRUE; } + // give it a 2nd try with ".exe" added - gchar * final_name_exe = g_strdup_printf ("%s.exe", final_name); + gchar * final_name_exe = g_strdup_printf("%s.exe", final_name); if (Glib::file_test(final_name_exe, filetest)) { g_free(final_name); g_free(final_name_exe); g_free(orig_path); return TRUE; } + g_free(final_name_exe); + // and a 3rd try with ".cmd" added (mainly for UniConvertor) + gchar * final_name_cmd = g_strdup_printf("%s.cmd", final_name); + if (Glib::file_test(final_name_cmd, filetest)) { + g_free(final_name); + g_free(final_name_cmd); + g_free(orig_path); + return TRUE; + } + g_free(final_name_cmd); + + // give up g_free(final_name); - g_free(final_name_exe); } g_free(orig_path);