[Merge] ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic

2019-10-25 Thread Treviño
Marco Trevisan (Treviño) has proposed merging 
~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into 
~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic with 
~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic as a prerequisite.

Requested reviews:
  Ubuntu Desktop (ubuntu-desktop)
Related bugs:
  Bug #1756826 in nautilus (Ubuntu): "hangs when remote search provider 
performs expensive operation"
  https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1756826
  Bug #1767817 in nautilus (Ubuntu): "Full text search does not work"
  https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1767817

For more details, see:
https://code.launchpad.net/~3v1n0/ubuntu/+source/nautilus/+git/nautilus/+merge/374711
-- 
Your team Ubuntu Desktop is requested to review the proposed merge of 
~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into 
~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic.
diff --git a/debian/changelog b/debian/changelog
index ad6d1f5..abea57d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+nautilus (1:3.26.4-0~ubuntu18.04.5) bionic; urgency=medium
+
+  * d/p/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch:
+- shell-search-provider: implement XUbuntuCancel to request pending search
+  cancellation from gnome-shell (LP: #1756826)
+
+ -- Marco Trevisan (Treviño)   Fri, 25 Oct 2019 05:38:04 +0200
+
 nautilus (1:3.26.4-0~ubuntu18.04.4) bionic; urgency=medium
 
   * d/p/0015-tracker-search-engine-don-t-start-it-if-not-availabl.patch:
diff --git a/debian/patches/series b/debian/patches/series
index 9417da4..3ec0d73 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -26,3 +26,4 @@ appstream-compulsory.patch
 nautilusgtkplacesview-show-error-if-volume-is-not-mo.patch
 file-view-Always-unset-pending_selection-after-freeing-it.patch
 git_captions_order.patch
+ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch
diff --git a/debian/patches/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch b/debian/patches/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch
new file mode 100644
index 000..85fa0c2
--- /dev/null
+++ b/debian/patches/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch
@@ -0,0 +1,213 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= 
+Date: Tue, 28 Aug 2018 01:44:49 +0200
+Subject: shell-search-provider: implement XUbuntuCancel to request search
+ cancellation
+
+Stop search and Metadata fetching on XUbuntuCancel dbus method call.
+Only allow this if the caller is the same who triggered the actual event.
+
+Bug-GNOME: https://gitlab.gnome.org/GNOME/gnome-shell/issues/183
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/bionic/+source/nautilus/+bug/1756826
+Forwarded: not-needed
+---
+ data/shell-search-provider-dbus-interfaces.xml |  1 +
+ src/nautilus-shell-search-provider.c   | 96 +++---
+ 2 files changed, 88 insertions(+), 9 deletions(-)
+
+diff --git a/data/shell-search-provider-dbus-interfaces.xml b/data/shell-search-provider-dbus-interfaces.xml
+index f6840e2..4529c1e 100644
+--- a/data/shell-search-provider-dbus-interfaces.xml
 b/data/shell-search-provider-dbus-interfaces.xml
+@@ -40,5 +40,6 @@
+   
+   
+ 
++
+   
+ 
+diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
+index ffc2b7f..58864d6 100644
+--- a/src/nautilus-shell-search-provider.c
 b/src/nautilus-shell-search-provider.c
+@@ -60,6 +60,7 @@ struct _NautilusShellSearchProvider
+ 
+ PendingSearch *current_search;
+ 
++GList *metas_requests;
+ GHashTable *metas_cache;
+ };
+ 
+@@ -143,11 +144,25 @@ pending_search_finish (PendingSearch *search,
+ }
+ 
+ static void
+-cancel_current_search (NautilusShellSearchProvider *self)
++cancel_current_search (NautilusShellSearchProvider *self,
++   gboolean ignore_partial_results)
+ {
+-if (self->current_search != NULL)
++PendingSearch *search = self->current_search;
++
++if (search != NULL)
+ {
+-nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (self->current_search->engine));
++g_debug ("*** Cancel current search");
++
++nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (search->engine));
++
++if (ignore_partial_results)
++{
++g_signal_handlers_disconnect_by_data (G_OBJECT (search->engine),
++  search);
++
++pending_search_finish (search, search->invocation,
++   g_variant_new ("(as)", NULL));
++}
+ }
+ }
+ 
+@@ -451,7 +466,7 @@ execute_search (NautilusShellSearchProvider  *self,
+ NautilusQuery *query;
+ PendingSearch *pending_search;
+ 
+-cancel_current_search (self);
++cancel_current_search (

[Merge] ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic

2019-10-25 Thread Treviño
The proposal to merge 
~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into 
~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic has been updated.

Status: Needs review => Superseded

For more details, see:
https://code.launchpad.net/~3v1n0/ubuntu/+source/nautilus/+git/nautilus/+merge/354346
-- 
Your team Ubuntu Desktop is requested to review the proposed merge of 
~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into 
~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic.

-- 
ubuntu-desktop mailing list
ubuntu-desktop@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop


[Merge] ~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into ~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic

2018-09-06 Thread Treviño
Marco Trevisan (Treviño) has proposed merging 
~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into 
~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic.

Requested reviews:
  Ubuntu Desktop (ubuntu-desktop)
Related bugs:
  Bug #1756826 in nautilus (Ubuntu): "hangs when remote search provider 
performs expensive operation"
  https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1756826

For more details, see:
https://code.launchpad.net/~3v1n0/ubuntu/+source/nautilus/+git/nautilus/+merge/354346
-- 
Your team Ubuntu Desktop is requested to review the proposed merge of 
~3v1n0/ubuntu/+source/nautilus:ubuntu/bionic-xubuntu-cancel-search into 
~ubuntu-desktop/ubuntu/+source/nautilus:ubuntu/bionic.
diff --git a/debian/changelog b/debian/changelog
index 62b7833..312bb43 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+nautilus (1:3.26.4-0~ubuntu18.04.2) UNRELEASED; urgency=medium
+
+  * d/p/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch:
+shell-search-provider: implement XUbuntuCancel to request pending
+search cancellation from gnome-shell (LP: #1756826)
+
+ -- Marco Trevisan (Treviño)   Wed, 05 Sep 2018 18:03:14 +0200
+
 nautilus (1:3.26.4-0~ubuntu18.04.1) bionic; urgency=medium
 
   * New upstream release: 3.26.4 (LP: #1782681, LP: #1765776)
diff --git a/debian/patches/series b/debian/patches/series
index 41a35d1..61d3d3a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -24,3 +24,4 @@ query-add-recursive-flags-and-use-it-in-search-engines.patch
 appstream-compulsory.patch
 nautilusgtkplacesview-show-error-if-volume-is-not-mo.patch
 file-view-Always-unset-pending_selection-after-freeing-it.patch
+ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch
diff --git a/debian/patches/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch b/debian/patches/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch
new file mode 100644
index 000..ca55544
--- /dev/null
+++ b/debian/patches/ubuntu/shell-search-provider-implement-XUbuntuCancel-to-request-.patch
@@ -0,0 +1,212 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= 
+Date: Tue, 28 Aug 2018 01:44:49 +0200
+Subject: shell-search-provider: implement XUbuntuCancel to request search cancellation
+
+Stop search and Metadata fetching on XUbuntuCancel dbus method call.
+Only allow this if the caller is the same who triggered the actual event.
+
+Bug-GNOME: https://gitlab.gnome.org/GNOME/gnome-shell/issues/183
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/bionic/+source/nautilus/+bug/1756826
+Forwarded: not-needed
+---
+ data/shell-search-provider-dbus-interfaces.xml |  1 +
+ src/nautilus-shell-search-provider.c   | 96 +++---
+ 2 files changed, 88 insertions(+), 9 deletions(-)
+
+diff --git a/data/shell-search-provider-dbus-interfaces.xml b/data/shell-search-provider-dbus-interfaces.xml
+index f6840e2..4529c1e 100644
+--- a/data/shell-search-provider-dbus-interfaces.xml
 b/data/shell-search-provider-dbus-interfaces.xml
+@@ -40,5 +40,6 @@
+   
+   
+ 
++
+   
+ 
+diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
+index ffc2b7f..58864d6 100644
+--- a/src/nautilus-shell-search-provider.c
 b/src/nautilus-shell-search-provider.c
+@@ -60,6 +60,7 @@ struct _NautilusShellSearchProvider
+ 
+ PendingSearch *current_search;
+ 
++GList *metas_requests;
+ GHashTable *metas_cache;
+ };
+ 
+@@ -143,11 +144,25 @@ pending_search_finish (PendingSearch *search,
+ }
+ 
+ static void
+-cancel_current_search (NautilusShellSearchProvider *self)
++cancel_current_search (NautilusShellSearchProvider *self,
++   gboolean ignore_partial_results)
+ {
+-if (self->current_search != NULL)
++PendingSearch *search = self->current_search;
++
++if (search != NULL)
+ {
+-nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (self->current_search->engine));
++g_debug ("*** Cancel current search");
++
++nautilus_search_provider_stop (NAUTILUS_SEARCH_PROVIDER (search->engine));
++
++if (ignore_partial_results)
++{
++g_signal_handlers_disconnect_by_data (G_OBJECT (search->engine),
++  search);
++
++pending_search_finish (search, search->invocation,
++   g_variant_new ("(as)", NULL));
++}
+ }
+ }
+ 
+@@ -451,7 +466,7 @@ execute_search (NautilusShellSearchProvider  *self,
+ NautilusQuery *query;
+ PendingSearch *pending_search;
+ 
+-cancel_current_search (self);
++cancel_current_search (self, FALSE);
+ 
+ /* don't attempt searches for a single character */
+ if (g_strv_length (terms) == 1 &&
+@@ -524,6 +539,7 @@ typedef struct
+ Na