summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2014-06-11 18:53:35 +0000
committerJazzyNico <nicoduf@yahoo.fr>2014-06-11 18:53:35 +0000
commit4c15ea8f3e7635bd9a40ab65bccc0261f977c46e (patch)
tree9fe743a2c1e0538fc07622cb2484db959508c9cc /src
parentid-clash: clean up code (diff)
downloadinkscape-4c15ea8f3e7635bd9a40ab65bccc0261f977c46e.tar.gz
inkscape-4c15ea8f3e7635bd9a40ab65bccc0261f977c46e.zip
Extensions. Fix for Bug #505920 (inkscape loads extension even if the script specified in <command> doesn't exist).
Fixed bugs: - https://launchpad.net/bugs/505920 (bzr r13421)
Diffstat (limited to 'src')
-rw-r--r--src/extension/dependency.cpp20
-rw-r--r--src/extension/extension.cpp3
2 files changed, 17 insertions, 6 deletions
diff --git a/src/extension/dependency.cpp b/src/extension/dependency.cpp
index 78012ccc8..e46b6fbd2 100644
--- a/src/extension/dependency.cpp
+++ b/src/extension/dependency.cpp
@@ -57,14 +57,22 @@ Dependency::Dependency (Inkscape::XML::Node * in_repr)
Inkscape::GC::anchor(_repr);
- const gchar * location = _repr->attribute("location");
- for (int i = 0; i < LOCATION_CNT && location != NULL; i++) {
- if (!strcmp(location, _location_str[i])) {
- _location = (location_t)i;
- break;
+ if (const gchar * location = _repr->attribute("location")) {
+ for (int i = 0; i < LOCATION_CNT && location != NULL; i++) {
+ if (!strcmp(location, _location_str[i])) {
+ _location = (location_t)i;
+ break;
+ }
+ }
+ } else if (const gchar * location = _repr->attribute("reldir")) {
+ for (int i = 0; i < LOCATION_CNT && location != NULL; i++) {
+ if (!strcmp(location, _location_str[i])) {
+ _location = (location_t)i;
+ break;
+ }
}
}
-
+
const gchar * type = _repr->attribute("type");
for (int i = 0; i < TYPE_CNT && type != NULL; i++) {
if (!strcmp(type, _type_str[i])) {
diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp
index 588efb521..06e35ff3e 100644
--- a/src/extension/extension.cpp
+++ b/src/extension/extension.cpp
@@ -111,6 +111,9 @@ Extension::Extension (Inkscape::XML::Node * in_repr, Implementation::Implementat
if (!strcmp(chname, "dependency")) {
_deps.push_back(new Dependency(child_repr));
} /* dependency */
+ if (!strcmp(chname, "script")) {
+ _deps.push_back(new Dependency(child_repr->firstChild()));
+ } /* check command as a dependency (see LP #505920) */
if (!strcmp(chname, "options")) {
silent = !strcmp( child_repr->attribute("silent"), "true" );
}