[Kde-bindings] Using ruby-bindings of solid

Bastian Holst bastianholst at gmx.de
Sun Feb 8 12:17:21 UTC 2009


Hi,

I'm new to ruby and korundum and I'm trying to figure out how to get a list of 
Storage Volumes through the ruby-binding of Solid. This is the interesting 
part of code:
require 'korundum4'
require 'Qt4'
require 'solid'

class VolumeList
    def initialize
	getVolumes
    end
    
    def getVolumes
	Qt.debug_level = Qt::DebugLevel::High
	@list = Solid::Device::listFromType(Solid::DeviceInterface::StorageVolume, 
"")
	for volume in @list
	    puts "Do something here."
	end
    end
end


Always when I try to execute my program I get the following error Message:
$ ruby main.rb                                                        
classname    == Solid::DeviceInterface                                                       
:: method == StorageVolume                                                                   
-> methodIds == [#<Qt::Internal::ModuleIndex:0xb50e7120 @index=105, @smoke=2>]               
candidate list:                                                                              
        enum Solid::DeviceInterface::StorageVolume  (smoke: 2 index: 105)                    
matching => smoke: 2 index: 105                                                              
match => 105 score: 0                                                                        
Resolved to id: 105                                                                          
setCurrentMethod(smokeList index: 2, meth index: 105)                                        
classname    == Solid::Device                                                                
:: method == listFromType                                                                    
-> methodIds == [#<Qt::Internal::ModuleIndex:0xb50e6c34 @index=92, @smoke=2>]                
candidate list:                                                                              
        static QList<Solid::Device> Solid::Device::listFromType(const 
Solid::DeviceInterface::Type&, const QString&)  (smoke: 2 index: 92)                                                
matching => smoke: 2 index: 92                                                               
      const Solid::DeviceInterface::Type& (Solid::DeviceInterface::Type)                     
      const QString& (s)                                                                     
match => 92 score: 6                                                                         
Resolved to id: 92                                                                           
setCurrentMethod(smokeList index: 2, meth index: 92)
./volumelist.rb:12:in `method_missing': Cannot handle 'const 
Solid::DeviceInterface::Type&' as argument of Solid::Device::listFromType 
(ArgumentError)
        from ./volumelist.rb:12:in `getVolumes'
        from ./volumelist.rb:7:in `initialize'
        from ./formatdialog.rb:10:in `new'
        from ./formatdialog.rb:10:in `initialize'
        from main.rb:16:in `new'
        from main.rb:16

Does somebody know what is the problem and how to solve it? I also can't find a 
documentation of korundum. rbkdeapi isn't installed on my system. Is it 
available in korundum4?

Thanks for your help.
Bastian Holst



More information about the Kde-bindings mailing list