[Kde-bindings] Crash when using the valued returned by KDE::EncodingFileDialog.get_save_file_name_and_encoding in korundum
Stefano Crocco
stefano.crocco at alice.it
Mon Dec 28 15:39:14 UTC 2009
It seems there's something wrong with the value returned by
KDE::EncodingFileDialog.get_save_file_name_and_encoding in korundum. The
dialog itself seems to work correctly, but when I try to access the returned
object, I get an exception. Here's an example code:
require 'korundum4'
data = KDE::AboutData.new "kruby", "", KDE::ki18n("KRuby"), "0.0.39",
KDE.ki18n('A Ruby IDE written in Ruby')
KDE::CmdLineArgs.init ARGV, data
a = KDE::Application.new
res = KDE::EncodingFileDialog.get_save_file_name_and_encoding 'UTF-8',
__FILE__, '', nil, KDE.i18n('Save File')
p res.encoding
The exact error I get when running the above code (with ruby 1.9.1p243) is:
/usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2603:in `do_method_missing':
undefined method `name' for nil:NilClass (NoMethodError)
from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2606:in
`do_method_missing'
from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2606:in
`do_method_missing'
from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2606:in
`do_method_missing'
from /usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2606:in
`do_method_missing'
from prova.rb:10:in `method_missing'
from prova.rb:10:in `<main>'
The same happens if I try res.file_names or res.URLs. I'm not sure if this is
related, but if I write
p res.class
I get KDE::dingFileDialog::Result (of course, I'd expect
KDE::EncodingFileDialog::Result instead).
By the way, does anyone know whether the bug about KDE::SharedConfig#group not
working (http://lists.kde.org/?l=kde-bindings&m=125561411924191&w=2) has been
fixed or is going to be fixed before the release of KDE 4.4? I saw a mail on
the list (http://lists.kde.org/?l=kde-bindings&m=125804672228574&w=2) from
which it seems the source of the problem had been found out. However, at least
until about ten days ago (when I last tried building smokde and korundum from
svn), it hasn't been fixed. According to the KDE release schedule, the
bindings freeze for KDE 4.4 is just a matter of days now (the 5th of January).
I truly hope this bug will be fixed before then (or before KDE 4.4 is
released, at any rate), because it makes it impossible to use KDE
configuration system (of course, unless there's a way I don't know of which
allows to obtain configuration options without using KDE::SharedConfig#group).
Thanks in advance
Stefano
More information about the Kde-bindings
mailing list