Registered Member
|
Hi I'd like to know if it's possible to use the reply of the Downloader inside a QPixmap. Thanks.
|
KDE Developer
|
I'm not sure I fully understand the question, but generally: Yes, it should be possible to put the data in a QPixmap.
--
Mark Kretschmann - Amarok Developer |
Registered Member
|
Ok but I actually didn't manage to do it. I tried
But then
returns true. Is it necessary to pass additional args to the function or is the problem somewhere else? |
Registered Member
|
Maybe I didn't make myself clear. I'm trying to use a distant picture . So I use your Downloader object :
But in the onFinished function I don't know how to use the argument since it's javascript and the type isn't explicit. I wrote a lyrics script and the data recovered can be used as a simple string so when it's a jpeg file how can I use it inside a QPixmap? |
KDE Developer
|
No, you did make yourself clear. I did actually give the problem some thought already, but didn't really reach a solution.
In theory what you tried should "just work" I think, so I'm not sure what's going on there. Some additional debugging output might be helpful. Start Amarok from the shell with: "amarok --debug" Maybe, if we're lucky, Qt is gonna print some useful error message.
--
Mark Kretschmann - Amarok Developer |
KDE Developer
|
Well you can use the normal Qt network apis for sure. I'll poke at this.
Amarok Developer
|
KDE Developer
|
Hey Galliou. I agree that this was a major problem with our "Downloader" api.
I've updated Amarok in SVN to have a new prototype called "DataDownloader". Its pretty much exactly like the old Downloader except the result is a QByteArray instead of a String. (The old downloader is now named both Downloader and StringDownloader to keep things consistent but backwards compat.) So this won't be available until Amarok 2.1. If you want to release a script for Amarok 2.0 users, you'll have to use the Qt Network apis.
Amarok Developer
|
Registered Member
|
Ok thanks a lot but I think I'll wait for Amarok 2.1 to release my script since it's a script that retrieves tags on discogs and in the current version it's not possible to save changes to the mp3 file directly it's necessary to modify tags manually after otherwise they're not written to the file and I think it would be boring for users having to do this every time. Anyway I've seen this issue is fixed in the SVN version.
Thanks for your great work ! By the way is there a method/attribute to set the cover once it has been saved to disk? I've guessed a lot of attributes but I can't find this one. |
KDE Developer
|
Your welcome. I appreciate your reports of issues that you face scripting Amarok.
The imageUrl property is read/write.
Amarok Developer
|
Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, sandyvee, Sogou [Bot]