[gnome-builder] flatpak: tell install dialog about expected SDK
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] flatpak: tell install dialog about expected SDK
- Date: Tue, 2 Mar 2021 23:41:09 +0000 (UTC)
commit 608bd594126c2ad0ab50e7554e503018f01a5323
Author: Christian Hergert <chergert redhat com>
Date: Tue Mar 2 15:38:59 2021 -0800
flatpak: tell install dialog about expected SDK
We can then use this later on when resolving unknown branches for SDK
extensions.
Related #1300
src/plugins/flatpak/gbp-flatpak-install-dialog.c | 23 +++++++++++++++++++++++
src/plugins/flatpak/gbp-flatpak-install-dialog.h | 3 +++
2 files changed, 26 insertions(+)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-install-dialog.c
b/src/plugins/flatpak/gbp-flatpak-install-dialog.c
index 13bda2652..186043e4e 100644
--- a/src/plugins/flatpak/gbp-flatpak-install-dialog.c
+++ b/src/plugins/flatpak/gbp-flatpak-install-dialog.c
@@ -37,6 +37,7 @@ struct _GbpFlatpakInstallDialog
GtkListStore *liststore1;
IdeTask *close_task;
gchar **saved_runtimes;
+ gchar *sdk;
gint response_id;
};
@@ -117,6 +118,7 @@ gbp_flatpak_install_dialog_finalize (GObject *object)
g_clear_object (&self->close_task);
g_clear_pointer (&self->saved_runtimes, g_strfreev);
+ g_clear_pointer (&self->sdk, g_free);
G_OBJECT_CLASS (gbp_flatpak_install_dialog_parent_class)->finalize (object);
}
@@ -318,3 +320,24 @@ gbp_flatpak_install_dialog_add_runtime_full (GbpFlatpakInstallDialog *self,
runtime_id = g_strdup_printf ("%s/%s/%s", name, arch, branch ?: "");
gbp_flatpak_install_dialog_add_runtime (self, runtime_id);
}
+
+void
+gbp_flatpak_install_dialog_set_sdk (GbpFlatpakInstallDialog *self,
+ const gchar *sdk)
+{
+ g_return_if_fail (GBP_IS_FLATPAK_INSTALL_DIALOG (self));
+
+ if (g_strcmp0 (sdk, self->sdk) != 0)
+ {
+ g_free (self->sdk);
+ self->sdk = g_strdup (sdk);
+ }
+}
+
+const gchar *
+gbp_flatpak_install_dialog_get_sdk (GbpFlatpakInstallDialog *self)
+{
+ g_return_val_if_fail (GBP_IS_FLATPAK_INSTALL_DIALOG (self), NULL);
+
+ return self->sdk;
+}
diff --git a/src/plugins/flatpak/gbp-flatpak-install-dialog.h
b/src/plugins/flatpak/gbp-flatpak-install-dialog.h
index 3d6363a73..823e3f4ab 100644
--- a/src/plugins/flatpak/gbp-flatpak-install-dialog.h
+++ b/src/plugins/flatpak/gbp-flatpak-install-dialog.h
@@ -29,6 +29,9 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GbpFlatpakInstallDialog, gbp_flatpak_install_dialog, GBP, FLATPAK_INSTALL_DIALOG,
GtkDialog)
GbpFlatpakInstallDialog *gbp_flatpak_install_dialog_new (GtkWindow
*transient_for);
+const gchar *gbp_flatpak_install_dialog_get_sdk (GbpFlatpakInstallDialog *self);
+void gbp_flatpak_install_dialog_set_sdk (GbpFlatpakInstallDialog *self,
+ const gchar *sdk);
void gbp_flatpak_install_dialog_add_runtime (GbpFlatpakInstallDialog *self,
const gchar *runtime_id);
void gbp_flatpak_install_dialog_add_runtime_full (GbpFlatpakInstallDialog *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]