[gnome-software] gs-progress-button: Add stub support for unknown progress values
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] gs-progress-button: Add stub support for unknown progress values
- Date: Thu, 14 May 2020 15:01:37 +0000 (UTC)
commit 39e6be6e701c19d72b426014e8f5f3f1360c211c
Author: Philip Withnall <withnall endlessm com>
Date: Thu May 14 13:42:18 2020 +0100
gs-progress-button: Add stub support for unknown progress values
This currently emits a warning, since I don’t have time to implement
support for it right now. It handles unknown progress values as 0%.
Signed-off-by: Philip Withnall <withnall endlessm com>
Helps: #276
src/gs-progress-button.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/gs-progress-button.c b/src/gs-progress-button.c
index 2d6ef2f6..a0be68d9 100644
--- a/src/gs-progress-button.c
+++ b/src/gs-progress-button.c
@@ -8,6 +8,7 @@
#include "config.h"
+#include "gs-app.h"
#include "gs-progress-button.h"
struct _GsProgressButton
@@ -24,6 +25,11 @@ gs_progress_button_set_progress (GsProgressButton *button, guint percentage)
{
g_autofree gchar *css = NULL;
+ if (percentage == GS_APP_PROGRESS_UNKNOWN) {
+ g_warning ("FIXME: Unknown progress handling is not yet implemented for GsProgressButton");
+ percentage = 0;
+ }
+
if (percentage == 0)
css = g_strdup (".install-progress { background-size: 0; }");
else if (percentage == 100)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]