[Kde-bindings] possible bug in KDE::StandardAction (korundum4)

Stefano Crocco stefano.crocco at alice.it
Sun Oct 19 20:29:58 UTC 2008


I've just installed the latest svn revision of korundum4 and I think I found a 
bug in KDE::StandardAction. According to the KDE 4 api, KDE::StandardAction 
has an open method, which should generate a 'Open File' action. It works 
correctly when I call it this way:

class MainWindow < KDE::XMLGUIWindow

  slots 'open_file()'

  def initialize
    super
    KDE::StandardAction.new self, SLOT('open_file()'), action_collection
  end

end

However, if I call it using the 'send' method, that is, replacing the second 
line in the initialize method above with:

  KDE::StandardAction.send :open, self, SLOT('open_file()'), action_collection

I get the following error:

in `open': can't convert MainWindow into String (TypeError)

A bit surprised by this behaviour (calling the other methods in 
KDE::StandardAction using send works correctly), I tried the following in irb:

require 'korundum4'
KDE::StandardAction.send('open', 'test', 'w'){|f| f.write "test"}

This gave no error and worked exactly as Kernel#open (it created a file called 
'test' with the string 'text' inside it). So, it seems that 

KDE::StandardAction.send :open

instead of calling KDE::StandardAction.open calls Kernel#open, instead.

Stefano



More information about the Kde-bindings mailing list