From 0d1d9b01d8ed957c2bed1e7fd371457612fe8035 Mon Sep 17 00:00:00 2001 From: ozmikepittman Date: Tue, 29 Apr 2008 12:50:31 +0000 Subject: [PATCH] Uniconvertor import extension changes for Win32 - Fixes LP# 197617 --- share/extensions/ccx_input.inx | 4 ++-- share/extensions/cdr2svg.sh | 11 ----------- share/extensions/cdr_input.inx | 4 ++-- share/extensions/cdt_input.inx | 4 ++-- share/extensions/cgm_input.inx | 4 ++-- share/extensions/cmx_input.inx | 4 ++-- share/extensions/sk1_input.inx | 4 ++-- share/extensions/wmf_input.inx | 4 ++-- src/extension/dependency.cpp | 16 ++++++++++++++-- src/main.cpp | 2 ++ 10 files changed, 30 insertions(+), 27 deletions(-) diff --git a/share/extensions/ccx_input.inx b/share/extensions/ccx_input.inx index 3ed4a2dbe..d40d4ae3c 100644 --- a/share/extensions/ccx_input.inx +++ b/share/extensions/ccx_input.inx @@ -3,7 +3,7 @@ <_name>Corel DRAW Compressed Exchange files input org.inkscape.input.ccx uniconv - cdr2svg.sh + uniconv-ext.py .ccx application/x-xccx @@ -11,6 +11,6 @@ <_filetypetooltip>Open compressed exchange files saved in Corel DRAW diff --git a/share/extensions/cdr2svg.sh b/share/extensions/cdr2svg.sh index 73059a60f..e69de29bb 100755 --- a/share/extensions/cdr2svg.sh +++ b/share/extensions/cdr2svg.sh @@ -1,11 +0,0 @@ -#! /bin/sh -rc=0 -TMPDIR="${TMPDIR-/tmp}" -TEMPFILENAME=`mktemp 2>/dev/null || echo "$TMPDIR/$$"` -TEMPFILENAME=${TEMPFILENAME}.svg - -uniconv "$1" "${TEMPFILENAME}" > /dev/null 2>&1 || rc=1 - -cat < "${TEMPFILENAME}" || rc=1 -rm -f "${TEMPFILENAME}" -exit $rc diff --git a/share/extensions/cdr_input.inx b/share/extensions/cdr_input.inx index 7feeedf87..7a25ffcf4 100644 --- a/share/extensions/cdr_input.inx +++ b/share/extensions/cdr_input.inx @@ -3,7 +3,7 @@ <_name>Corel DRAW Input org.inkscape.input.cdr uniconv - cdr2svg.sh + uniconv-ext.py .cdr image/x-xcdr @@ -12,6 +12,6 @@ org.inkscape.output.cdr diff --git a/share/extensions/cdt_input.inx b/share/extensions/cdt_input.inx index 698b37dee..66b58bb9b 100644 --- a/share/extensions/cdt_input.inx +++ b/share/extensions/cdt_input.inx @@ -3,7 +3,7 @@ <_name>Corel DRAW templates input org.inkscape.input.cdt uniconv - cdr2svg.sh + uniconv-ext.py .cdt application/x-xcdt @@ -11,6 +11,6 @@ <_filetypetooltip>Open files saved in Corel DRAW 7-13 diff --git a/share/extensions/cgm_input.inx b/share/extensions/cgm_input.inx index 82b526530..fba7eef96 100644 --- a/share/extensions/cgm_input.inx +++ b/share/extensions/cgm_input.inx @@ -3,7 +3,7 @@ <_name>Computer Graphics Metafile files input org.inkscape.input.cgm uniconv - cdr2svg.sh + uniconv-ext.py .cgm application/x-xcgm @@ -11,6 +11,6 @@ <_filetypetooltip>Open Computer Graphics Metafile files diff --git a/share/extensions/cmx_input.inx b/share/extensions/cmx_input.inx index b4500102d..b72959d6a 100644 --- a/share/extensions/cmx_input.inx +++ b/share/extensions/cmx_input.inx @@ -3,7 +3,7 @@ <_name>Corel DRAW Presentation Exchange files input org.inkscape.input.cmx uniconv - cdr2svg.sh + uniconv-ext.py .cmx application/x-xcmx @@ -11,6 +11,6 @@ <_filetypetooltip>Open presentation exchange files saved in Corel DRAW diff --git a/share/extensions/sk1_input.inx b/share/extensions/sk1_input.inx index 4a02f94f5..3a8474657 100644 --- a/share/extensions/sk1_input.inx +++ b/share/extensions/sk1_input.inx @@ -3,7 +3,7 @@ <_name>sK1 vector graphics files input org.inkscape.input.sk1 uniconv - cdr2svg.sh + uniconv-ext.py .sk1 application/x-xsk1 @@ -11,6 +11,6 @@ <_filetypetooltip>Open files saved in sK1 vector graphics editor diff --git a/share/extensions/wmf_input.inx b/share/extensions/wmf_input.inx index 401657d76..4b2f6b2a3 100644 --- a/share/extensions/wmf_input.inx +++ b/share/extensions/wmf_input.inx @@ -3,7 +3,7 @@ <_name>Windows Metafile Input org.inkscape.input.wmf uniconv - cdr2svg.sh + uniconv-ext.py .wmf application/x-wmf @@ -11,6 +11,6 @@ <_filetypetooltip>A popular graphics file format for clipart diff --git a/src/extension/dependency.cpp b/src/extension/dependency.cpp index 4396017fa..de656201c 100644 --- a/src/extension/dependency.cpp +++ b/src/extension/dependency.cpp @@ -213,17 +213,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); diff --git a/src/main.cpp b/src/main.cpp index bf1662c31..eafa07c53 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -440,6 +440,8 @@ static int _win32_set_inkscape_env(char *argv0) tmp += szFullPath; tmp += "python;"; tmp += szFullPath; + tmp += "python\\Scripts;"; // for uniconv.cmd + tmp += szFullPath; tmp += "perl"; if(oldenv != NULL) { tmp += ";"; -- 2.30.2