I have been working on the QtScript service for SoundCloud. It now searches for artists so the exact SoundCloud name does not have to be typed in. I am stuck on some confusing bugs. I can't find anything in the script (attached) that could explain any of these and I have been looking all day. I think these are bugs in Amarok. This is with 2.8.0 stable. Since upgrading to Fedora 21, I get the attached error when trying to compile from git.
Most importantly, after expanding an artist and a playlist to show tracks, trying to expand a different artist does nothing (expanding playlists of other artists that have already had their playlists loaded works though). After changing the search bar, the tree will be cleared and never repopulate (until restarting Amarok). When searching for another artist, Amarok tries to populate level 2 (artist list level), and the script downloads the data, but Amarok does not load any items. Debugging output shows: amarok: BEGIN: int ScriptableServiceScript::donePopulating() const amarok: BEGIN: void ScriptableServiceManager::donePopulating(const QString&, int) amarok: Service name: "SoundCloud Integration" , parent id: -1 amarok: BEGIN: void Collections::ScriptableServiceCollection::donePopulating(int) amarok: BEGIN: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() amarok: [ScriptableServiceQueryMaker] there are 0 artists amarok: END__: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s] amarok: END__: void Collections::ScriptableServiceCollection::donePopulating(int) [Took: 0s] amarok: END__: void ScriptableServiceManager::donePopulating(const QString&, int) [Took: 0s] amarok: END__: int ScriptableServiceScript::donePopulating() const [Took: 0s] Tracks are only shown in the tree if their callbackData is set to an empty string or null. Trying to drag & drop an artist from the tree pops up an error: TypeError: Result of expression 'tracklist[i].user' [undefined] is not an object This does not happen when dragging a playlist. Trying to drop the artist onto the playlist freezes Amarok. If all of the playlists for that artist have been expanded, this error does not pop up, but only the first playlist shown in the tree is dragged. So, it seems this is happening because Amarok does not tell the script to populate all the levels below an item that is being dragged. The string '%20' is automatically appended to the filter string after anything is typed into the search bar. When typing slowly in the search bar, only the first few characters are passed to the script, without '%20' at the end. The year of playlists is not shown immediately, although the script sets it when creating the playlist items. When expanding a playlist, the year is loaded for that playlist only and Amarok sorts the tree, causing the playlist to jump to a different position.
[ 13%] Building CXX object src/CMakeFiles/amaroklib.dir/amaroklib_automoc.o In file included from /home/be/software/amarok/src/amaroklib_automoc.cpp:4:0: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp: In static member function ‘static void AmarokScript::AmarokWindowScript::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:84:72: error: invalid use of incomplete type ‘class QPalette’ case 1: _t->newPalette((*reinterpret_cast< QPalette(*)>(_a[1]))); break; ^ In file included from /usr/include/QtCore/QMetaType:1:0, from /home/be/software/amarok/src/scripting/scriptengine/AmarokWindowScript.h:21, from /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:9, from /home/be/software/amarok/src/amaroklib_automoc.cpp:4: /usr/include/QtCore/qmetatype.h:323:7: error: forward declaration of ‘class QPalette’ class QPalette; ^ In file included from /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:9:0, from /home/be/software/amarok/src/amaroklib_automoc.cpp:4: /home/be/software/amarok/src/scripting/scriptengine/AmarokWindowScript.h:73:18: error: initializing argument 1 of ‘void AmarokScript::AmarokWindowScript::newPalette(QPalette)’ void newPalette( QPalette ); ^ In file included from /home/be/software/amarok/src/amaroklib_automoc.cpp:4:0: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:84:72: error: invalid use of incomplete type ‘class QPalette’ case 1: _t->newPalette((*reinterpret_cast< QPalette(*)>(_a[1]))); break; ^ In file included from /usr/include/QtCore/QMetaType:1:0, from /home/be/software/amarok/src/scripting/scriptengine/AmarokWindowScript.h:21, from /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:9, from /home/be/software/amarok/src/amaroklib_automoc.cpp:4: /usr/include/QtCore/qmetatype.h:323:7: error: forward declaration of ‘class QPalette’ class QPalette; ^ In file included from /home/be/software/amarok/src/amaroklib_automoc.cpp:4:0: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp: In member function ‘virtual int AmarokScript::AmarokWindowScript::qt_metacall(QMetaObject::Call, int, void**)’: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:148:55: error: invalid use of incomplete type ‘class QFont’ case 4: *reinterpret_cast< QFont*>(_v) = font(); break; ^ In file included from /usr/include/QtCore/QMetaType:1:0, from /home/be/software/amarok/src/scripting/scriptengine/AmarokWindowScript.h:21, from /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:9, from /home/be/software/amarok/src/amaroklib_automoc.cpp:4: /usr/include/QtCore/qmetatype.h:319:7: error: forward declaration of ‘class QFont’ class QFont; ^ In file included from /home/be/software/amarok/src/amaroklib_automoc.cpp:4:0: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:149:61: error: invalid use of incomplete type ‘class QPalette’ case 5: *reinterpret_cast< QPalette*>(_v) = palette(); break; ^ In file included from /usr/include/QtCore/QMetaType:1:0, from /home/be/software/amarok/src/scripting/scriptengine/AmarokWindowScript.h:21, from /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:9, from /home/be/software/amarok/src/amaroklib_automoc.cpp:4: /usr/include/QtCore/qmetatype.h:323:7: error: forward declaration of ‘class QPalette’ class QPalette; ^ In file included from /home/be/software/amarok/src/amaroklib_automoc.cpp:4:0: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp: In member function ‘void AmarokScript::AmarokWindowScript::newPalette(QPalette)’: /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:184:60: error: ‘_t1’ has incomplete type void AmarokScript::AmarokWindowScript::newPalette(QPalette _t1) ^ In file included from /usr/include/QtCore/QMetaType:1:0, from /home/be/software/amarok/src/scripting/scriptengine/AmarokWindowScript.h:21, from /home/be/software/amarok/src/moc_AmarokWindowScript.cpp:9, from /home/be/software/amarok/src/amaroklib_automoc.cpp:4: /usr/include/QtCore/qmetatype.h:323:7: error: forward declaration of ‘class QPalette’ class QPalette; ^ src/CMakeFiles/amaroklib.dir/build.make:299: recipe for target 'src/CMakeFiles/amaroklib.dir/amaroklib_automoc.o' failed make[2]: *** [src/CMakeFiles/amaroklib.dir/amaroklib_automoc.o] Error 1 CMakeFiles/Makefile2:1256: recipe for target 'src/CMakeFiles/amaroklib.dir/all' failed make[1]: *** [src/CMakeFiles/amaroklib.dir/all] Error 2 Makefile:117: recipe for target 'all' failed make: *** [all] Error 2
soundcloud_service.tar.xz
Description: application/xz
_______________________________________________ Amarok-devel mailing list Amarok-devel@kde.org https://mail.kde.org/mailman/listinfo/amarok-devel