Issue with scripted services and collection view.

Maximilian Kossick maximilian.kossick at googlemail.com
Tue Dec 22 14:06:45 CET 2009


On Tue, Dec 22, 2009 at 12:38 PM, Nikolaj Hald Nielsen
<nhnfreespirit at gmail.com> wrote:
> Hi Max,
>
> I am hoping you can instantly see what is wrong here and point me in
> the right direction, as I have no clue :-)
>
> Recently some scripted services, especially those with more than 2
> levels, have stopped working. For instance, if typing "Jules Verne"
> into the filter in the librivox service, the "Jules Verne" node shows
> up empty when expanded.
>
> When investigating, I found that the script actually works fine, it
> does exactly what is told. The issue seems to be that immediately
> after the results have been fetched, a new top level query is made,
> resulting in the view getting reset. For very large result set, you
> can even see the correct results showing up in the list for a split
> second before they are removed.
>
> Since this is a regression that has happened recently and no changes
> have been done to the scripted service stuff, it is likely that the
> scripted services simply do not play well with the semi recent changes
> to the way the collection view stuff works.
>
> I consider this a showstopper bug for 2.2.2 and would appreciate any
> input you might have.
>
> Thanks!
>
> - Nikolaj
>

The view should discard previous results and query the underlying
collection(s) again in two cases: a) the filter changed or b) the
collection changed.

a) does not seem to be the problem. b) is triggered by a collection
emitting the Collection::updated() signal. A quick look in the sources
shows that the signla is emitted by ScriptableServiceCollection on
line 54. Commenting that line fixes the issue for me, but I did not
test scriptable services extensively and I have a change to
ScriptableServiceQueryMaker in my local git repo (making
ScriptableServiceQueryMaker::run() run asynchronously as defined by
the QueryMaker contract by using QTimer::singleShot. This change
should not impact the issue that you are seeing, but I can push it if
the solution outlined above does not solve the problem for you)

Cheers,
Max


More information about the Amarok-devel mailing list