[Kde-bindings] other issues with latest revision of smoke and korundum from 4.4 branch

Stefano Crocco stefano.crocco at alice.it
Fri Jan 29 11:08:06 UTC 2010


Using the latest revision of smoke and korundum from the 4.4 branch, I've
just found some possible bugs (everything worked correctly with smoke built
with the old generator).

1) KDE::MultiTabBar#tab doesn't seem to exist. Calling it gives a
NoMethodError. You can see this running this code:

require 'korundum4'

data = KDE::AboutData.new "test", "", KDE::ki18n("Test"), "0.1",
    KDE.ki18n('Test')
KDE::CmdLineArgs.init ARGV, data
a = KDE::Application.new
bar = KDE::MultiTabBar.new KDE::MultiTabBar::Bottom, nil
id = bar.append_tab KDE::IconLoader.global.load_icon('document-new',KDE::IconLoader::Toolbar)
bar.tab(id)

The error I get is

prova.rb:9:in `method_missing': undefined method `tab' for #<KDE::MultiTabBar:0x81283f4> (NoMethodError)
        from prova.rb:9:in `<main>'

Setting the debug level to High just before the call to tab gives the following result:

classname    == KMultiTabBar
:: method == tab
-> methodIds == []


2) KTextEditor::AnnotationModel.new gives: "unresolved constructor call".
Actually, since AnnotationModel is an abstract class, I created a class
derived from it, defined the appropriate data method, but when I tried to
instantiate it, I got the above error. You can reproduce the issue with
the following code:

require 'korundum4'
require 'ktexteditor'

class Model < KTextEditor::AnnotationModel
  
  def data line, role
    Qt::Variant.new
  end
  
end

data = KDE::AboutData.new "test", "", KDE::ki18n("Test"), "0.1",
    KDE.ki18n('Test')
KDE::CmdLineArgs.init ARGV, data
a = KDE::Application.new
Model.new

The error is:

usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2610:in `initialize': unresolved constructor call Model (ArgumentError)
        from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2610:in `call'
        from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2610:in `block in try_initialize'
        from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2609:in `catch'
        from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2609:in `try_initialize'
        from prova.rb:16:in `new'
        from prova.rb:16:in `<main>'

The same happens if I pass a (the application) as parent. Setting the debug
level to High, this is the output I get:

classname    == KTextEditor::AnnotationModel                                                                                                
:: method == AnnotationModel                                                                                                                
-> methodIds == []                                                                                                                          
candidate list:                                                                                                                             
Possible prototypes:                                                                                                                        
        QVariant KTextEditor::AnnotationModel::data(int, Qt::ItemDataRole) const                                                            
        void KTextEditor::AnnotationModel::lineChanged(int)                                                                                 
        const QMetaObject* KTextEditor::AnnotationModel::metaObject() const                                                                 
        int KTextEditor::AnnotationModel::qt_metacall(QMetaObject::Call, int, void**)                                                       
        void* KTextEditor::AnnotationModel::qt_metacast(const char*)                                                                        
        void KTextEditor::AnnotationModel::reset()                                                                                          
        static const QMetaObject& KTextEditor::AnnotationModel::staticMetaObject() const                                                    
        static QString KTextEditor::AnnotationModel::tr(const char*)                                                                        
        static QString KTextEditor::AnnotationModel::tr(const char*, const char*)                                                           
        static QString KTextEditor::AnnotationModel::tr(const char*, const char*, int)                                                      
        static QString KTextEditor::AnnotationModel::trUtf8(const char*)                                                                    
        static QString KTextEditor::AnnotationModel::trUtf8(const char*, const char*)
        static QString KTextEditor::AnnotationModel::trUtf8(const char*, const char*, int)
        void KTextEditor::AnnotationModel::~AnnotationModel()

If I'm reading this correctly, it seems the constructor isn't even defined!

3) Maybe this is not an issue at all, but just the intended behaviour.
However, it something which used to work and doesn't work anymore. The problem
is that, given a KTextEditor::View which uses the kate part, I wanted to
access the underlying KateViewInternal object (because I needed to install an
event filter on it). With the old smoke version, the following worked
perfectly (view is the KTextEditor::View returned by
KTexEditor::Document#create_view):

view.findChildren(Qt::Object).find{|c| c.class == KateViewInternal}

With the new smoke, the above line gives a NameError 
(uninitialized constant KateViewInternal). I then tried to compare the class
name rather than the class object itself. However, while it didn't produce any
error, it returned nil. Trying to display the class of all children with Kate
in their names I get:
["KateSpellCheckDialog", "KateBookmarks", "KateSpellingMenu",
"KateLayoutCache", "KateWordCompletionView", "KateCompletionModel",
"KateArgumentHintModel"]
and no KateViewInternal. Given that KateViewInternal is, as the name states,
an internal class, maybe leaving it out is intentional. I just wanted to be
sure of this.

Thanks for the attention

Stefano



More information about the Kde-bindings mailing list