GNOME Bugzilla – Bug 508590
Add finished signal to module
Last modified: 2011-07-10 02:23:31 UTC
The module interface should contain a new signal called "finished" that each module should emit when it's finished searching for results. Currently, we're not able to tell when a module is finished searching. Adding this feature requires: * Adding new signal and method '_emit_finished' to deskbar.interfaces.Module * Add a self._emit_finished() to each module in deskbar/handlers when it's finished searching (i.e. either before a return statement or at the end of the query method.
Created attachment 102687 [details] [review] Patch Adds _emit_finished method to Module.py and method calls to the end of the query method for every handler.
Thanks for the patch. However, you only added the finished calls in the end of the query method, but some handlers have a return before, too (e.g. in yahoo.py on line 65). You have to add a _emit_finished call before those returns, too.
Created attachment 102962 [details] [review] handler's _emit_finished mm check this out.. i've added _emit_finished to some other places..
Created attachment 102978 [details] [review] actually this is my patch, adds _emit_finished to every handler sorry mistake, i was working on other bug and so on i mixed code of both bugs.. try this one please..
In beagle-live.py you added self._emit_finished() at the end of the query method. In this particular case, this is not correct, because beagle is queried asynchronously. However, I'm not sure where to put the call best. In SpecialProgramHandler in programs.py the call has one indentation too much. It should be on the same level as the if clause. In tomboy.py we have a similar problem as in beagle-live, the query is asynchronously. I think you can emit the signal in handle_searchnotes method, but not in the query method. The other changes are perfect. Another thing I was thing about is that the finished signal should contain a parameter that contains the query string, too. Otherwise, we can't determine which query just finished.
about beagle-live, could self._emit_finished(qstring) be inside _on_hit_added? because, query connects every hit added with hits_added() then if it makes snippet request it connects with _on_snippet_received and _on_snippet_received and these both callbacks calls self._on_hit_added(query, container, qstring, qmax) wich emit query ready And hits_added also emits query ready by it self when there is not snippet request, so, its ok adding _emit_finished(qstring) inside _on_hit_added() and hits_added()??
Adding it to hits_added() is fine. _on_hit_added() only emits a single result. Therefore, we don't really now if it's really the last result. I think I need to refactor the beagle-live module to achieve the correct behavior.
I refactored the beagle-live module. It now contains only one _emit_query_ready call. That makes things much easier know.
are bugs like bug 527023, bug 527228, bug 527254 or bug 527255 duplicates of this one?
No, these bugs are not related to this one.
deskbar-applet development has been stalled [1]. Maintainers don't have future development plan so i am closing the bugs as WONTFIX. [1] http://mail.gnome.org/archives/desktop-devel-list/2011-June/msg00073.html