[gnome-shell/gnome-3-28] search: Ignore search provider results metas if search is cancelled
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-28] search: Ignore search provider results metas if search is cancelled
- Date: Wed, 12 Sep 2018 11:54:22 +0000 (UTC)
commit b72b773d87d5a6209593fcc16e948d5e39a30f5e
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date: Thu Aug 30 07:11:24 2018 +0200
search: Ignore search provider results metas if search is cancelled
When a search has been cancelled, it is expected that providers don't
return the requested number of results, so don't log a warning in that
case.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/205
js/ui/search.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/js/ui/search.js b/js/ui/search.js
index 804be9593..396674107 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -226,6 +226,12 @@ var SearchResultsBase = new Lang.Class({
this._cancellable.reset();
this.provider.getResultMetas(metasNeeded, metas => {
+ if (this._cancellable.is_cancelled()) {
+ if (metas.length > 0)
+ log(`Search provider ${this.provider.id} returned results after the request was
canceled`);
+ callback(false);
+ return;
+ }
if (metas.length != metasNeeded.length) {
log('Wrong number of result metas returned by search provider ' + this.provider.id +
': expected ' + metasNeeded.length + ' but got ' + metas.length);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]