[Kde-bindings] KDE/kdebindings/ruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Fri May 30 11:39:39 UTC 2008
SVN commit 814466 by rdale:
* Only use the RUBY_INIT_STACK if it is defined (ie Ruby 1.8.6 or later). Thanks to winterz
for reporting the problem with Ruby 1.8.5
CCMAIL: kde-bindings at kde.org
M +0 -35 korundum/src/kdehandlers.cpp
M +2 -0 korundum/src/krubyapplication.cpp
M +2 -0 korundum/src/krubypluginfactory.cpp
M +2 -0 krossruby/rubyfunction.h
M +2 -0 krossruby/rubyinterpreter.cpp
M +2 -0 krossruby/rubyscript.cpp
M +1 -1 qtruby/src/marshall_types.cpp
--- trunk/KDE/kdebindings/ruby/korundum/src/kdehandlers.cpp #814465:814466
@@ -40,9 +40,6 @@
#include <kplugininfo.h>
#include <kmountpoint.h>
#include <kio/jobclasses.h>
-#include <dom/dom_node.h>
-#include <dom/dom_element.h>
-#include <dom/dom_string.h>
#include <kmultitabbar.h>
#include <kdatatool.h>
@@ -60,38 +57,6 @@
} else {
return "KDE::ArchiveFile";
}
- } else if (strcmp(smoke->classes[classId].className, "DOM::Node") == 0) {
- DOM::Node * node = (DOM::Node *) smoke->cast(ptr, classId, smoke->idClass("DOM::Node").index);
- switch (node->nodeType()) {
- case DOM::Node::ELEMENT_NODE:
- if (((DOM::Element*)node)->isHTMLElement()) {
- return "DOM::HTMLElement";
- } else {
- return "DOM::Element";
- }
- case DOM::Node::ATTRIBUTE_NODE:
- return "DOM::Attr";
- case DOM::Node::TEXT_NODE:
- return "DOM::Text";
- case DOM::Node::CDATA_SECTION_NODE:
- return "DOM::CDATASection";
- case DOM::Node::ENTITY_REFERENCE_NODE:
- return "DOM::EntityReference";
- case DOM::Node::ENTITY_NODE:
- return "DOM::Entity";
- case DOM::Node::PROCESSING_INSTRUCTION_NODE:
- return "DOM::ProcessingInstruction";
- case DOM::Node::COMMENT_NODE:
- return "DOM::Comment";
- case DOM::Node::DOCUMENT_NODE:
- return "DOM::Document";
- case DOM::Node::DOCUMENT_TYPE_NODE:
- return "DOM::DocumentType";
- case DOM::Node::DOCUMENT_FRAGMENT_NODE:
- return "DOM::DocumentFragment";
- case DOM::Node::NOTATION_NODE:
- return "DOM::Notation";
- }
}
return smoke->binding->className(classId);
--- trunk/KDE/kdebindings/ruby/korundum/src/krubyapplication.cpp #814465:814466
@@ -59,7 +59,9 @@
rubyargs[i+1] = strdup(argv[i]);
}
+#ifdef RUBY_INIT_STACK
RUBY_INIT_STACK
+#endif
ruby_init();
ruby_init_loadpath();
ruby_incpush(QFile::encodeName(program.path()));
--- trunk/KDE/kdebindings/ruby/korundum/src/krubypluginfactory.cpp #814465:814466
@@ -127,7 +127,9 @@
QFileInfo program(path);
+#ifdef RUBY_INIT_STACK
RUBY_INIT_STACK
+#endif
ruby_init();
ruby_script(QFile::encodeName(program.fileName()));
ruby_init_loadpath();
--- trunk/KDE/kdebindings/ruby/krossruby/rubyfunction.h #814465:814466
@@ -182,7 +182,9 @@
//TODO optimize
if (ruby_in_eval == 0) {
+#ifdef RUBY_INIT_STACK
RUBY_INIT_STACK
+#endif
}
ruby_in_eval++;
VALUE argarray = rb_ary_new2(3);
--- trunk/KDE/kdebindings/ruby/krossruby/rubyinterpreter.cpp #814465:814466
@@ -94,7 +94,9 @@
#endif
d = new RubyInterpreterPrivate();
+#ifdef RUBY_INIT_STACK
RUBY_INIT_STACK
+#endif
ruby_init();
ruby_init_loadpath();
rb_define_global_function("require", (VALUE (*)(...))RubyInterpreter::require, 1);
--- trunk/KDE/kdebindings/ruby/krossruby/rubyscript.cpp #814465:814466
@@ -304,7 +304,9 @@
rb_ary_store(args, 2, fileName);
if (ruby_in_eval == 0) {
+#ifdef RUBY_INIT_STACK
RUBY_INIT_STACK
+#endif
}
ruby_in_eval++;
rb_rescue2((VALUE(*)(...))callExecute, args, (VALUE(*)(...))callExecuteException, d->m_script, rb_eException, 0);
--- trunk/KDE/kdebindings/ruby/qtruby/src/marshall_types.cpp #814465:814466
@@ -30,7 +30,7 @@
// invoked, because RUBY_INIT_STACK will have aleady have been called from within
// the krubypluginfactory code, and it shouldn't be called again.
-#ifdef RUBY_EMBEDDED
+#if defined(RUBY_EMBEDDED) && defined(RUBY_INIT_STACK)
# define QTRUBY_INIT_STACK \
if ( nested_callback_count == 0 ) { RUBY_INIT_STACK } \
nested_callback_count++;
More information about the Kde-bindings
mailing list