summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation/script.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2008-04-21 22:57:53 +0000
committergouldtj <gouldtj@users.sourceforge.net>2008-04-21 22:57:53 +0000
commit6e412e5d2a83d5d4a835a4baa5a82514604408ac (patch)
tree6035587de110b08f9f3bc2338323a970e6cdb045 /src/extension/implementation/script.cpp
parentShow the name of the swatch that is currently under the pointer in the status... (diff)
downloadinkscape-6e412e5d2a83d5d4a835a4baa5a82514604408ac.tar.gz
inkscape-6e412e5d2a83d5d4a835a4baa5a82514604408ac.zip
r19076@shi: ted | 2008-04-21 15:42:45 -0700
Core of having a real namespace for Inkscape extensions. r19077@shi: ted | 2008-04-21 15:50:12 -0700 First layer of adding NS r19078@shi: ted | 2008-04-21 15:56:03 -0700 Whew, doing the rest of them. (bzr r5483)
Diffstat (limited to 'src/extension/implementation/script.cpp')
-rw-r--r--src/extension/implementation/script.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index cededca51..67e351496 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -366,10 +366,10 @@ Script::load(Inkscape::Extension::Extension *module)
/* This should probably check to find the executable... */
Inkscape::XML::Node *child_repr = sp_repr_children(module->get_repr());
while (child_repr != NULL) {
- if (!strcmp(child_repr->name(), "script")) {
+ if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "script")) {
child_repr = sp_repr_children(child_repr);
while (child_repr != NULL) {
- if (!strcmp(child_repr->name(), "command")) {
+ if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "command")) {
const gchar *interpretstr = child_repr->attribute("interpreter");
if (interpretstr != NULL) {
Glib::ustring interpString =
@@ -383,7 +383,7 @@ Script::load(Inkscape::Extension::Extension *module)
command.insert(command.end(), tmp);
}
- if (!strcmp(child_repr->name(), "helper_extension")) {
+ if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "helper_extension")) {
helper_extension = sp_repr_children(child_repr)->content();
}
child_repr = sp_repr_next(child_repr);
@@ -427,12 +427,14 @@ Script::unload(Inkscape::Extension::Extension */*module*/)
bool
Script::check(Inkscape::Extension::Extension *module)
{
+ int script_count = 0;
Inkscape::XML::Node *child_repr = sp_repr_children(module->get_repr());
while (child_repr != NULL) {
- if (!strcmp(child_repr->name(), "script")) {
+ if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "script")) {
+ script_count++;
child_repr = sp_repr_children(child_repr);
while (child_repr != NULL) {
- if (!strcmp(child_repr->name(), "check")) {
+ if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "check")) {
Glib::ustring command_text = solve_reldir(child_repr);
if (command_text.size() > 0) {
/* I've got the command */
@@ -442,7 +444,7 @@ Script::check(Inkscape::Extension::Extension *module)
}
}
- if (!strcmp(child_repr->name(), "helper_extension")) {
+ if (!strcmp(child_repr->name(), INKSCAPE_EXTENSION_NS "helper_extension")) {
gchar const *helper = sp_repr_children(child_repr)->content();
if (Inkscape::Extension::db.get(helper) == NULL) {
return false;
@@ -457,6 +459,10 @@ Script::check(Inkscape::Extension::Extension *module)
child_repr = sp_repr_next(child_repr);
}
+ if (script_count == 0) {
+ return false;
+ }
+
return true;
}