This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Amarok qt scripting - filter bug?

Tags: None
(comma "," separated)
cotko
Registered Member
Posts
1
Karma
0
OS

Amarok qt scripting - filter bug?

Tue Dec 08, 2009 1:38 am
please help me o) !!

I'm trying to make some script (scripted service) for internet radio. It works fine, until I use the filter field to make a search.

Here is a simple code for example

script.spec file:
Code: Select all
[Desktop Entry]
Icon=test-amarok
Type=script
ServiceTypes=KPluginInfo

Name=testfilter
Comment=info

X-KDE-PluginInfo-Author=me
X-KDE-PluginInfo-Email=me@a.com
X-KDE-PluginInfo-Name=testfilter
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Category=Scriptable Service
X-KDE-PluginInfo-Depends=Amarok2.0.1
X-KDE-PluginInfo-License=LGPL
X-KDE-PluginInfo-EnabledByDefault=false



main.js file:
Code: Select all
function testFilter(){
   ScriptableServiceScript.call( this, "testfilter", 2, "test...", "test...", true );
}


/**
 * main script
 */
function onPopulating( level, callbackData, filter ){
   
   if ( level == 1 || level == 0){
   
      for(i=0; i<10; i++){
         
         item = Amarok.StreamItem;
         item.level = level;
         
         if ( level == 0 ){
            item.callbackData = "";
            item.playableUrl = "http://something.somewhere.html";
         }
         
         else{
            item.callbackData = level + i+" item";
            item.playableUrl = "";
         }
         
         item.itemName = level + i+" item";   
         item.infoHtml = "about item " + i + " at level " +  level;
         script.insertItem( item );
      }
   }
   
   script.donePopulating();
   
}


script = new testFilter();
script.populate.connect( onPopulating );



...so, to the main.js: it creates 10 "root level" items and then by clicking on them, it creates 10 leafs for each one.

this works fine until I type something into the search filter. As soon as I enter search query, all the root level items collapse and I can't open any of them anymore! Even when I clear the search filter and press enter etc.. I cant open root item, until script is reloaded.


so the question: is this some bug or am I handling filter in a wrong way? (In this script filter is not actually handled at all, it's just ignored, so I find this behaviour even stranger.) If it's not a bug, pleeeeaseee tell me how to deal with filters, give me any link or whatever, just something that explains what I should do :? :?
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS
Yes, this bug is known, and we'll try to fix it before 2.2.2 final release.


Please see here:

http://www.kde-apps.org/content/show.ph ... ent=116823

(Comment by nhnFreespirit, can't find a direct link)


--
Mark Kretschmann - Amarok Developer


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, Sogou [Bot], Yahoo [Bot]