[gnome-software] trivial: Add some flags to GsFlatpak
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Add some flags to GsFlatpak
- Date: Wed, 22 Feb 2017 19:36:17 +0000 (UTC)
commit 344955bbafd43e82933a2c11f78dbc7247462019
Author: Richard Hughes <richard hughsie com>
Date: Wed Feb 22 10:04:08 2017 +0000
trivial: Add some flags to GsFlatpak
These will allow us to control the operation mode in future patches.
src/plugins/gs-flatpak.c | 13 +++++++++++++
src/plugins/gs-flatpak.h | 9 +++++++++
src/plugins/gs-plugin-flatpak.c | 5 +++++
3 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 27ff805..74d236c 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -37,6 +37,7 @@
struct _GsFlatpak {
GObject parent_instance;
+ GsFlatpakFlags flags;
FlatpakInstallation *installation;
GHashTable *broken_remotes;
GFileMonitor *monitor;
@@ -2989,6 +2990,18 @@ gs_flatpak_get_scope (GsFlatpak *self)
return self->scope;
}
+void
+gs_flatpak_set_flags (GsFlatpak *self, GsFlatpakFlags flags)
+{
+ self->flags = flags;
+}
+
+GsFlatpakFlags
+gs_flatpak_get_flags (GsFlatpak *self)
+{
+ return self->flags;
+}
+
static void
gs_flatpak_finalize (GObject *object)
{
diff --git a/src/plugins/gs-flatpak.h b/src/plugins/gs-flatpak.h
index 135744d..7f199c0 100644
--- a/src/plugins/gs-flatpak.h
+++ b/src/plugins/gs-flatpak.h
@@ -46,8 +46,17 @@ G_DECLARE_FINAL_TYPE (GsFlatpak, gs_flatpak, GS, FLATPAK, GObject)
#define gs_app_set_flatpak_file_type(app,val) gs_app_set_metadata(app,"flatpak::file-type",val)
#define gs_app_set_flatpak_object_id(app,val) gs_app_set_metadata(app,"flatpak::object-id",val)
+typedef enum {
+ GS_FLATPAK_FLAG_NONE = 0,
+ /*< private >*/
+ GS_FLATPAK_FLAG_LAST
+} GsFlatpakFlags;
+
GsFlatpak *gs_flatpak_new (GsPlugin *plugin,
FlatpakInstallation *installation);
+void gs_flatpak_set_flags (GsFlatpak *self,
+ GsFlatpakFlags flags);
+GsFlatpakFlags gs_flatpak_get_flags (GsFlatpak *self);
AsAppScope gs_flatpak_get_scope (GsFlatpak *self);
const gchar *gs_flatpak_get_id (GsFlatpak *self);
gboolean gs_flatpak_setup (GsFlatpak *self,
diff --git a/src/plugins/gs-plugin-flatpak.c b/src/plugins/gs-plugin-flatpak.c
index 929e227..b2da632 100644
--- a/src/plugins/gs-plugin-flatpak.c
+++ b/src/plugins/gs-plugin-flatpak.c
@@ -105,6 +105,7 @@ gs_plugin_adopt_app (GsPlugin *plugin, GsApp *app)
static gboolean
gs_plugin_flatpak_add_installation (GsPlugin *plugin,
FlatpakInstallation *installation,
+ GsFlatpakFlags flags,
GCancellable *cancellable,
GError **error)
{
@@ -118,6 +119,7 @@ gs_plugin_flatpak_add_installation (GsPlugin *plugin,
/* create and set up */
flatpak = gs_flatpak_new (plugin, installation);
+ gs_flatpak_set_flags (flatpak, flags);
if (!gs_flatpak_setup (flatpak, cancellable, error))
return FALSE;
g_debug ("successfully set up %s", gs_flatpak_get_id (flatpak));
@@ -144,6 +146,7 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
return FALSE;
}
if (!gs_plugin_flatpak_add_installation (plugin, installation,
+ GS_FLATPAK_FLAG_NONE,
cancellable, error)) {
return FALSE;
}
@@ -165,6 +168,7 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
return FALSE;
}
if (!gs_plugin_flatpak_add_installation (plugin, installation,
+ GS_FLATPAK_FLAG_NONE,
cancellable, error)) {
return FALSE;
}
@@ -179,6 +183,7 @@ gs_plugin_setup (GsPlugin *plugin, GCancellable *cancellable, GError **error)
return FALSE;
}
if (!gs_plugin_flatpak_add_installation (plugin, installation,
+ GS_FLATPAK_FLAG_NONE,
cancellable, error)) {
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]