[Kde-bindings] Help with loading an image from a URL

Chris Gow sniffy at rogers.com
Wed Jun 6 18:59:46 UTC 2007


On Wednesday 06 June 2007 12:30:42 Pau Garcia i Quiles wrote:
> Quoting Chris Gow <sniffy at rogers.com>:
> > Ok its working correctly, but is this the correct way to load an image
> > from a remote resource or is there an easier way?
>
> There is an easier way :-)
Cool.
>
> You can use KIO. It is explained in Larrosa's KDE tutorial which was
> translated to Ruby and is available at
> http://developer.kde.org/language-bindings/ruby/kde3tutorial/index.html.
>
> lthough chapter 11, which is the one dealing with what you want to do,
> has not been translated to Ruby yet, it shouldn't be difficult to
> understand:
> http://developer.kde.org/~larrosa/visualtutorial/chapter11.html
I originally looked at the KIO::NetAccess class but dismissed it as it creates 
a local file. But given the two options, I guess I'll go with it. Ideally I'd 
like KIO::NetAccess (or something similar) to take a buffer or something. In 
any case, I'm having an issue using the KIO::NetAccess class. I can't seem to 
find the download method locally:

irb(main):001:0> require 'korundum'
=> true
irb(main):002:0> tmpFile = ""
=> ""
irb(main):003:0> KIO::NetAccess.download("http://www.google.ca/index.html", 
tmpFile)
NoMethodError: undefined method `download' for KIO::NetAccess:Class
        from (irb):3:in `method_missing'
        from (irb):3

I'm running Kubuntu Feisty w/KDE 3.5.7. According to adept I am using the 
3.5.5 bindings.


-- chris



More information about the Kde-bindings mailing list