Scripting question

Andreas Wuest andreaswuest at gmx.de
Thu Mar 26 18:31:22 UTC 2009


hi all,

i updated the script with the try catch block. the repopulation still does not 
work an no error occurs. i have no idea what's the problem.
here is the updated script and the output of the command line.

any more ideas ? thanks in advance.

function RadioAT()
{
    ScriptableServiceScript.call( this, "Radio Austria", 1, "List of some 
Austrian Radio Stations", "Enjoy it", true );
}

function onPopulating( level, callbackData, filter )
{
    Amarok.debug( " station level " );
    Amarok.debug( " filter : " + filter );
    try {
      for ( i = 0; i < 1; i++ )
      {
          Amarok.debug(" item : " + i);
          item = Amarok.StreamItem;
          item.level = 0;
          item.callbackData = "";
          item.itemName = "name" + i;
          item.playableUrl = "mms://stream0.orf.at/fm4_live" + i;
          item.infoHtml = "A cool stream called " + i;
          script.insertItem( item );
      }
      script.donePopulating();
    } catch (e) { print ("xxxxxxxxx : " + e); }
}

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





console output after i inserted "df" to the filter box.


andy at laptop2:~/Desktop$ amarok: [CollectionTreeItemModelBase] 
m_expandedCollections.isEmpty() ?  false                                                                                                    
amarok: [CollectionTreeItemModelBase] checking item...is item 0 ?  false                             
amarok: [CollectionTreeItemModelBase] urls =  ()                                                     
amarok: [CollectionTreeItemModelBase] row =  0                                                       
amarok: BEGIN: void CollectionTreeView::slotExpand(const QModelIndex&)                               
amarok:    modelindex =  
QModelIndex(0,0,0x32ad810,SingleCollectionTreeItemModel(0x32ad4c0) )        
amarok:    m_filterModel ?  true                                                                     
amarok: END__: void CollectionTreeView::slotExpand(const QModelIndex&) - Took 
0.00022s               
amarok: BEGIN: virtual QueryMaker* 
ScriptableServiceQueryMaker::setQueryType(QueryMaker::QueryType)  
amarok: END__: virtual QueryMaker* 
ScriptableServiceQueryMaker::setQueryType(QueryMaker::QueryType) - Took 
0.00011s                                                                                       
amarok: BEGIN: virtual QueryMaker* 
ScriptableServiceQueryMaker::addFilter(qint64, const QString&, bool, bool)                                                                                             
amarok:    clear all!!!!!!!!!!!!!!                                                                   
amarok: END__: virtual QueryMaker* 
ScriptableServiceQueryMaker::addFilter(qint64, const QString&, bool, bool) - 
Took 0.00015s                                                                             
amarok: BEGIN: virtual void ScriptableServiceQueryMaker::run()                                       
amarok: BEGIN: void ScriptableServiceQueryMaker::fetchTracks()                                       
amarok:      parent id:  -1                                                                          
amarok:      i am sending signals!                                                                   
amarok: BEGIN: void ScriptableServiceScript::slotPopulate(QString, int, int, 
QString, QString)       
amarok:        SCRIPT "Radio Austria" :  " station level "                                           
amarok:        SCRIPT "Radio Austria" :  " filter : df%20"                                           
amarok:        SCRIPT "Radio Austria" :  " item : 0"                                                 
amarok: BEGIN: int ScriptableServiceScript::insertItem(StreamItem*)                                  
amarok:          artistOverride: item->artist()                                                      
amarok: BEGIN: QString StreamItem::artist() const                                                    
amarok: END__: QString StreamItem::artist() const - Took 8.4e-05s                                    
amarok: BEGIN: int ScriptableServiceManager::insertItem(const QString&, int, 
int, const QString&, const QString&, const QString&, const QString&, const 
QString&, const QString&, const QString&, const QString&, int, const QString&)                                                                         
amarok: BEGIN: int ScriptableService::insertItem(int, int, const QString&, 
const QString&, const QString&, const QString&, const QString&, const 
QString&, const QString&, const QString&, int, const QString&)                                                                                                
amarok:              level:  0                                                                       
amarok:              parentId:  -1                                                                   
amarok:              name:  "name0"                                                                  
amarok:              infoHtml:  "A cool stream called 0"                                             
amarok:              callbackData:  ""                                                               
amarok:              playableUrl:  "mms://stream0.orf.at/fm4_live0"                                  
amarok:              albumOverride:  ""                                                              
amarok:              artistOverride:  ""                                                             
amarok:              coverUrl:  ""                                                                   
amarok: END__: int ScriptableService::insertItem(int, int, const QString&, 
const QString&, const QString&, const QString&, const QString&, const 
QString&, const QString&, const QString&, int, const QString&) - Took 0.00086s                                                                                
amarok: END__: int ScriptableServiceManager::insertItem(const QString&, int, 
int, const QString&, const QString&, const QString&, const QString&, const 
QString&, const QString&, const QString&, const QString&, int, const QString&) 
- Took 0.001s                                                           
amarok: END__: int ScriptableServiceScript::insertItem(StreamItem*) - Took 
0.0014s                   
amarok: BEGIN: int ScriptableServiceScript::donePopulating() const                                   
amarok: BEGIN: void ScriptableServiceManager::donePopulating(const QString&, 
int)                    
amarok:            Service name:  "Radio Austria" , parent id:  -1                                   
amarok: BEGIN: void ScriptableService::donePopulating(int)                                           
amarok: BEGIN: void ScriptableServiceCollection::donePopulating(int)                                 
amarok: BEGIN: void ScriptableServiceQueryMaker::slotScriptComplete()                                
amarok: END__: void ScriptableServiceQueryMaker::slotScriptComplete() - Took 
8.5e-05s                
amarok: BEGIN: void ScriptableServiceQueryMaker::slotScriptComplete()                                
amarok: END__: void ScriptableServiceQueryMaker::slotScriptComplete() - Took 
8.4e-05s
amarok: BEGIN: void ScriptableServiceQueryMaker::slotScriptComplete()
amarok: END__: void ScriptableServiceQueryMaker::slotScriptComplete() - Took 
8.3e-05s
amarok: BEGIN: void ScriptableServiceQueryMaker::slotScriptComplete()
amarok: END__: void ScriptableServiceQueryMaker::slotScriptComplete() - Took 
8.3e-05s
amarok: BEGIN: void ScriptableServiceQueryMaker::slotScriptComplete()
amarok:                  there are  0  tracks
amarok:                  Emitting  0  tracks
amarok: END__: void ScriptableServiceQueryMaker::slotScriptComplete() - Took 
0.00023s
amarok: END__: void ScriptableServiceCollection::donePopulating(int) - Took 
0.001s
amarok: END__: void ScriptableService::donePopulating(int) - Took 0.0011s
amarok: END__: void ScriptableServiceManager::donePopulating(const QString&, 
int) - Took 0.0014s
amarok: END__: int ScriptableServiceScript::donePopulating() const - Took 
0.0015s
amarok: END__: void ScriptableServiceScript::slotPopulate(QString, int, int, 
QString, QString) - Took 0.0036s
amarok: END__: void ScriptableServiceQueryMaker::fetchTracks() - Took 0.0039s
amarok: END__: virtual void ScriptableServiceQueryMaker::run() - Took 0.0041s
amarok: BEGIN: void ScanManager::startIncrementalScan()
amarok: BEGIN: QStringList ScanManager::getDirsToScan() const
amarok: END__: QStringList ScanManager::getDirsToScan() const - Took 0.0025s
amarok:    GOING TO SCAN:
amarok:    Scanning nothing, return.
amarok: END__: void ScanManager::startIncrementalScan() - Took 0.0029s




More information about the Amarok mailing list