[Kde-bindings] some issues with korundum4

Richard Dale rdale at foton.es
Fri Jul 18 18:14:42 UTC 2008


On Thursday 10 July 2008 09:04:54 Stefano Crocco wrote:
> 2) It seems that the KTextEditor module doesn't work correctly. I create an
> instance of KTextEditor::Document using the following code:
>
> require 'korundum4'
> require 'ktexteditor'
>
> data = KDE::AboutData.new "test", "", KDE::ki18n("test"), "0.0.1"
> KDE::CmdLineArgs.init [], data
>
> app = KDE::Application.new
> w = KParts::MainWindow.new nil, 0
> ed = KTextEditor::EditorChooser.editor 'katepart'
> doc = ed.create_document w
>
> After this, the line
>
> puts doc.text
>
> causes a segmentation fault with the following backtrace:
>
> #0  0xb78b5d88 in QString::toLatin1 () from /usr/lib/qt4/libQtCore.so.4
> #1  0xb5db3612 in rstringFromQString (s=0xb7efb178) at
> /home/stefano/temp/kdebindings/ruby/qtruby/src/handlers.cpp:882 #2
>  0xb5db3973 in marshall_QString (m=0xbf9889cc) at
> /home/stefano/temp/kdebindings/ruby/qtruby/src/handlers.cpp:920 #3
>  0xb5ddd0cb in MethodReturnValue (this=0xbf9889cc, smoke=0x81dacc0,
> meth=<value optimized out>, stack=0x8373c80, retval=0xbf988b30) at
> /home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.cpp:396 #4
>  0xb5ddf6df in MethodCall::callMethod (this=0xbf988b00) at
> /home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.h:161 #5
>  0xb5ddd008 in MethodCallBase::next (this=0xbf988b00) at
> /home/stefano/temp/kdebindings/ruby/qtruby/src/marshall_types.cpp:457 #6
>  0xb5daa879 in method_missing (argc=1, argv=0xbf988f00, self=3045416300) at
> /home/stefano/temp/kdebindings/ruby/qtruby/src/Qt.cpp:886 #7  0xb7fc0985 in
> call_cfunc () from /usr/lib/libruby18.so.1.8
> #8  0xb7fcb3e5 in rb_call0 () from /usr/lib/libruby18.so.1.8
> #9  0xb7fcb571 in rb_call () from /usr/lib/libruby18.so.1.8
> #10 0xb7fcbe4d in rb_funcall2 () from /usr/lib/libruby18.so.1.8
> #11 0xb7fd162e in method_missing () from /usr/lib/libruby18.so.1.8
> #12 0xb7fcb663 in rb_call () from /usr/lib/libruby18.so.1.8
> #13 0xb7fc5eb8 in rb_eval () from /usr/lib/libruby18.so.1.8
> #14 0xb7fc8612 in rb_eval () from /usr/lib/libruby18.so.1.8
> #15 0xb7fd6b9b in ruby_exec_internal () from /usr/lib/libruby18.so.1.8
> #16 0xb7fd6bdb in ruby_exec () from /usr/lib/libruby18.so.1.8
> #17 0xb7fd6c10 in ruby_run () from /usr/lib/libruby18.so.1.8
> #18 0x08048715 in main ()
>
> Also, the line
>
> doc.create_view
>
> returns nil instead of a new view.
The problem is that the KTextEditor classes are just interfaces with only pure 
virtual methods. I added some debugging to print out the real classes:

ed = KTextEditor::EditorChooser.editor 'katepart'
p ed.metaObject.className
doc = ed.create_document w
p doc.metaObject.className

And get this:

"KTextEditor::Editor"
"KTextEditor::Document"

So those are the actual classes here with only those pure virtual methods. The 
kate headers don't seem to get installed, and so I'm not sure about how you 
are supposed to get an editor working with this stuff. I've asked on the 
#kate irc channel, but nobody has replied yet.

-- Richard





More information about the Kde-bindings mailing list