[gnome-software] appstream plugin: Don't allow cancelling plugin startup
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] appstream plugin: Don't allow cancelling plugin startup
- Date: Sun, 5 Oct 2014 18:44:37 +0000 (UTC)
commit 5483adbc00ce5dd479d4b2d068843cf81064e3fb
Author: Kalev Lember <kalevlember gmail com>
Date: Sun Oct 5 20:30:19 2014 +0200
appstream plugin: Don't allow cancelling plugin startup
We were hitting a concurrency bug where quickly typing "software" into
shell overview search and hitting enter would bring up a non-working
gnome-software.
The cause turned out to be the shell search provider starting a search
on the "software" string, which in turn started appstream database
parsing in the appstream plugin. However, quickly hitting enter would
cancel the current search, and also cancel the database parsing midway,
leaving us without appstream data in the GUI.
Fix this by making the database parsing and appstream plugin startup
uncancellable.
src/plugins/gs-plugin-appstream.c | 16 ++++++++--------
src/plugins/gs-plugin-moduleset.c | 6 +++---
2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 71ad8ea..a1c1a18 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -125,7 +125,7 @@ gs_plugin_destroy (GsPlugin *plugin)
* gs_plugin_startup:
*/
static gboolean
-gs_plugin_startup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
+gs_plugin_startup (GsPlugin *plugin, GError **error)
{
GPtrArray *items;
gboolean ret;
@@ -152,7 +152,7 @@ gs_plugin_startup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
AS_STORE_LOAD_FLAG_APPDATA |
AS_STORE_LOAD_FLAG_DESKTOP |
AS_STORE_LOAD_FLAG_APP_INSTALL,
- cancellable,
+ NULL,
error);
if (!ret)
goto out;
@@ -824,7 +824,7 @@ gs_plugin_refine (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
@@ -871,7 +871,7 @@ gs_plugin_add_category_apps (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
@@ -1008,7 +1008,7 @@ gs_plugin_add_search (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
@@ -1048,7 +1048,7 @@ gs_plugin_add_installed (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
@@ -1135,7 +1135,7 @@ gs_plugin_add_categories (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
@@ -1406,7 +1406,7 @@ gs_plugin_add_popular (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
diff --git a/src/plugins/gs-plugin-moduleset.c b/src/plugins/gs-plugin-moduleset.c
index 4e0166b..2b9581c 100644
--- a/src/plugins/gs-plugin-moduleset.c
+++ b/src/plugins/gs-plugin-moduleset.c
@@ -79,7 +79,7 @@ gs_plugin_destroy (GsPlugin *plugin)
* gs_plugin_startup:
*/
static gboolean
-gs_plugin_startup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
+gs_plugin_startup (GsPlugin *plugin, GError **error)
{
gboolean ret;
@@ -113,7 +113,7 @@ gs_plugin_add_popular (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
@@ -159,7 +159,7 @@ gs_plugin_refine (GsPlugin *plugin,
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
- ret = gs_plugin_startup (plugin, cancellable, error);
+ ret = gs_plugin_startup (plugin, error);
g_once_init_leave (&plugin->priv->done_init, TRUE);
if (!ret)
goto out;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]