[gnome-software/1141-flatpak-remove-of-a-repository-doesn-t-remove-it-from-the-gui] flatpak: Remove of a repository doesn't remove it from the GUI
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1141-flatpak-remove-of-a-repository-doesn-t-remove-it-from-the-gui] flatpak: Remove of a repository doesn't remove it from the GUI
- Date: Tue, 16 Feb 2021 11:28:47 +0000 (UTC)
commit c812f13d8e1d8aea1586ec94dcba2525b9d7e33b
Author: Milan Crha <mcrha redhat com>
Date: Tue Feb 16 12:26:26 2021 +0100
flatpak: Remove of a repository doesn't remove it from the GUI
Changes:
* Allow REMOVING state to change to UNAVAILABLE - avoids to call
the gs_app_set_state() twice, once with UNKNOWN, then with the UNAVAILABLE
* Set the UNAVAILABLE state for the repository when it is removed
* Destroy any repository rows, whose state changes to UNAVAILABLE
Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1141
lib/gs-app.c | 1 +
plugins/flatpak/gs-flatpak.c | 2 +-
src/gs-repo-row.c | 6 +++++-
3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index d3cd67546..ffc995e67 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -1072,6 +1072,7 @@ gs_app_set_state_internal (GsApp *app, GsAppState state)
case GS_APP_STATE_REMOVING:
/* removing has to go into an stable state */
if (state == GS_APP_STATE_UNKNOWN ||
+ state == GS_APP_STATE_UNAVAILABLE ||
state == GS_APP_STATE_AVAILABLE ||
state == GS_APP_STATE_INSTALLED)
state_change_ok = TRUE;
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index cc9937c93..062dd3c6f 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -2937,7 +2937,7 @@ gs_flatpak_app_remove_source (GsFlatpak *self,
xb_silo_invalidate (self->silo);
g_rw_lock_reader_unlock (&self->silo_lock);
- gs_app_set_state (app, GS_APP_STATE_AVAILABLE);
+ gs_app_set_state (app, GS_APP_STATE_UNAVAILABLE);
return TRUE;
}
diff --git a/src/gs-repo-row.c b/src/gs-repo-row.c
index 9dda6c7b8..e9529e9e3 100644
--- a/src/gs-repo-row.c
+++ b/src/gs-repo-row.c
@@ -132,6 +132,9 @@ refresh_ui (GsRepoRow *row)
/* disable button */
gtk_widget_set_sensitive (priv->button, FALSE);
break;
+ case GS_APP_STATE_UNAVAILABLE:
+ gtk_widget_destroy (GTK_WIDGET (row));
+ return;
default:
break;
}
@@ -160,9 +163,10 @@ refresh_idle (gpointer user_data)
g_autoptr(GsRepoRow) row = (GsRepoRow *) user_data;
GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (row);
+ priv->refresh_idle_id = 0;
+
refresh_ui (row);
- priv->refresh_idle_id = 0;
return G_SOURCE_REMOVE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]