[gnome-software/wip/direct-AsApp2] Use AsApp from libappstream-glib
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/direct-AsApp2] Use AsApp from libappstream-glib
- Date: Tue, 1 Jul 2014 20:01:45 +0000 (UTC)
commit 5e1824e0b0233ce1adb5a2516ce42ace8f068455
Author: Richard Hughes <richard hughsie com>
Date: Tue Jul 1 18:32:58 2014 +0100
Use AsApp from libappstream-glib
src/gs-app-addon-row.c | 18 +-
src/gs-app-addon-row.h | 4 +-
src/gs-app-folder-dialog.c | 6 +-
src/gs-app-row.c | 28 +-
src/gs-app-row.h | 4 +-
src/gs-app-tile.c | 28 +-
src/gs-app-tile.h | 6 +-
src/gs-app.c | 946 ++++++++-----------------
src/gs-app.h | 181 ++---
src/gs-category.c | 2 +-
src/gs-cmd.c | 10 +-
src/gs-feature-tile.c | 34 +-
src/gs-feature-tile.h | 6 +-
src/gs-history-dialog.c | 10 +-
src/gs-history-dialog.h | 2 +-
src/gs-plugin-loader-sync.c | 12 +-
src/gs-plugin-loader-sync.h | 8 +-
src/gs-plugin-loader.c | 222 +++---
src/gs-plugin-loader.h | 16 +-
src/gs-plugin.c | 34 +-
src/gs-plugin.h | 19 +-
src/gs-popular-tile.c | 22 +-
src/gs-popular-tile.h | 6 +-
src/gs-self-test.c | 100 ++--
src/gs-shell-category.c | 6 +-
src/gs-shell-details.c | 124 ++--
src/gs-shell-details.h | 4 +-
src/gs-shell-installed.c | 62 +-
src/gs-shell-overview.c | 12 +-
src/gs-shell-search-provider.c | 20 +-
src/gs-shell-search.c | 44 +-
src/gs-shell-updates.c | 6 +-
src/gs-shell.c | 8 +-
src/gs-shell.h | 2 +-
src/gs-sources-dialog.c | 24 +-
src/gs-update-dialog.c | 20 +-
src/gs-update-dialog.h | 2 +-
src/gs-update-list.c | 16 +-
src/gs-update-list.h | 2 +-
src/gs-utils.c | 16 +-
src/gs-utils.h | 4 +-
src/plugins/gs-plugin-appstream.c | 106 ++--
src/plugins/gs-plugin-desktopdb.c | 20 +-
src/plugins/gs-plugin-dummy.c | 30 +-
src/plugins/gs-plugin-epiphany.c | 72 +-
src/plugins/gs-plugin-fedora-tagger-ratings.c | 10 +-
src/plugins/gs-plugin-fedora-tagger-usage.c | 6 +-
src/plugins/gs-plugin-hardcoded-categories.c | 8 +-
src/plugins/gs-plugin-hardcoded-featured.c | 10 +-
src/plugins/gs-plugin-local-ratings.c | 12 +-
src/plugins/gs-plugin-menu-spec-refine.c | 14 +-
src/plugins/gs-plugin-moduleset.c | 10 +-
src/plugins/gs-plugin-packagekit-history.c | 28 +-
src/plugins/gs-plugin-packagekit-offline.c | 2 +-
src/plugins/gs-plugin-packagekit-refine.c | 80 +-
src/plugins/gs-plugin-packagekit-refresh.c | 10 +-
src/plugins/gs-plugin-packagekit-updates.c | 2 +-
src/plugins/gs-plugin-packagekit.c | 30 +-
src/plugins/gs-plugin-self-test.c | 6 +-
src/plugins/gs-plugin-systemd-updates.c | 2 +-
src/plugins/packagekit-common.c | 2 +-
61 files changed, 1061 insertions(+), 1495 deletions(-)
---
diff --git a/src/gs-app-addon-row.c b/src/gs-app-addon-row.c
index 00eefdd..4f8165f 100644
--- a/src/gs-app-addon-row.c
+++ b/src/gs-app-addon-row.c
@@ -30,7 +30,7 @@
struct _GsAppAddonRowPrivate
{
- GsApp *app;
+ AsApp *app;
GtkWidget *name_box;
GtkWidget *name_label;
GtkWidget *description_label;
@@ -62,9 +62,9 @@ gs_app_addon_row_get_summary (GsAppAddonRow *row)
if (gs_app_get_kind (priv->app) == GS_APP_KIND_MISSING)
tmp = gs_app_get_summary_missing (priv->app);
if (tmp == NULL || (tmp != NULL && tmp[0] == '\0'))
- tmp = gs_app_get_summary (priv->app);
+ tmp = as_app_get_comment (priv->app, NULL);
if (tmp == NULL || (tmp != NULL && tmp[0] == '\0'))
- tmp = gs_app_get_description (priv->app);
+ tmp = as_app_get_description (priv->app, NULL);
escaped = g_markup_escape_text (tmp, -1);
str = g_string_new (escaped);
@@ -89,10 +89,10 @@ gs_app_addon_row_refresh (GsAppAddonRow *row)
g_string_free (str, TRUE);
gtk_label_set_label (GTK_LABEL (priv->name_label),
- gs_app_get_name (priv->app));
+ as_app_get_name (priv->app, NULL));
/* update the state label */
- switch (gs_app_get_state (row->priv->app)) {
+ switch (as_app_get_state (row->priv->app)) {
case AS_APP_STATE_QUEUED_FOR_INSTALL:
gtk_widget_set_visible (priv->label, TRUE);
gtk_label_set_label (GTK_LABEL (priv->label), _("Pending"));
@@ -116,7 +116,7 @@ gs_app_addon_row_refresh (GsAppAddonRow *row)
}
/* update the checkbox */
- switch (gs_app_get_state (row->priv->app)) {
+ switch (as_app_get_state (row->priv->app)) {
case AS_APP_STATE_QUEUED_FOR_INSTALL:
gtk_widget_set_sensitive (priv->checkbox, TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (row->priv->checkbox), TRUE);
@@ -146,7 +146,7 @@ gs_app_addon_row_refresh (GsAppAddonRow *row)
}
}
-GsApp *
+AsApp *
gs_app_addon_row_get_addon (GsAppAddonRow *row)
{
g_return_val_if_fail (GS_IS_APP_ADDON_ROW (row), NULL);
@@ -154,7 +154,7 @@ gs_app_addon_row_get_addon (GsAppAddonRow *row)
}
static void
-gs_app_addon_row_notify_props_changed_cb (GsApp *app,
+gs_app_addon_row_notify_props_changed_cb (AsApp *app,
GParamSpec *pspec,
GsAppAddonRow *row)
{
@@ -162,7 +162,7 @@ gs_app_addon_row_notify_props_changed_cb (GsApp *app,
}
void
-gs_app_addon_row_set_addon (GsAppAddonRow *row, GsApp *app)
+gs_app_addon_row_set_addon (GsAppAddonRow *row, AsApp *app)
{
g_return_if_fail (GS_IS_APP_ADDON_ROW (row));
g_return_if_fail (GS_IS_APP (app));
diff --git a/src/gs-app-addon-row.h b/src/gs-app-addon-row.h
index 601de6c..c3ef7db 100644
--- a/src/gs-app-addon-row.h
+++ b/src/gs-app-addon-row.h
@@ -58,9 +58,9 @@ void gs_app_addon_row_refresh (GsAppAddonRow *row);
void gs_app_addon_row_set_selected (GsAppAddonRow *row,
gboolean selected);
gboolean gs_app_addon_row_get_selected (GsAppAddonRow *row);
-GsApp *gs_app_addon_row_get_addon (GsAppAddonRow *row);
+AsApp *gs_app_addon_row_get_addon (GsAppAddonRow *row);
void gs_app_addon_row_set_addon (GsAppAddonRow *row,
- GsApp *app);
+ AsApp *app);
G_END_DECLS
diff --git a/src/gs-app-folder-dialog.c b/src/gs-app-folder-dialog.c
index e5c4a7a..eb1934d 100644
--- a/src/gs-app-folder-dialog.c
+++ b/src/gs-app-folder-dialog.c
@@ -83,10 +83,10 @@ apply_changes (GsAppFolderDialog *dialog)
folder = NULL;
for (l = priv->apps; l; l = l->next) {
- GsApp *app = l->data;
+ AsApp *app = l->data;
gs_folders_set_app_folder (priv->folders,
- gs_app_get_id_full (app),
- gs_app_get_categories (app),
+ as_app_get_id_full (app),
+ as_app_get_categories (app),
folder);
}
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index f14b9e8..fdbac91 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -33,7 +33,7 @@
struct _GsAppRowPrivate
{
- GsApp *app;
+ AsApp *app;
GtkWidget *image;
GtkWidget *name_box;
GtkWidget *name_label;
@@ -82,7 +82,7 @@ gs_app_row_get_description (GsAppRow *app_row)
/* convert the markdown update description into PangoMarkup */
if (priv->show_update &&
- gs_app_get_state (priv->app) == AS_APP_STATE_UPDATABLE) {
+ as_app_get_state (priv->app) == AS_APP_STATE_UPDATABLE) {
tmp = gs_app_get_update_details (priv->app);
if (tmp != NULL && tmp[0] != '\0') {
markdown = gs_markdown_new (GS_MARKDOWN_OUTPUT_PANGO);
@@ -99,11 +99,11 @@ gs_app_row_get_description (GsAppRow *app_row)
if (gs_app_get_kind (priv->app) == GS_APP_KIND_MISSING)
tmp = gs_app_get_summary_missing (priv->app);
if (tmp == NULL || (tmp != NULL && tmp[0] == '\0'))
- tmp = gs_app_get_description (priv->app);
+ tmp = as_app_get_description (priv->app, NULL);
if (tmp == NULL || (tmp != NULL && tmp[0] == '\0'))
- tmp = gs_app_get_summary (priv->app);
+ tmp = as_app_get_comment (priv->app, NULL);
if (tmp == NULL || (tmp != NULL && tmp[0] == '\0'))
- tmp = gs_app_get_name (priv->app);
+ tmp = as_app_get_name (priv->app, NULL);
escaped = g_markup_escape_text (tmp, -1);
str = g_string_new (escaped);
out:
@@ -135,9 +135,9 @@ gs_app_row_refresh (GsAppRow *app_row)
g_string_free (str, TRUE);
gtk_label_set_label (GTK_LABEL (priv->name_label),
- gs_app_get_name (priv->app));
+ as_app_get_name (priv->app, NULL));
if (priv->show_update &&
- gs_app_get_state (priv->app) == AS_APP_STATE_UPDATABLE) {
+ as_app_get_state (priv->app) == AS_APP_STATE_UPDATABLE) {
gtk_widget_show (priv->version_label);
gtk_widget_hide (priv->star);
gtk_label_set_label (GTK_LABEL (priv->version_label),
@@ -163,7 +163,7 @@ gs_app_row_refresh (GsAppRow *app_row)
gtk_widget_hide (priv->folder_label);
} else {
folders = gs_folders_get ();
- folder = gs_folders_get_app_folder (folders, gs_app_get_id_full (priv->app),
gs_app_get_categories (priv->app));
+ folder = gs_folders_get_app_folder (folders, as_app_get_id_full (priv->app),
as_app_get_categories (priv->app));
if (folder)
folder = gs_folders_get_folder_name (folders, folder);
gtk_label_set_label (GTK_LABEL (priv->folder_label), folder);
@@ -182,7 +182,7 @@ gs_app_row_refresh (GsAppRow *app_row)
context = gtk_widget_get_style_context (priv->button);
gtk_style_context_remove_class (context, "destructive-action");
- switch (gs_app_get_state (app_row->priv->app)) {
+ switch (as_app_get_state (app_row->priv->app)) {
case AS_APP_STATE_UNAVAILABLE:
gtk_widget_set_visible (priv->button, TRUE);
/* TRANSLATORS: this is a button next to the search results that
@@ -242,8 +242,8 @@ gs_app_row_refresh (GsAppRow *app_row)
gtk_widget_set_visible (priv->button_box, !priv->show_update);
if (priv->selectable) {
- if (gs_app_get_id_kind (priv->app) == AS_ID_KIND_DESKTOP ||
- gs_app_get_id_kind (priv->app) == AS_ID_KIND_WEB_APP)
+ if (as_app_get_id_kind (priv->app) == AS_ID_KIND_DESKTOP ||
+ as_app_get_id_kind (priv->app) == AS_ID_KIND_WEB_APP)
gtk_widget_set_visible (priv->checkbox, TRUE);
gtk_widget_set_sensitive (priv->button, FALSE);
} else {
@@ -288,7 +288,7 @@ gs_app_row_unreveal (GsAppRow *app_row)
/**
* gs_app_row_get_app:
**/
-GsApp *
+AsApp *
gs_app_row_get_app (GsAppRow *app_row)
{
g_return_val_if_fail (GS_IS_APP_ROW (app_row), NULL);
@@ -299,7 +299,7 @@ gs_app_row_get_app (GsAppRow *app_row)
* gs_app_row_notify_props_changed_cb:
**/
static void
-gs_app_row_notify_props_changed_cb (GsApp *app,
+gs_app_row_notify_props_changed_cb (AsApp *app,
GParamSpec *pspec,
GsAppRow *app_row)
{
@@ -310,7 +310,7 @@ gs_app_row_notify_props_changed_cb (GsApp *app,
* gs_app_row_set_app:
**/
void
-gs_app_row_set_app (GsAppRow *app_row, GsApp *app)
+gs_app_row_set_app (GsAppRow *app_row, AsApp *app)
{
g_return_if_fail (GS_IS_APP_ROW (app_row));
g_return_if_fail (GS_IS_APP (app));
diff --git a/src/gs-app-row.h b/src/gs-app-row.h
index 41cf825..7cb69e0 100644
--- a/src/gs-app-row.h
+++ b/src/gs-app-row.h
@@ -67,9 +67,9 @@ void gs_app_row_set_selectable (GsAppRow *app_row,
void gs_app_row_set_selected (GsAppRow *app_row,
gboolean selected);
gboolean gs_app_row_get_selected (GsAppRow *app_row);
-GsApp *gs_app_row_get_app (GsAppRow *app_row);
+AsApp *gs_app_row_get_app (GsAppRow *app_row);
void gs_app_row_set_app (GsAppRow *app_row,
- GsApp *app);
+ AsApp *app);
void gs_app_row_set_size_groups (GsAppRow *app_row,
GtkSizeGroup *image,
GtkSizeGroup *name);
diff --git a/src/gs-app-tile.c b/src/gs-app-tile.c
index e7d10dc..fdc07fd 100644
--- a/src/gs-app-tile.c
+++ b/src/gs-app-tile.c
@@ -29,7 +29,7 @@
struct _GsAppTilePrivate
{
- GsApp *app;
+ AsApp *app;
GtkWidget *button;
GtkWidget *image;
GtkWidget *name;
@@ -48,7 +48,7 @@ enum {
static guint signals [SIGNAL_LAST] = { 0 };
-GsApp *
+AsApp *
gs_app_tile_get_app (GsAppTile *tile)
{
GsAppTilePrivate *priv;
@@ -60,7 +60,7 @@ gs_app_tile_get_app (GsAppTile *tile)
}
static void
-app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
+app_state_changed (AsApp *app, GParamSpec *pspec, GsAppTile *tile)
{
AtkObject *accessible;
GsAppTilePrivate *priv;
@@ -72,11 +72,11 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
accessible = gtk_widget_get_accessible (priv->button);
label = gtk_bin_get_child (GTK_BIN (priv->eventbox));
- switch (gs_app_get_state (app)) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_INSTALLED:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Installed"));
/* TRANSLATORS: this is the small blue label on the tile
* that tells the user the application is installed */
@@ -85,7 +85,7 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
case AS_APP_STATE_INSTALLING:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Installing"));
/* TRANSLATORS: this is the small blue label on the tile
* that tells the user the application is being installing */
@@ -94,7 +94,7 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
case AS_APP_STATE_REMOVING:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Removing"));
/* TRANSLATORS: this is the small blue label on the tile
* that tells the user the application is being removed */
@@ -103,7 +103,7 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
case AS_APP_STATE_UPDATABLE:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Updates"));
/* TRANSLATORS: this is the small blue label on the tile
* that tells the user there is an update for the installed
@@ -114,7 +114,7 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
case AS_APP_STATE_AVAILABLE:
default:
installed = FALSE;
- name = g_strdup (gs_app_get_name (app));
+ name = g_strdup (as_app_get_name (app, NULL));
break;
}
@@ -122,13 +122,13 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsAppTile *tile)
if (GTK_IS_ACCESSIBLE (accessible)) {
atk_object_set_name (accessible, name);
- atk_object_set_description (accessible, gs_app_get_summary (app));
+ atk_object_set_description (accessible, as_app_get_comment (app, NULL));
}
g_free (name);
}
void
-gs_app_tile_set_app (GsAppTile *tile, GsApp *app)
+gs_app_tile_set_app (GsAppTile *tile, AsApp *app)
{
GsAppTilePrivate *priv;
const gchar *summary;
@@ -165,8 +165,8 @@ gs_app_tile_set_app (GsAppTile *tile, GsApp *app)
app_state_changed (priv->app, NULL, tile);
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), gs_app_get_pixbuf (app));
- gtk_label_set_label (GTK_LABEL (priv->name), gs_app_get_name (app));
- summary = gs_app_get_summary (app);
+ gtk_label_set_label (GTK_LABEL (priv->name), as_app_get_name (app, NULL));
+ summary = as_app_get_comment (app, NULL);
gtk_label_set_label (GTK_LABEL (priv->summary), summary);
gtk_widget_set_visible (priv->summary, summary && summary[0]);
}
@@ -236,7 +236,7 @@ gs_app_tile_class_init (GsAppTileClass *klass)
}
GtkWidget *
-gs_app_tile_new (GsApp *cat)
+gs_app_tile_new (AsApp *cat)
{
GsAppTile *tile;
diff --git a/src/gs-app-tile.h b/src/gs-app-tile.h
index 69afef3..b63005b 100644
--- a/src/gs-app-tile.h
+++ b/src/gs-app-tile.h
@@ -53,10 +53,10 @@ struct _GsAppTileClass
};
GType gs_app_tile_get_type (void);
-GtkWidget *gs_app_tile_new (GsApp *app);
-GsApp *gs_app_tile_get_app (GsAppTile *tile);
+GtkWidget *gs_app_tile_new (AsApp *app);
+AsApp *gs_app_tile_get_app (GsAppTile *tile);
void gs_app_tile_set_app (GsAppTile *tile,
- GsApp *cat);
+ AsApp *cat);
G_END_DECLS
diff --git a/src/gs-app.c b/src/gs-app.c
index 85b0882..b4aab2e 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -25,19 +25,19 @@
* @short_description: An application that is either installed or that can be installed
*
* This object represents a 1:1 mapping to a .desktop file. The design is such
- * so you can't have different GsApp's for different versions or architectures
+ * so you can't have different AsApp's for different versions or architectures
* of a package. This rule really only applies to GsApps of kind GS_APP_KIND_NORMAL
* and GS_APP_KIND_SYSTEM. We allow GsApps of kind GS_APP_KIND_SYSTEM_UPDATE or
* GS_APP_KIND_PACKAGE, which don't correspond to desktop files, but instead
* represent a system update and its individual components.
*
- * The #GsPluginLoader de-duplicates the GsApp instances that are produced by
- * plugins to ensure that there is a single instance of GsApp for each id, making
+ * The #GsPluginLoader de-duplicates the AsApp instances that are produced by
+ * plugins to ensure that there is a single instance of AsApp for each id, making
* the id the primary key for this object. This ensures that actions triggered on
- * a GsApp in different parts of gnome-software can be observed by connecting to
- * signals on the GsApp.
+ * a AsApp in different parts of gnome-software can be observed by connecting to
+ * signals on the AsApp.
*
- * Information about other #GsApp objects can be stored in this object, for
+ * Information about other #AsApp objects can be stored in this object, for
* instance in the gs_app_add_related() method or gs_app_get_history().
*/
@@ -53,26 +53,15 @@ static void gs_app_finalize (GObject *object);
struct GsAppPrivate
{
- gchar *id;
- gchar *id_full;
- gchar *name;
GsAppQuality name_quality;
- gchar *icon;
GPtrArray *sources;
GPtrArray *source_ids;
- gchar *project_group;
gchar *version;
gchar *version_ui;
- gchar *summary;
GsAppQuality summary_quality;
gchar *summary_missing;
- gchar *description;
GsAppQuality description_quality;
- GPtrArray *screenshots;
- GPtrArray *categories;
GPtrArray *keywords;
- GHashTable *urls;
- gchar *licence;
gchar *menu_path;
gchar *origin;
gchar *update_version;
@@ -84,16 +73,13 @@ struct GsAppPrivate
GsAppRatingKind rating_kind;
guint64 size;
GsAppKind kind;
- AsIdKind id_kind;
- AsAppState state;
- GHashTable *metadata;
GdkPixbuf *pixbuf;
GdkPixbuf *featured_pixbuf;
- GPtrArray *addons; /* of GsApp */
+ GPtrArray *addons; /* of AsApp */
GHashTable *addons_hash; /* of "id" */
- GPtrArray *related; /* of GsApp */
+ GPtrArray *related; /* of AsApp */
GHashTable *related_hash; /* of "id-source" */
- GPtrArray *history; /* of GsApp */
+ GPtrArray *history; /* of AsApp */
guint64 install_date;
guint64 kudos;
gboolean to_be_installed;
@@ -113,20 +99,7 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE_WITH_PRIVATE (GsApp, gs_app, G_TYPE_OBJECT)
-
-/**
- * gs_app_error_quark:
- * Return value: Our personal error quark.
- **/
-GQuark
-gs_app_error_quark (void)
-{
- static GQuark quark = 0;
- if (!quark)
- quark = g_quark_from_static_string ("gs_app_error");
- return quark;
-}
+G_DEFINE_TYPE_WITH_PRIVATE (GsApp, gs_app, AS_TYPE_APP)
/**
* gs_app_kind_to_string:
@@ -157,30 +130,32 @@ gs_app_kind_to_string (GsAppKind kind)
* gs_app_to_string:
**/
gchar *
-gs_app_to_string (GsApp *app)
+gs_app_to_string (AsApp *app)
{
AsImage *im;
AsScreenshot *ss;
GList *keys;
GList *l;
GString *str;
- GsAppPrivate *priv = app->priv;
+ GPtrArray *categories;
+ GPtrArray *screenshots;
+ GsAppPrivate *priv = GS_APP(app)->priv;
const gchar *tmp;
guint i;
g_return_val_if_fail (GS_IS_APP (app), NULL);
- str = g_string_new ("GsApp:\n");
+ str = g_string_new ("AsApp:\n");
g_string_append_printf (str, "\tkind:\t%s\n",
gs_app_kind_to_string (priv->kind));
- if (priv->id_kind != AS_ID_KIND_UNKNOWN) {
+ if (as_app_get_id_kind (app) != AS_ID_KIND_UNKNOWN) {
g_string_append_printf (str, "\tid-kind:\t%s\n",
- as_id_kind_to_string (priv->id_kind));
+ as_id_kind_to_string (as_app_get_id_kind (app)));
}
g_string_append_printf (str, "\tstate:\t%s\n",
- as_app_state_to_string (priv->state));
- if (priv->id_full != NULL)
- g_string_append_printf (str, "\tid:\t%s\n", priv->id_full);
+ as_app_state_to_string (as_app_get_state (app)));
+ if (as_app_get_id_full (app) != NULL)
+ g_string_append_printf (str, "\tid:\t%s\n", as_app_get_id_full (app));
if ((priv->kudos & GS_APP_KUDO_MY_LANGUAGE) > 0)
g_string_append (str, "\tkudo:\tmy-language\n");
if ((priv->kudos & GS_APP_KUDO_RECENT_RELEASE) > 0)
@@ -207,10 +182,10 @@ gs_app_to_string (GsApp *app)
g_string_append (str, "\tkudo:\tibus-has-symbol\n");
g_string_append_printf (str, "\tkudo-percentage:\t%i\n",
gs_app_get_kudos_percentage (app));
- if (priv->name != NULL)
- g_string_append_printf (str, "\tname:\t%s\n", priv->name);
- if (priv->icon != NULL)
- g_string_append_printf (str, "\ticon:\t%s\n", priv->icon);
+ if (as_app_get_name (app, NULL) != NULL)
+ g_string_append_printf (str, "\tname:\t%s\n", as_app_get_name (app, NULL));
+ if (as_app_get_icon (app) != NULL)
+ g_string_append_printf (str, "\ticon:\t%s\n", as_app_get_icon (app));
if (priv->version != NULL)
g_string_append_printf (str, "\tversion:\t%s\n", priv->version);
if (priv->version_ui != NULL)
@@ -223,12 +198,13 @@ gs_app_to_string (GsApp *app)
g_string_append_printf (str, "\tupdate-details:\t%s\n",
priv->update_details);
}
- if (priv->summary != NULL)
- g_string_append_printf (str, "\tsummary:\t%s\n", priv->summary);
- if (priv->description != NULL)
- g_string_append_printf (str, "\tdescription:\t%s\n", priv->description);
- for (i = 0; i < priv->screenshots->len; i++) {
- ss = g_ptr_array_index (priv->screenshots, i);
+ if (as_app_get_comment (app, NULL) != NULL)
+ g_string_append_printf (str, "\tsummary:\t%s\n", as_app_get_comment (app, NULL));
+ if (as_app_get_description (app, NULL) != NULL)
+ g_string_append_printf (str, "\tdescription:\t%s\n", as_app_get_description (app, NULL));
+ screenshots = as_app_get_screenshots (app);
+ for (i = 0; i < screenshots->len; i++) {
+ ss = g_ptr_array_index (screenshots, i);
tmp = as_screenshot_get_caption (ss, NULL);
im = as_screenshot_get_image (ss, 0, 0);
if (im == NULL)
@@ -245,11 +221,11 @@ gs_app_to_string (GsApp *app)
tmp = g_ptr_array_index (priv->source_ids, i);
g_string_append_printf (str, "\tsource-id-%02i:\t%s\n", i, tmp);
}
- tmp = g_hash_table_lookup (priv->urls, GS_APP_URL_KIND_HOMEPAGE);
+ tmp = as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE);
if (tmp != NULL)
g_string_append_printf (str, "\turl{homepage}:\t%s\n", tmp);
- if (priv->licence != NULL)
- g_string_append_printf (str, "\tlicence:\t%s\n", priv->licence);
+ if (as_app_get_project_license (app) != NULL)
+ g_string_append_printf (str, "\tlicence:\t%s\n", as_app_get_project_license (app));
if (priv->summary_missing != NULL)
g_string_append_printf (str, "\tsummary-missing:\t%s\n", priv->summary_missing);
if (priv->menu_path != NULL && priv->menu_path[0] != '\0')
@@ -281,13 +257,14 @@ gs_app_to_string (GsApp *app)
g_string_append_printf (str, "\trelated:\t%i\n", priv->related->len);
if (priv->history->len > 0)
g_string_append_printf (str, "\thistory:\t%i\n", priv->history->len);
- for (i = 0; i < priv->categories->len; i++) {
- tmp = g_ptr_array_index (priv->categories, i);
+ categories = as_app_get_categories (app);
+ for (i = 0; i < categories->len; i++) {
+ tmp = g_ptr_array_index (categories, i);
g_string_append_printf (str, "\tcategory:\t%s\n", tmp);
}
- keys = g_hash_table_get_keys (priv->metadata);
+ keys = g_hash_table_get_keys (as_app_get_metadata (app));
for (l = keys; l != NULL; l = l->next) {
- tmp = g_hash_table_lookup (priv->metadata, l->data);
+ tmp = g_hash_table_lookup (as_app_get_metadata (app), l->data);
g_string_append_printf (str, "\t{%s}:\t%s\n",
(const gchar *) l->data, tmp);
}
@@ -296,7 +273,7 @@ gs_app_to_string (GsApp *app)
}
typedef struct {
- GsApp *app;
+ AsApp *app;
gchar *property_name;
} AppNotifyData;
@@ -316,7 +293,7 @@ notify_idle_cb (gpointer data)
}
static void
-gs_app_queue_notify (GsApp *app, const gchar *property_name)
+gs_app_queue_notify (AsApp *app, const gchar *property_name)
{
AppNotifyData *notify_data;
guint id;
@@ -330,73 +307,18 @@ gs_app_queue_notify (GsApp *app, const gchar *property_name)
}
/**
- * gs_app_get_id:
- **/
-const gchar *
-gs_app_get_id (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->id;
-}
-
-/**
- * gs_app_get_id_full:
- **/
-const gchar *
-gs_app_get_id_full (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->id_full;
-}
-
-/**
- * gs_app_set_id:
- */
-void
-gs_app_set_id (GsApp *app, const gchar *id)
-{
- gchar *tmp;
-
- g_return_if_fail (GS_IS_APP (app));
-
- /* save this unmolested */
- g_free (app->priv->id_full);
- app->priv->id_full = g_strdup (id);
-
- /* save the short form by default */
- g_free (app->priv->id);
- app->priv->id = g_strdup (id);
- if (app->priv->id != NULL) {
- tmp = g_strrstr (app->priv->id, ".");
- if (tmp != NULL)
- *tmp = '\0';
- }
-}
-
-/**
- * gs_app_get_state:
- */
-AsAppState
-gs_app_get_state (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), AS_APP_STATE_UNKNOWN);
- return app->priv->state;
-}
-
-/**
* gs_app_set_state_internal:
*/
static gboolean
-gs_app_set_state_internal (GsApp *app, AsAppState state)
+gs_app_set_state_internal (AsApp *app, AsAppState state)
{
gboolean state_change_ok = FALSE;
- GsAppPrivate *priv = app->priv;
- if (priv->state == state)
+ if (as_app_get_state (app) == state)
return FALSE;
/* check the state change is allowed */
- switch (priv->state) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_UNKNOWN:
/* unknown has to go into one of the stable states */
if (state == AS_APP_STATE_INSTALLED ||
@@ -460,25 +382,25 @@ gs_app_set_state_internal (GsApp *app, AsAppState state)
break;
default:
g_warning ("state %s unhandled",
- as_app_state_to_string (priv->state));
+ as_app_state_to_string (as_app_get_state (app)));
g_assert_not_reached ();
}
/* this state change was unexpected */
if (!state_change_ok) {
g_warning ("State change on %s from %s to %s is not OK",
- priv->id,
- as_app_state_to_string (priv->state),
+ as_app_get_id (app),
+ as_app_state_to_string (as_app_get_state (app)),
as_app_state_to_string (state));
return FALSE;
}
- priv->state = state;
+ as_app_set_state (app, state);
if (state == AS_APP_STATE_UNKNOWN ||
state == AS_APP_STATE_AVAILABLE_LOCAL ||
state == AS_APP_STATE_AVAILABLE)
- app->priv->install_date = 0;
+ GS_APP(app)->priv->install_date = 0;
return TRUE;
}
@@ -490,7 +412,7 @@ gs_app_set_state_internal (GsApp *app, AsAppState state)
* the typical states. All applications start in state %AS_APP_STATE_UNKNOWN,
* but the frontend is not supposed to see GsApps with this state, ever.
* Backend plugins are reponsible for changing the state to one of the other
- * states before the GsApp is passed to the frontend. This is enforced by the
+ * states before the AsApp is passed to the frontend. This is enforced by the
* #GsPluginLoader.
*
* UPDATABLE --> INSTALLING --> INSTALLED
@@ -501,7 +423,7 @@ gs_app_set_state_internal (GsApp *app, AsAppState state)
* UNKNOWN --> UNAVAILABLE
*/
void
-gs_app_set_state (GsApp *app, AsAppState state)
+gs_app_set_state (AsApp *app, AsAppState state)
{
g_return_if_fail (GS_IS_APP (app));
@@ -513,10 +435,10 @@ gs_app_set_state (GsApp *app, AsAppState state)
* gs_app_get_kind:
*/
GsAppKind
-gs_app_get_kind (GsApp *app)
+gs_app_get_kind (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), GS_APP_KIND_UNKNOWN);
- return app->priv->kind;
+ return GS_APP(app)->priv->kind;
}
/**
@@ -530,10 +452,10 @@ gs_app_get_kind (GsApp *app)
* NORMAL --> SYSTEM
*/
void
-gs_app_set_kind (GsApp *app, GsAppKind kind)
+gs_app_set_kind (AsApp *app, GsAppKind kind)
{
gboolean state_change_ok = FALSE;
- GsAppPrivate *priv = app->priv;
+ GsAppPrivate *priv = GS_APP(app)->priv;
g_return_if_fail (GS_IS_APP (app));
if (priv->kind == kind)
@@ -575,7 +497,7 @@ gs_app_set_kind (GsApp *app, GsAppKind kind)
/* this state change was unexpected */
if (!state_change_ok) {
g_warning ("Kind change on %s from %s to %s is not OK",
- priv->id,
+ as_app_get_id (app),
gs_app_kind_to_string (priv->kind),
gs_app_kind_to_string (kind));
return;
@@ -586,72 +508,40 @@ gs_app_set_kind (GsApp *app, GsAppKind kind)
}
/**
- * gs_app_get_id_kind:
- */
-AsIdKind
-gs_app_get_id_kind (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), GS_APP_KIND_UNKNOWN);
- return app->priv->id_kind;
-}
-
-/**
- * gs_app_set_id_kind:
- */
-void
-gs_app_set_id_kind (GsApp *app, AsIdKind id_kind)
-{
- g_return_if_fail (GS_IS_APP (app));
- app->priv->id_kind = id_kind;
-}
-
-/**
- * gs_app_get_name:
- */
-const gchar *
-gs_app_get_name (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->name;
-}
-
-/**
* gs_app_set_name:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
* @quality: A data quality, e.g. %GS_APP_QUALITY_LOWEST
* @name: The short localized name, e.g. "Calculator"
*/
void
-gs_app_set_name (GsApp *app, GsAppQuality quality, const gchar *name)
+gs_app_set_name (AsApp *app, GsAppQuality quality, const gchar *name)
{
g_return_if_fail (GS_IS_APP (app));
/* only save this if the data is sufficiently high quality */
- if (quality < app->priv->name_quality)
+ if (quality < GS_APP(app)->priv->name_quality)
return;
- app->priv->name_quality = quality;
-
- g_free (app->priv->name);
- app->priv->name = g_strdup (name);
+ GS_APP(app)->priv->name_quality = quality;
+ as_app_set_name (app, NULL, name, -1);
}
/**
* gs_app_get_source_default:
*/
const gchar *
-gs_app_get_source_default (GsApp *app)
+gs_app_get_source_default (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- if (app->priv->sources->len == 0)
+ if (GS_APP(app)->priv->sources->len == 0)
return NULL;
- return g_ptr_array_index (app->priv->sources, 0);
+ return g_ptr_array_index (GS_APP(app)->priv->sources, 0);
}
/**
* gs_app_add_source:
*/
void
-gs_app_add_source (GsApp *app, const gchar *source)
+gs_app_add_source (AsApp *app, const gchar *source)
{
const gchar *tmp;
guint i;
@@ -659,27 +549,27 @@ gs_app_add_source (GsApp *app, const gchar *source)
g_return_if_fail (GS_IS_APP (app));
/* check source doesn't already exist */
- for (i = 0; i < app->priv->sources->len; i++) {
- tmp = g_ptr_array_index (app->priv->sources, i);
+ for (i = 0; i < GS_APP(app)->priv->sources->len; i++) {
+ tmp = g_ptr_array_index (GS_APP(app)->priv->sources, i);
if (g_strcmp0 (tmp, source) == 0)
return;
}
- g_ptr_array_add (app->priv->sources, g_strdup (source));
+ g_ptr_array_add (GS_APP(app)->priv->sources, g_strdup (source));
}
/**
* gs_app_get_sources:
*/
GPtrArray *
-gs_app_get_sources (GsApp *app)
+gs_app_get_sources (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->sources;
+ return GS_APP(app)->priv->sources;
}
/**
* gs_app_set_sources:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
* @source: The non-localized short names, e.g. ["gnome-calculator"]
*
* This name is used for the update page if the application is collected into
@@ -687,58 +577,58 @@ gs_app_get_sources (GsApp *app)
* should not be relied upon.
*/
void
-gs_app_set_sources (GsApp *app, GPtrArray *sources)
+gs_app_set_sources (AsApp *app, GPtrArray *sources)
{
g_return_if_fail (GS_IS_APP (app));
- if (app->priv->sources != NULL)
- g_ptr_array_unref (app->priv->sources);
- app->priv->sources = g_ptr_array_ref (sources);
+ if (GS_APP(app)->priv->sources != NULL)
+ g_ptr_array_unref (GS_APP(app)->priv->sources);
+ GS_APP(app)->priv->sources = g_ptr_array_ref (sources);
}
/**
* gs_app_get_source_id_default:
*/
const gchar *
-gs_app_get_source_id_default (GsApp *app)
+gs_app_get_source_id_default (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- if (app->priv->source_ids->len == 0)
+ if (GS_APP(app)->priv->source_ids->len == 0)
return NULL;
- return g_ptr_array_index (app->priv->source_ids, 0);
+ return g_ptr_array_index (GS_APP(app)->priv->source_ids, 0);
}
/**
* gs_app_get_source_ids:
*/
GPtrArray *
-gs_app_get_source_ids (GsApp *app)
+gs_app_get_source_ids (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->source_ids;
+ return GS_APP(app)->priv->source_ids;
}
/**
* gs_app_set_source_ids:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
* @source_id: The source-id, e.g. ["gnome-calculator;0.134;fedora"]
* or ["/home/hughsie/.local/share/applications/0ad.desktop"]
*
* This ID is used internally to the controlling plugin.
*/
void
-gs_app_set_source_ids (GsApp *app, GPtrArray *source_ids)
+gs_app_set_source_ids (AsApp *app, GPtrArray *source_ids)
{
g_return_if_fail (GS_IS_APP (app));
- if (app->priv->source_ids != NULL)
- g_ptr_array_unref (app->priv->source_ids);
- app->priv->source_ids = g_ptr_array_ref (source_ids);
+ if (GS_APP(app)->priv->source_ids != NULL)
+ g_ptr_array_unref (GS_APP(app)->priv->source_ids);
+ GS_APP(app)->priv->source_ids = g_ptr_array_ref (source_ids);
}
/**
* gs_app_add_source_id:
*/
void
-gs_app_add_source_id (GsApp *app, const gchar *source_id)
+gs_app_add_source_id (AsApp *app, const gchar *source_id)
{
const gchar *tmp;
guint i;
@@ -746,85 +636,37 @@ gs_app_add_source_id (GsApp *app, const gchar *source_id)
g_return_if_fail (GS_IS_APP (app));
/* only add if not already present */
- for (i = 0; i < app->priv->source_ids->len; i++) {
- tmp = g_ptr_array_index (app->priv->source_ids, i);
+ for (i = 0; i < GS_APP(app)->priv->source_ids->len; i++) {
+ tmp = g_ptr_array_index (GS_APP(app)->priv->source_ids, i);
if (g_strcmp0 (tmp, source_id) == 0)
return;
}
- g_ptr_array_add (app->priv->source_ids, g_strdup (source_id));
-}
-
-/**
- * gs_app_get_project_group:
- */
-const gchar *
-gs_app_get_project_group (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->project_group;
-}
-
-/**
- * gs_app_set_project_group:
- * @app: A #GsApp instance
- * @project_group: The non-localized project group, e.g. "GNOME" or "KDE"
- */
-void
-gs_app_set_project_group (GsApp *app, const gchar *project_group)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->project_group);
- app->priv->project_group = g_strdup (project_group);
+ g_ptr_array_add (GS_APP(app)->priv->source_ids, g_strdup (source_id));
}
/**
* gs_app_get_pixbuf:
*/
GdkPixbuf *
-gs_app_get_pixbuf (GsApp *app)
+gs_app_get_pixbuf (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->pixbuf;
-}
-
-/**
- * gs_app_get_icon:
- */
-const gchar *
-gs_app_get_icon (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->icon;
-}
-
-/**
- * gs_app_set_icon:
- */
-void
-gs_app_set_icon (GsApp *app, const gchar *icon)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_return_if_fail (icon != NULL);
-
- /* save icon */
- g_free (app->priv->icon);
- app->priv->icon = g_strdup (icon);
+ return GS_APP(app)->priv->pixbuf;
}
/**
* gs_app_load_icon:
*/
gboolean
-gs_app_load_icon (GsApp *app, GError **error)
+gs_app_load_icon (AsApp *app, GError **error)
{
GdkPixbuf *pixbuf = NULL;
gboolean ret = TRUE;
g_return_val_if_fail (GS_IS_APP (app), FALSE);
- g_return_val_if_fail (app->priv->icon != NULL, FALSE);
/* either load from the theme or from a file */
- pixbuf = gs_pixbuf_load (app->priv->icon, 64, error);
+ pixbuf = gs_pixbuf_load (as_app_get_icon (app), 64, error);
if (pixbuf == NULL) {
ret = FALSE;
goto out;
@@ -840,34 +682,34 @@ out:
* gs_app_set_pixbuf:
*/
void
-gs_app_set_pixbuf (GsApp *app, GdkPixbuf *pixbuf)
+gs_app_set_pixbuf (AsApp *app, GdkPixbuf *pixbuf)
{
g_return_if_fail (GS_IS_APP (app));
g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
- if (app->priv->pixbuf != NULL)
- g_object_unref (app->priv->pixbuf);
- app->priv->pixbuf = g_object_ref (pixbuf);
+ if (GS_APP(app)->priv->pixbuf != NULL)
+ g_object_unref (GS_APP(app)->priv->pixbuf);
+ GS_APP(app)->priv->pixbuf = g_object_ref (pixbuf);
}
/**
* gs_app_get_featured_pixbuf:
*/
GdkPixbuf *
-gs_app_get_featured_pixbuf (GsApp *app)
+gs_app_get_featured_pixbuf (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->featured_pixbuf;
+ return GS_APP(app)->priv->featured_pixbuf;
}
/**
* gs_app_set_featured_pixbuf:
*/
void
-gs_app_set_featured_pixbuf (GsApp *app, GdkPixbuf *pixbuf)
+gs_app_set_featured_pixbuf (AsApp *app, GdkPixbuf *pixbuf)
{
g_return_if_fail (GS_IS_APP (app));
- g_return_if_fail (app->priv->featured_pixbuf == NULL);
- app->priv->featured_pixbuf = g_object_ref (pixbuf);
+ g_return_if_fail (GS_APP(app)->priv->featured_pixbuf == NULL);
+ GS_APP(app)->priv->featured_pixbuf = g_object_ref (pixbuf);
}
typedef enum {
@@ -935,9 +777,9 @@ out:
* gs_app_ui_versions_invalidate:
*/
static void
-gs_app_ui_versions_invalidate (GsApp *app)
+gs_app_ui_versions_invalidate (AsApp *app)
{
- GsAppPrivate *priv = app->priv;
+ GsAppPrivate *priv = GS_APP(app)->priv;
g_free (priv->version_ui);
g_free (priv->update_version_ui);
priv->version_ui = NULL;
@@ -948,9 +790,9 @@ gs_app_ui_versions_invalidate (GsApp *app)
* gs_app_ui_versions_populate:
*/
static void
-gs_app_ui_versions_populate (GsApp *app)
+gs_app_ui_versions_populate (AsApp *app)
{
- GsAppPrivate *priv = app->priv;
+ GsAppPrivate *priv = GS_APP(app)->priv;
guint i;
guint64 flags[] = { GS_APP_VERSION_FIXUP_RELEASE |
GS_APP_VERSION_FIXUP_DISTRO_SUFFIX |
@@ -980,202 +822,133 @@ gs_app_ui_versions_populate (GsApp *app)
* gs_app_get_version:
*/
const gchar *
-gs_app_get_version (GsApp *app)
+gs_app_get_version (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->version;
+ return GS_APP(app)->priv->version;
}
/**
* gs_app_get_version_ui:
*/
const gchar *
-gs_app_get_version_ui (GsApp *app)
+gs_app_get_version_ui (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
/* work out the two version numbers */
- if (app->priv->version != NULL &&
- app->priv->version_ui == NULL) {
+ if (GS_APP(app)->priv->version != NULL &&
+ GS_APP(app)->priv->version_ui == NULL) {
gs_app_ui_versions_populate (app);
}
- return app->priv->version_ui;
+ return GS_APP(app)->priv->version_ui;
}
/**
* gs_app_set_version:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
* @version: The version, e.g. "2:1.2.3.fc19"
*
* This saves the version after stripping out any non-friendly parts, such as
* distro tags, git revisions and that kind of thing.
*/
void
-gs_app_set_version (GsApp *app, const gchar *version)
+gs_app_set_version (AsApp *app, const gchar *version)
{
g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->version);
- app->priv->version = g_strdup (version);
+ g_free (GS_APP(app)->priv->version);
+ GS_APP(app)->priv->version = g_strdup (version);
gs_app_ui_versions_invalidate (app);
gs_app_queue_notify (app, "version");
}
/**
- * gs_app_get_summary:
- */
-const gchar *
-gs_app_get_summary (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->summary;
-}
-
-/**
* gs_app_set_summary:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
* @quality: A data quality, e.g. %GS_APP_QUALITY_LOWEST
* @summary: The medium length localized name, e.g. "A graphical calculator for GNOME"
*/
void
-gs_app_set_summary (GsApp *app, GsAppQuality quality, const gchar *summary)
+gs_app_set_summary (AsApp *app, GsAppQuality quality, const gchar *summary)
{
g_return_if_fail (GS_IS_APP (app));
/* only save this if the data is sufficiently high quality */
- if (quality < app->priv->summary_quality)
+ if (quality < GS_APP(app)->priv->summary_quality)
return;
- app->priv->summary_quality = quality;
-
- g_free (app->priv->summary);
- app->priv->summary = g_strdup (summary);
-}
-
-/**
- * gs_app_get_description:
- */
-const gchar *
-gs_app_get_description (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->description;
+ GS_APP(app)->priv->summary_quality = quality;
+ as_app_set_comment (app, NULL, summary, -1);
}
/**
* gs_app_set_description:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
* @quality: A data quality, e.g. %GS_APP_QUALITY_LOWEST
* @summary: The multiline localized description, e.g. "GNOME Calculator is a graphical calculator for
GNOME....."
*/
void
-gs_app_set_description (GsApp *app, GsAppQuality quality, const gchar *description)
+gs_app_set_description (AsApp *app, GsAppQuality quality, const gchar *description)
{
g_return_if_fail (GS_IS_APP (app));
/* only save this if the data is sufficiently high quality */
- if (quality < app->priv->description_quality)
+ if (quality < GS_APP(app)->priv->description_quality)
return;
- app->priv->description_quality = quality;
-
- g_free (app->priv->description);
- app->priv->description = g_strdup (description);
-}
-
-/**
- * gs_app_get_url:
- */
-const gchar *
-gs_app_get_url (GsApp *app, const gchar *kind)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return g_hash_table_lookup (app->priv->urls, kind);
-}
-
-/**
- * gs_app_set_url:
- * @app: A #GsApp instance
- * @summary: The home page URL, e.g. "http://www.foo.com/gcalctool/"
- */
-void
-gs_app_set_url (GsApp *app, const gchar *kind, const gchar *url)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_hash_table_insert (app->priv->urls,
- g_strdup (kind),
- g_strdup (url));
-}
-
-/**
- * gs_app_get_licence:
- */
-const gchar *
-gs_app_get_licence (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->licence;
-}
-
-/**
- * gs_app_set_licence:
- */
-void
-gs_app_set_licence (GsApp *app, const gchar *licence)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->licence);
- app->priv->licence = g_strdup (licence);
+ GS_APP(app)->priv->description_quality = quality;
+ as_app_set_description (app, NULL, description, -1);
}
/**
* gs_app_get_summary_missing:
*/
const gchar *
-gs_app_get_summary_missing (GsApp *app)
+gs_app_get_summary_missing (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->summary_missing;
+ return GS_APP(app)->priv->summary_missing;
}
/**
* gs_app_set_summary_missing:
*/
void
-gs_app_set_summary_missing (GsApp *app, const gchar *summary_missing)
+gs_app_set_summary_missing (AsApp *app, const gchar *summary_missing)
{
g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->summary_missing);
- app->priv->summary_missing = g_strdup (summary_missing);
+ g_free (GS_APP(app)->priv->summary_missing);
+ GS_APP(app)->priv->summary_missing = g_strdup (summary_missing);
}
/**
* gs_app_get_menu_path:
*/
const gchar *
-gs_app_get_menu_path (GsApp *app)
+gs_app_get_menu_path (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->menu_path;
+ return GS_APP(app)->priv->menu_path;
}
/**
* gs_app_set_menu_path:
*/
void
-gs_app_set_menu_path (GsApp *app, const gchar *menu_path)
+gs_app_set_menu_path (AsApp *app, const gchar *menu_path)
{
g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->menu_path);
- app->priv->menu_path = g_strdup (menu_path);
+ g_free (GS_APP(app)->priv->menu_path);
+ GS_APP(app)->priv->menu_path = g_strdup (menu_path);
}
/**
* gs_app_get_origin:
*/
const gchar *
-gs_app_get_origin (GsApp *app)
+gs_app_get_origin (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->origin;
+ return GS_APP(app)->priv->origin;
}
/**
@@ -1185,68 +958,48 @@ gs_app_get_origin (GsApp *app)
* e.g. "Fedora"
*/
void
-gs_app_set_origin (GsApp *app, const gchar *origin)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->origin);
- app->priv->origin = g_strdup (origin);
-}
-
-/**
- * gs_app_add_screenshot:
- */
-void
-gs_app_add_screenshot (GsApp *app, AsScreenshot *screenshot)
+gs_app_set_origin (AsApp *app, const gchar *origin)
{
g_return_if_fail (GS_IS_APP (app));
- g_ptr_array_add (app->priv->screenshots, g_object_ref (screenshot));
-}
-
-/**
- * gs_app_get_screenshots:
- */
-GPtrArray *
-gs_app_get_screenshots (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->screenshots;
+ g_free (GS_APP(app)->priv->origin);
+ GS_APP(app)->priv->origin = g_strdup (origin);
}
/**
* gs_app_get_update_version:
*/
const gchar *
-gs_app_get_update_version (GsApp *app)
+gs_app_get_update_version (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->update_version;
+ return GS_APP(app)->priv->update_version;
}
/**
* gs_app_get_update_version_ui:
*/
const gchar *
-gs_app_get_update_version_ui (GsApp *app)
+gs_app_get_update_version_ui (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
/* work out the two version numbers */
- if (app->priv->update_version != NULL &&
- app->priv->update_version_ui == NULL) {
+ if (GS_APP(app)->priv->update_version != NULL &&
+ GS_APP(app)->priv->update_version_ui == NULL) {
gs_app_ui_versions_populate (app);
}
- return app->priv->update_version_ui;
+ return GS_APP(app)->priv->update_version_ui;
}
/**
* gs_app_set_update_version_internal:
*/
static void
-gs_app_set_update_version_internal (GsApp *app, const gchar *update_version)
+gs_app_set_update_version_internal (AsApp *app, const gchar *update_version)
{
- g_free (app->priv->update_version);
- app->priv->update_version = g_strdup (update_version);
+ g_free (GS_APP(app)->priv->update_version);
+ GS_APP(app)->priv->update_version = g_strdup (update_version);
gs_app_ui_versions_invalidate (app);
}
@@ -1254,7 +1007,7 @@ gs_app_set_update_version_internal (GsApp *app, const gchar *update_version)
* gs_app_set_update_version:
*/
void
-gs_app_set_update_version (GsApp *app, const gchar *update_version)
+gs_app_set_update_version (AsApp *app, const gchar *update_version)
{
g_return_if_fail (GS_IS_APP (app));
gs_app_set_update_version_internal (app, update_version);
@@ -1265,84 +1018,84 @@ gs_app_set_update_version (GsApp *app, const gchar *update_version)
* gs_app_get_update_details:
*/
const gchar *
-gs_app_get_update_details (GsApp *app)
+gs_app_get_update_details (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->update_details;
+ return GS_APP(app)->priv->update_details;
}
/**
* gs_app_set_update_details:
*/
void
-gs_app_set_update_details (GsApp *app, const gchar *update_details)
+gs_app_set_update_details (AsApp *app, const gchar *update_details)
{
g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->update_details);
- app->priv->update_details = g_strdup (update_details);
+ g_free (GS_APP(app)->priv->update_details);
+ GS_APP(app)->priv->update_details = g_strdup (update_details);
}
/**
* gs_app_get_management_plugin:
*/
const gchar *
-gs_app_get_management_plugin (GsApp *app)
+gs_app_get_management_plugin (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->management_plugin;
+ return GS_APP(app)->priv->management_plugin;
}
/**
* gs_app_set_management_plugin:
*
* The management plugin is the plugin that can handle doing install and remove
- * operations on the #GsApp. Typical values include "PackageKit" and "jhbuild"
+ * operations on the #AsApp. Typical values include "PackageKit" and "jhbuild"
*/
void
-gs_app_set_management_plugin (GsApp *app, const gchar *management_plugin)
+gs_app_set_management_plugin (AsApp *app, const gchar *management_plugin)
{
g_return_if_fail (GS_IS_APP (app));
- g_free (app->priv->management_plugin);
- app->priv->management_plugin = g_strdup (management_plugin);
+ g_free (GS_APP(app)->priv->management_plugin);
+ GS_APP(app)->priv->management_plugin = g_strdup (management_plugin);
}
/**
* gs_app_get_rating:
*/
gint
-gs_app_get_rating (GsApp *app)
+gs_app_get_rating (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), -1);
- return app->priv->rating;
+ return GS_APP(app)->priv->rating;
}
/**
* gs_app_set_rating:
*/
void
-gs_app_set_rating (GsApp *app, gint rating)
+gs_app_set_rating (AsApp *app, gint rating)
{
g_return_if_fail (GS_IS_APP (app));
- app->priv->rating = rating;
+ GS_APP(app)->priv->rating = rating;
gs_app_queue_notify (app, "rating");
}
/**
* gs_app_get_rating_confidence:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
*
* Return value: a predictor from 0 to 100, or -1 for unknown or invalid
*/
gint
-gs_app_get_rating_confidence (GsApp *app)
+gs_app_get_rating_confidence (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), -1);
- return app->priv->rating_confidence;
+ return GS_APP(app)->priv->rating_confidence;
}
/**
* gs_app_set_rating_confidence:
- * @app: A #GsApp instance
+ * @app: A #AsApp instance
* @rating_confidence: a predictor from 0 to 100, or -1 for unknown or invalid
*
* This is how confident the rating is statistically valid, expressed as a
@@ -1352,30 +1105,30 @@ gs_app_get_rating_confidence (GsApp *app)
* rated the application.
*/
void
-gs_app_set_rating_confidence (GsApp *app, gint rating_confidence)
+gs_app_set_rating_confidence (AsApp *app, gint rating_confidence)
{
g_return_if_fail (GS_IS_APP (app));
- app->priv->rating_confidence = rating_confidence;
+ GS_APP(app)->priv->rating_confidence = rating_confidence;
}
/**
* gs_app_get_rating_kind:
*/
GsAppRatingKind
-gs_app_get_rating_kind (GsApp *app)
+gs_app_get_rating_kind (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), -1);
- return app->priv->rating_kind;
+ return GS_APP(app)->priv->rating_kind;
}
/**
* gs_app_set_rating_kind:
*/
void
-gs_app_set_rating_kind (GsApp *app, GsAppRatingKind rating_kind)
+gs_app_set_rating_kind (AsApp *app, GsAppRatingKind rating_kind)
{
g_return_if_fail (GS_IS_APP (app));
- app->priv->rating_kind = rating_kind;
+ GS_APP(app)->priv->rating_kind = rating_kind;
gs_app_queue_notify (app, "rating");
}
@@ -1383,77 +1136,37 @@ gs_app_set_rating_kind (GsApp *app, GsAppRatingKind rating_kind)
* gs_app_get_size:
*/
guint64
-gs_app_get_size (GsApp *app)
+gs_app_get_size (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), G_MAXUINT64);
- return app->priv->size;
+ return GS_APP(app)->priv->size;
}
/**
* gs_app_set_size:
*/
void
-gs_app_set_size (GsApp *app, guint64 size)
+gs_app_set_size (AsApp *app, guint64 size)
{
g_return_if_fail (GS_IS_APP (app));
- app->priv->size = size;
-}
-
-/**
- * gs_app_get_metadata_item:
- */
-const gchar *
-gs_app_get_metadata_item (GsApp *app, const gchar *key)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return g_hash_table_lookup (app->priv->metadata, key);
-}
-
-/**
- * gs_app_set_metadata:
- */
-void
-gs_app_set_metadata (GsApp *app, const gchar *key, const gchar *value)
-{
- const gchar *found;
-
- g_return_if_fail (GS_IS_APP (app));
-
- /* if no value, then remove the key */
- if (value == NULL) {
- g_hash_table_remove (app->priv->metadata, key);
- return;
- }
-
- /* check we're not overwriting */
- found = g_hash_table_lookup (app->priv->metadata, key);
- if (found != NULL) {
- if (g_strcmp0 (found, value) == 0)
- return;
- g_warning ("tried overwriting key %s from %s to %s",
- key, found, value);
- return;
- }
- g_hash_table_insert (app->priv->metadata,
- g_strdup (key),
- g_strdup (value));
+ GS_APP(app)->priv->size = size;
}
/**
* gs_app_get_addons:
*/
GPtrArray *
-gs_app_get_addons (GsApp *app)
+gs_app_get_addons (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->addons;
+ return GS_APP(app)->priv->addons;
}
/**
* gs_app_add_addon:
*/
void
-gs_app_add_addon (GsApp *app, GsApp *addon)
+gs_app_add_addon (AsApp *app, AsApp *addon)
{
gpointer found;
const gchar *id;
@@ -1461,32 +1174,32 @@ gs_app_add_addon (GsApp *app, GsApp *addon)
g_return_if_fail (GS_IS_APP (app));
g_return_if_fail (GS_IS_APP (addon));
- id = gs_app_get_id (addon);
- found = g_hash_table_lookup (app->priv->addons_hash, id);
+ id = as_app_get_id (addon);
+ found = g_hash_table_lookup (GS_APP(app)->priv->addons_hash, id);
if (found != NULL) {
g_debug ("Already added %s as an addon", id);
return;
}
- g_hash_table_insert (app->priv->addons_hash, g_strdup (id), GINT_TO_POINTER (1));
+ g_hash_table_insert (GS_APP(app)->priv->addons_hash, g_strdup (id), GINT_TO_POINTER (1));
- g_ptr_array_add (app->priv->addons, g_object_ref (addon));
+ g_ptr_array_add (GS_APP(app)->priv->addons, g_object_ref (addon));
}
/**
* gs_app_get_related:
*/
GPtrArray *
-gs_app_get_related (GsApp *app)
+gs_app_get_related (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->related;
+ return GS_APP(app)->priv->related;
}
/**
* gs_app_add_related:
*/
void
-gs_app_add_related (GsApp *app, GsApp *app2)
+gs_app_add_related (AsApp *app, AsApp *app2)
{
gchar *key;
gpointer found;
@@ -1494,156 +1207,79 @@ gs_app_add_related (GsApp *app, GsApp *app2)
g_return_if_fail (GS_IS_APP (app));
key = g_strdup_printf ("%s-%s",
- gs_app_get_id_full (app2),
+ as_app_get_id_full (app2),
gs_app_get_source_default (app2));
- found = g_hash_table_lookup (app->priv->related_hash, key);
+ found = g_hash_table_lookup (GS_APP(app)->priv->related_hash, key);
if (found != NULL) {
g_debug ("Already added %s as a related item", key);
g_free (key);
return;
}
- g_hash_table_insert (app->priv->related_hash, key, GINT_TO_POINTER (1));
- g_ptr_array_add (app->priv->related, g_object_ref (app2));
+ g_hash_table_insert (GS_APP(app)->priv->related_hash, key, GINT_TO_POINTER (1));
+ g_ptr_array_add (GS_APP(app)->priv->related, g_object_ref (app2));
}
/**
* gs_app_get_history:
*/
GPtrArray *
-gs_app_get_history (GsApp *app)
+gs_app_get_history (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->history;
+ return GS_APP(app)->priv->history;
}
/**
* gs_app_add_history:
*/
void
-gs_app_add_history (GsApp *app, GsApp *app2)
+gs_app_add_history (AsApp *app, AsApp *app2)
{
g_return_if_fail (GS_IS_APP (app));
- g_ptr_array_add (app->priv->history, g_object_ref (app2));
+ g_ptr_array_add (GS_APP(app)->priv->history, g_object_ref (app2));
}
guint64
-gs_app_get_install_date (GsApp *app)
+gs_app_get_install_date (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), 0);
- return app->priv->install_date;
+ return GS_APP(app)->priv->install_date;
}
void
-gs_app_set_install_date (GsApp *app, guint64 install_date)
+gs_app_set_install_date (AsApp *app, guint64 install_date)
{
g_return_if_fail (GS_IS_APP (app));
- app->priv->install_date = install_date;
-}
-
-/**
- * gs_app_get_categories:
- */
-GPtrArray *
-gs_app_get_categories (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->categories;
-}
-
-/**
- * gs_app_has_category:
- */
-gboolean
-gs_app_has_category (GsApp *app, const gchar *category)
-{
- const gchar *tmp;
- guint i;
-
- g_return_val_if_fail (GS_IS_APP (app), FALSE);
-
- /* find the category */
- for (i = 0; i < app->priv->categories->len; i++) {
- tmp = g_ptr_array_index (app->priv->categories, i);
- if (g_strcmp0 (tmp, category) == 0)
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- * gs_app_set_categories:
- */
-void
-gs_app_set_categories (GsApp *app, GPtrArray *categories)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_return_if_fail (categories != NULL);
- if (app->priv->categories != NULL)
- g_ptr_array_unref (app->priv->categories);
- app->priv->categories = g_ptr_array_ref (categories);
-}
-
-/**
- * gs_app_add_category:
- */
-void
-gs_app_add_category (GsApp *app, const gchar *category)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_return_if_fail (category != NULL);
- g_ptr_array_add (app->priv->categories, g_strdup (category));
-}
-
-/**
- * gs_app_get_keywords:
- */
-GPtrArray *
-gs_app_get_keywords (GsApp *app)
-{
- g_return_val_if_fail (GS_IS_APP (app), NULL);
- return app->priv->keywords;
-}
-
-/**
- * gs_app_set_keywords:
- */
-void
-gs_app_set_keywords (GsApp *app, GPtrArray *keywords)
-{
- g_return_if_fail (GS_IS_APP (app));
- g_return_if_fail (keywords != NULL);
- if (app->priv->keywords != NULL)
- g_ptr_array_unref (app->priv->keywords);
- app->priv->keywords = g_ptr_array_ref (keywords);
+ GS_APP(app)->priv->install_date = install_date;
}
/**
* gs_app_add_kudo:
*/
void
-gs_app_add_kudo (GsApp *app, GsAppKudo kudo)
+gs_app_add_kudo (AsApp *app, GsAppKudo kudo)
{
g_return_if_fail (GS_IS_APP (app));
- app->priv->kudos |= kudo;
+ GS_APP(app)->priv->kudos |= kudo;
}
/**
* gs_app_get_kudos:
*/
guint64
-gs_app_get_kudos (GsApp *app)
+gs_app_get_kudos (AsApp *app)
{
g_return_val_if_fail (GS_IS_APP (app), 0);
- return app->priv->kudos;
+ return GS_APP(app)->priv->kudos;
}
/**
* gs_app_get_kudos_weight:
*/
guint
-gs_app_get_kudos_weight (GsApp *app)
+gs_app_get_kudos_weight (AsApp *app)
{
- guint32 tmp = app->priv->kudos;
+ guint32 tmp = GS_APP(app)->priv->kudos;
tmp = tmp - ((tmp >> 1) & 0x55555555);
tmp = (tmp & 0x33333333) + ((tmp >> 2) & 0x33333333);
return (((tmp + (tmp >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
@@ -1653,37 +1289,37 @@ gs_app_get_kudos_weight (GsApp *app)
* gs_app_get_kudos_percentage:
*/
guint
-gs_app_get_kudos_percentage (GsApp *app)
+gs_app_get_kudos_percentage (AsApp *app)
{
guint percentage = 0;
g_return_val_if_fail (GS_IS_APP (app), 0);
- if ((app->priv->kudos & GS_APP_KUDO_MY_LANGUAGE) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_MY_LANGUAGE) > 0)
percentage += 20;
- if ((app->priv->kudos & GS_APP_KUDO_RECENT_RELEASE) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_RECENT_RELEASE) > 0)
percentage += 20;
- if ((app->priv->kudos & GS_APP_KUDO_FEATURED_RECOMMENDED) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_FEATURED_RECOMMENDED) > 0)
percentage += 20;
- if ((app->priv->kudos & GS_APP_KUDO_MODERN_TOOLKIT) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_MODERN_TOOLKIT) > 0)
percentage += 20;
- if ((app->priv->kudos & GS_APP_KUDO_SEARCH_PROVIDER) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_SEARCH_PROVIDER) > 0)
percentage += 10;
- if ((app->priv->kudos & GS_APP_KUDO_INSTALLS_USER_DOCS) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_INSTALLS_USER_DOCS) > 0)
percentage += 10;
- if ((app->priv->kudos & GS_APP_KUDO_USES_NOTIFICATIONS) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_USES_NOTIFICATIONS) > 0)
percentage += 20;
- if ((app->priv->kudos & GS_APP_KUDO_HAS_KEYWORDS) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_HAS_KEYWORDS) > 0)
percentage += 5;
- if ((app->priv->kudos & GS_APP_KUDO_USES_APP_MENU) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_USES_APP_MENU) > 0)
percentage += 10;
- if ((app->priv->kudos & GS_APP_KUDO_HAS_SCREENSHOTS) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_HAS_SCREENSHOTS) > 0)
percentage += 20;
- if ((app->priv->kudos & GS_APP_KUDO_IBUS_HAS_SYMBOL) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_IBUS_HAS_SYMBOL) > 0)
percentage += 20;
/* popular apps should be at *least* 50% */
- if ((app->priv->kudos & GS_APP_KUDO_POPULAR) > 0)
+ if ((GS_APP(app)->priv->kudos & GS_APP_KUDO_POPULAR) > 0)
percentage = MAX (percentage, 50);
return MIN (percentage, 100);
@@ -1693,9 +1329,9 @@ gs_app_get_kudos_percentage (GsApp *app)
* gs_app_get_to_be_installed:
*/
gboolean
-gs_app_get_to_be_installed (GsApp *app)
+gs_app_get_to_be_installed (AsApp *app)
{
- GsAppPrivate *priv = app->priv;
+ GsAppPrivate *priv = GS_APP(app)->priv;
return priv->to_be_installed;
}
@@ -1703,9 +1339,9 @@ gs_app_get_to_be_installed (GsApp *app)
* gs_app_set_to_be_installed:
*/
void
-gs_app_set_to_be_installed (GsApp *app, gboolean to_be_installed)
+gs_app_set_to_be_installed (AsApp *app, gboolean to_be_installed)
{
- GsAppPrivate *priv = app->priv;
+ GsAppPrivate *priv = GS_APP(app)->priv;
priv->to_be_installed = to_be_installed;
}
@@ -1718,14 +1354,14 @@ gs_app_set_to_be_installed (GsApp *app, gboolean to_be_installed)
* are not sent.
**/
void
-gs_app_subsume (GsApp *app, GsApp *other)
-{
- const gchar *tmp;
- GList *keys;
- GList *l;
- GsApp *app_tmp;
- GsAppPrivate *priv2 = other->priv;
- GsAppPrivate *priv = app->priv;
+gs_app_subsume (AsApp *app, AsApp *other)
+{
+// const gchar *tmp;
+// GList *keys;
+// GList *l;
+ AsApp *app_tmp;
+ GsAppPrivate *priv2 = GS_APP(other)->priv;
+ GsAppPrivate *priv = GS_APP(app)->priv;
guint i;
g_return_if_fail (GS_IS_APP (app));
@@ -1733,8 +1369,8 @@ gs_app_subsume (GsApp *app, GsApp *other)
/* an [updatable] installable package is more information than
* just the fact that something is installed */
- if (priv2->state == AS_APP_STATE_UPDATABLE &&
- priv->state == AS_APP_STATE_INSTALLED) {
+ if (as_app_get_state (other) == AS_APP_STATE_UPDATABLE &&
+ as_app_get_state (app) == AS_APP_STATE_INSTALLED) {
/* we have to do the little dance to appease the
* angry gnome controlling the state-machine */
gs_app_set_state_internal (app, AS_APP_STATE_UNKNOWN);
@@ -1744,26 +1380,26 @@ gs_app_subsume (GsApp *app, GsApp *other)
/* save any properties we already know */
if (priv2->sources->len > 0)
gs_app_set_sources (app, priv2->sources);
- if (priv2->project_group != NULL)
- gs_app_set_project_group (app, priv2->project_group);
- if (priv2->name != NULL)
- gs_app_set_name (app, priv2->name_quality, priv2->name);
- if (priv2->summary != NULL)
- gs_app_set_summary (app, priv2->summary_quality, priv2->summary);
- if (priv2->description != NULL)
- gs_app_set_description (app, priv2->description_quality, priv2->description);
+// if (priv2->project_group != NULL)
+// as_app_set_project_group (app, priv2->project_group, -1);
+// if (priv2->name != NULL)
+// gs_app_set_name (app, priv2->name_quality, priv2->name);
+// if (priv2->summary != NULL)
+// gs_app_set_summary (app, priv2->summary_quality, priv2->summary);
+// if (priv2->description != NULL)
+// gs_app_set_description (app, priv2->description_quality, priv2->description);
if (priv2->update_details != NULL)
gs_app_set_update_details (app, priv2->update_details);
if (priv2->update_version != NULL)
gs_app_set_update_version_internal (app, priv2->update_version);
if (priv2->pixbuf != NULL)
gs_app_set_pixbuf (app, priv2->pixbuf);
- if (priv->categories != priv2->categories) {
- for (i = 0; i < priv2->categories->len; i++) {
- tmp = g_ptr_array_index (priv2->categories, i);
- gs_app_add_category (app, tmp);
- }
- }
+// if (priv->categories != priv2->categories) {
+// for (i = 0; i < priv2->categories->len; i++) {
+// tmp = g_ptr_array_index (priv2->categories, i);
+// as_app_has_category (app, tmp);
+// }
+// }
for (i = 0; i < priv2->related->len; i++) {
app_tmp = g_ptr_array_index (priv2->related, i);
gs_app_add_related (app, app_tmp);
@@ -1772,15 +1408,17 @@ gs_app_subsume (GsApp *app, GsApp *other)
/* copy metadata from @other to @app unless the app already has a key
* of that name */
- keys = g_hash_table_get_keys (priv2->metadata);
- for (l = keys; l != NULL; l = l->next) {
- tmp = g_hash_table_lookup (priv->metadata, l->data);
- if (tmp != NULL)
- continue;
- tmp = g_hash_table_lookup (priv2->metadata, l->data);
- gs_app_set_metadata (app, l->data, tmp);
- }
- g_list_free (keys);
+// keys = g_hash_table_get_keys (priv2->metadata);
+// for (l = keys; l != NULL; l = l->next) {
+// tmp = g_hash_table_lookup (as_app_get_metadata (app), l->data);
+// if (tmp != NULL)
+// continue;
+// tmp = g_hash_table_lookup (priv2->metadata, l->data);
+// as_app_add_metadata (app, l->data, tmp, -1);
+// }
+// g_list_free (keys);
+
+ as_app_subsume (app, other);
}
/**
@@ -1789,24 +1427,24 @@ gs_app_subsume (GsApp *app, GsApp *other)
static void
gs_app_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
- GsApp *app = GS_APP (object);
- GsAppPrivate *priv = app->priv;
+ AsApp *app = AS_APP (object);
+ GsAppPrivate *priv = GS_APP(app)->priv;
switch (prop_id) {
case PROP_ID:
- g_value_set_string (value, priv->id);
+ g_value_set_string (value, as_app_get_id (app));
break;
case PROP_NAME:
- g_value_set_string (value, priv->name);
+ g_value_set_string (value, as_app_get_name (app, NULL));
break;
case PROP_VERSION:
g_value_set_string (value, priv->version);
break;
case PROP_SUMMARY:
- g_value_set_string (value, priv->summary);
+ g_value_set_string (value, as_app_get_comment (app, NULL));
break;
case PROP_DESCRIPTION:
- g_value_set_string (value, priv->description);
+ g_value_set_string (value, as_app_get_description (app, NULL));
break;
case PROP_RATING:
g_value_set_uint (value, priv->rating);
@@ -1815,7 +1453,7 @@ gs_app_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *
g_value_set_uint (value, priv->kind);
break;
case PROP_STATE:
- g_value_set_uint (value, priv->state);
+ g_value_set_uint (value, as_app_get_state (app));
break;
case PROP_INSTALL_DATE:
g_value_set_uint64 (value, priv->install_date);
@@ -1832,11 +1470,11 @@ gs_app_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *
static void
gs_app_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
- GsApp *app = GS_APP (object);
+ AsApp *app = AS_APP (object);
switch (prop_id) {
case PROP_ID:
- gs_app_set_id (app, g_value_get_string (value));
+ as_app_set_id_full (app, g_value_get_string (value), -1);
break;
case PROP_NAME:
gs_app_set_name (app,
@@ -1888,7 +1526,7 @@ gs_app_class_init (GsAppClass *klass)
object_class->set_property = gs_app_set_property;
/**
- * GsApp:id:
+ * AsApp:id:
*/
pspec = g_param_spec_string ("id", NULL, NULL,
NULL,
@@ -1896,7 +1534,7 @@ gs_app_class_init (GsAppClass *klass)
g_object_class_install_property (object_class, PROP_ID, pspec);
/**
- * GsApp:name:
+ * AsApp:name:
*/
pspec = g_param_spec_string ("name", NULL, NULL,
NULL,
@@ -1904,7 +1542,7 @@ gs_app_class_init (GsAppClass *klass)
g_object_class_install_property (object_class, PROP_NAME, pspec);
/**
- * GsApp:version:
+ * AsApp:version:
*/
pspec = g_param_spec_string ("version", NULL, NULL,
NULL,
@@ -1912,7 +1550,7 @@ gs_app_class_init (GsAppClass *klass)
g_object_class_install_property (object_class, PROP_VERSION, pspec);
/**
- * GsApp:summary:
+ * AsApp:summary:
*/
pspec = g_param_spec_string ("summary", NULL, NULL,
NULL,
@@ -1925,7 +1563,7 @@ gs_app_class_init (GsAppClass *klass)
g_object_class_install_property (object_class, PROP_DESCRIPTION, pspec);
/**
- * GsApp:rating:
+ * AsApp:rating:
*/
pspec = g_param_spec_int ("rating", NULL, NULL,
-1, 100, -1,
@@ -1933,7 +1571,7 @@ gs_app_class_init (GsAppClass *klass)
g_object_class_install_property (object_class, PROP_RATING, pspec);
/**
- * GsApp:kind:
+ * AsApp:kind:
*/
pspec = g_param_spec_uint ("kind", NULL, NULL,
GS_APP_KIND_UNKNOWN,
@@ -1943,7 +1581,7 @@ gs_app_class_init (GsAppClass *klass)
g_object_class_install_property (object_class, PROP_KIND, pspec);
/**
- * GsApp:state:
+ * AsApp:state:
*/
pspec = g_param_spec_uint ("state", NULL, NULL,
AS_APP_STATE_UNKNOWN,
@@ -1970,15 +1608,9 @@ gs_app_init (GsApp *app)
app->priv->rating_kind = GS_APP_RATING_KIND_UNKNOWN;
app->priv->sources = g_ptr_array_new_with_free_func (g_free);
app->priv->source_ids = g_ptr_array_new_with_free_func (g_free);
- app->priv->categories = g_ptr_array_new_with_free_func (g_free);
app->priv->addons = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
app->priv->related = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
app->priv->history = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
- app->priv->screenshots = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
- app->priv->metadata = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_free);
app->priv->addons_hash = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
@@ -1987,10 +1619,6 @@ gs_app_init (GsApp *app)
g_str_equal,
g_free,
NULL);
- app->priv->urls = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_free);
}
/**
@@ -2003,28 +1631,17 @@ gs_app_finalize (GObject *object)
GsApp *app = GS_APP (object);
GsAppPrivate *priv = app->priv;
- g_free (priv->id);
- g_free (priv->id_full);
- g_free (priv->name);
- g_hash_table_unref (priv->urls);
- g_free (priv->icon);
- g_free (priv->licence);
g_free (priv->menu_path);
g_free (priv->origin);
g_ptr_array_unref (priv->sources);
g_ptr_array_unref (priv->source_ids);
- g_free (priv->project_group);
g_free (priv->version);
g_free (priv->version_ui);
- g_free (priv->summary);
g_free (priv->summary_missing);
- g_free (priv->description);
- g_ptr_array_unref (priv->screenshots);
g_free (priv->update_version);
g_free (priv->update_version_ui);
g_free (priv->update_details);
g_free (priv->management_plugin);
- g_hash_table_unref (priv->metadata);
g_hash_table_unref (priv->addons_hash);
g_ptr_array_unref (priv->addons);
g_hash_table_unref (priv->related_hash);
@@ -2034,9 +1651,6 @@ gs_app_finalize (GObject *object)
g_object_unref (priv->pixbuf);
if (priv->featured_pixbuf != NULL)
g_object_unref (priv->featured_pixbuf);
- g_ptr_array_unref (priv->categories);
- if (priv->keywords != NULL)
- g_ptr_array_unref (priv->keywords);
G_OBJECT_CLASS (gs_app_parent_class)->finalize (object);
}
@@ -2044,16 +1658,16 @@ gs_app_finalize (GObject *object)
/**
* gs_app_new:
*
- * Return value: a new GsApp object.
+ * Return value: a new AsApp object.
**/
-GsApp *
+AsApp *
gs_app_new (const gchar *id)
{
- GsApp *app;
+ AsApp *app;
app = g_object_new (GS_TYPE_APP,
"id", id,
NULL);
- return GS_APP (app);
+ return AS_APP (app);
}
/* vim: set noexpandtab: */
diff --git a/src/gs-app.h b/src/gs-app.h
index b88aa4c..94eea03 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -33,20 +33,18 @@ G_BEGIN_DECLS
#define GS_APP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_APP, GsAppClass))
#define GS_IS_APP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_APP))
#define GS_IS_APP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_APP))
-#define GS_APP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_APP, GsAppClass))
-#define GS_APP_ERROR (gs_app_error_quark ())
typedef struct GsAppPrivate GsAppPrivate;
typedef struct
{
- GObject parent;
+ AsApp parent;
GsAppPrivate *priv;
} GsApp;
typedef struct
{
- GObjectClass parent_class;
+ AsAppClass parent_class;
} GsAppClass;
typedef enum {
@@ -95,9 +93,6 @@ typedef enum {
#define GS_APP_SIZE_UNKNOWN 0
#define GS_APP_SIZE_MISSING 1
-#define GS_APP_URL_KIND_HOMEPAGE "homepage"
-#define GS_APP_URL_KIND_MISSING "missing"
-
typedef enum {
GS_APP_QUALITY_UNKNOWN,
GS_APP_QUALITY_LOWEST,
@@ -108,147 +103,103 @@ typedef enum {
#define GS_APP_KUDOS_WEIGHT_TO_PERCENTAGE(w) (w * 20)
-GQuark gs_app_error_quark (void);
GType gs_app_get_type (void);
-GsApp *gs_app_new (const gchar *id);
-gchar *gs_app_to_string (GsApp *app);
+AsApp *gs_app_new (const gchar *id);
+gchar *gs_app_to_string (AsApp *app);
const gchar *gs_app_kind_to_string (GsAppKind kind);
-void gs_app_subsume (GsApp *app,
- GsApp *other);
+void gs_app_subsume (AsApp *app,
+ AsApp *other);
-const gchar *gs_app_get_id (GsApp *app);
-const gchar *gs_app_get_id_full (GsApp *app);
-void gs_app_set_id (GsApp *app,
- const gchar *id);
-GsAppKind gs_app_get_kind (GsApp *app);
-void gs_app_set_kind (GsApp *app,
+GsAppKind gs_app_get_kind (AsApp *app);
+void gs_app_set_kind (AsApp *app,
GsAppKind kind);
-AsIdKind gs_app_get_id_kind (GsApp *app);
-void gs_app_set_id_kind (GsApp *app,
- AsIdKind id_kind);
-AsAppState gs_app_get_state (GsApp *app);
-void gs_app_set_state (GsApp *app,
+void gs_app_set_state (AsApp *app,
AsAppState state);
-const gchar *gs_app_get_name (GsApp *app);
-void gs_app_set_name (GsApp *app,
+void gs_app_set_name (AsApp *app,
GsAppQuality quality,
const gchar *name);
-const gchar *gs_app_get_source_default (GsApp *app);
-void gs_app_add_source (GsApp *app,
+const gchar *gs_app_get_source_default (AsApp *app);
+void gs_app_add_source (AsApp *app,
const gchar *source);
-GPtrArray *gs_app_get_sources (GsApp *app);
-void gs_app_set_sources (GsApp *app,
+GPtrArray *gs_app_get_sources (AsApp *app);
+void gs_app_set_sources (AsApp *app,
GPtrArray *sources);
-const gchar *gs_app_get_source_id_default (GsApp *app);
-void gs_app_add_source_id (GsApp *app,
+const gchar *gs_app_get_source_id_default (AsApp *app);
+void gs_app_add_source_id (AsApp *app,
const gchar *source_id);
-GPtrArray *gs_app_get_source_ids (GsApp *app);
-void gs_app_set_source_ids (GsApp *app,
+GPtrArray *gs_app_get_source_ids (AsApp *app);
+void gs_app_set_source_ids (AsApp *app,
GPtrArray *source_ids);
-const gchar *gs_app_get_project_group (GsApp *app);
-void gs_app_set_project_group (GsApp *app,
- const gchar *source);
-const gchar *gs_app_get_version (GsApp *app);
-const gchar *gs_app_get_version_ui (GsApp *app);
-void gs_app_set_version (GsApp *app,
+const gchar *gs_app_get_version (AsApp *app);
+const gchar *gs_app_get_version_ui (AsApp *app);
+void gs_app_set_version (AsApp *app,
const gchar *version);
-const gchar *gs_app_get_summary (GsApp *app);
-void gs_app_set_summary (GsApp *app,
+void gs_app_set_summary (AsApp *app,
GsAppQuality quality,
const gchar *summary);
-const gchar *gs_app_get_summary_missing (GsApp *app);
-void gs_app_set_summary_missing (GsApp *app,
+const gchar *gs_app_get_summary_missing (AsApp *app);
+void gs_app_set_summary_missing (AsApp *app,
const gchar *missing);
-const gchar *gs_app_get_description (GsApp *app);
-void gs_app_set_description (GsApp *app,
+void gs_app_set_description (AsApp *app,
GsAppQuality quality,
const gchar *description);
-const gchar *gs_app_get_url (GsApp *app,
- const gchar *kind);
-void gs_app_set_url (GsApp *app,
- const gchar *kind,
- const gchar *url);
-const gchar *gs_app_get_licence (GsApp *app);
-void gs_app_set_licence (GsApp *app,
- const gchar *licence);
-const gchar *gs_app_get_menu_path (GsApp *app);
-void gs_app_set_menu_path (GsApp *app,
+const gchar *gs_app_get_menu_path (AsApp *app);
+void gs_app_set_menu_path (AsApp *app,
const gchar *menu_path);
-const gchar *gs_app_get_origin (GsApp *app);
-void gs_app_set_origin (GsApp *app,
+const gchar *gs_app_get_origin (AsApp *app);
+void gs_app_set_origin (AsApp *app,
const gchar *origin);
-GPtrArray *gs_app_get_screenshots (GsApp *app);
-void gs_app_add_screenshot (GsApp *app,
- AsScreenshot *screenshot);
-const gchar *gs_app_get_update_version (GsApp *app);
-const gchar *gs_app_get_update_version_ui (GsApp *app);
-void gs_app_set_update_version (GsApp *app,
+const gchar *gs_app_get_update_version (AsApp *app);
+const gchar *gs_app_get_update_version_ui (AsApp *app);
+void gs_app_set_update_version (AsApp *app,
const gchar *update_version);
-const gchar *gs_app_get_update_details (GsApp *app);
-void gs_app_set_update_details (GsApp *app,
+const gchar *gs_app_get_update_details (AsApp *app);
+void gs_app_set_update_details (AsApp *app,
const gchar *update_details);
-const gchar *gs_app_get_management_plugin (GsApp *app);
-void gs_app_set_management_plugin (GsApp *app,
+const gchar *gs_app_get_management_plugin (AsApp *app);
+void gs_app_set_management_plugin (AsApp *app,
const gchar *management_plugin);
-GdkPixbuf *gs_app_get_pixbuf (GsApp *app);
-void gs_app_set_pixbuf (GsApp *app,
+GdkPixbuf *gs_app_get_pixbuf (AsApp *app);
+void gs_app_set_pixbuf (AsApp *app,
GdkPixbuf *pixbuf);
-const gchar *gs_app_get_icon (GsApp *app);
-void gs_app_set_icon (GsApp *app,
- const gchar *icon);
-gboolean gs_app_load_icon (GsApp *app,
+gboolean gs_app_load_icon (AsApp *app,
GError **error);
-GdkPixbuf *gs_app_get_featured_pixbuf (GsApp *app);
-void gs_app_set_featured_pixbuf (GsApp *app,
+GdkPixbuf *gs_app_get_featured_pixbuf (AsApp *app);
+void gs_app_set_featured_pixbuf (AsApp *app,
GdkPixbuf *pixbuf);
-const gchar *gs_app_get_metadata_item (GsApp *app,
- const gchar *key);
-void gs_app_set_metadata (GsApp *app,
- const gchar *key,
- const gchar *value);
-gint gs_app_get_rating (GsApp *app);
-void gs_app_set_rating (GsApp *app,
+gint gs_app_get_rating (AsApp *app);
+void gs_app_set_rating (AsApp *app,
gint rating);
-gint gs_app_get_rating_confidence (GsApp *app);
-void gs_app_set_rating_confidence (GsApp *app,
+gint gs_app_get_rating_confidence (AsApp *app);
+void gs_app_set_rating_confidence (AsApp *app,
gint rating_confidence);
-GsAppRatingKind gs_app_get_rating_kind (GsApp *app);
-void gs_app_set_rating_kind (GsApp *app,
+GsAppRatingKind gs_app_get_rating_kind (AsApp *app);
+void gs_app_set_rating_kind (AsApp *app,
GsAppRatingKind rating_kind);
-guint64 gs_app_get_size (GsApp *app);
-void gs_app_set_size (GsApp *app,
+guint64 gs_app_get_size (AsApp *app);
+void gs_app_set_size (AsApp *app,
guint64 size);
-GPtrArray *gs_app_get_addons (GsApp *app);
-void gs_app_add_addon (GsApp *app,
- GsApp *addon);
-GPtrArray *gs_app_get_related (GsApp *app);
-void gs_app_add_related (GsApp *app,
- GsApp *app2);
-GPtrArray *gs_app_get_history (GsApp *app);
-void gs_app_add_history (GsApp *app,
- GsApp *app2);
-guint64 gs_app_get_install_date (GsApp *app);
-void gs_app_set_install_date (GsApp *app,
+GPtrArray *gs_app_get_addons (AsApp *app);
+void gs_app_add_addon (AsApp *app,
+ AsApp *addon);
+GPtrArray *gs_app_get_related (AsApp *app);
+void gs_app_add_related (AsApp *app,
+ AsApp *app2);
+GPtrArray *gs_app_get_history (AsApp *app);
+void gs_app_add_history (AsApp *app,
+ AsApp *app2);
+guint64 gs_app_get_install_date (AsApp *app);
+void gs_app_set_install_date (AsApp *app,
guint64 install_date);
-GPtrArray *gs_app_get_categories (GsApp *app);
-void gs_app_set_categories (GsApp *app,
- GPtrArray *categories);
-gboolean gs_app_has_category (GsApp *app,
- const gchar *category);
-void gs_app_add_category (GsApp *app,
- const gchar *category);
-GPtrArray *gs_app_get_keywords (GsApp *app);
-void gs_app_set_keywords (GsApp *app,
- GPtrArray *keywords);
-void gs_app_add_kudo (GsApp *app,
+void gs_app_add_kudo (AsApp *app,
GsAppKudo kudo);
-guint64 gs_app_get_kudos (GsApp *app);
-guint gs_app_get_kudos_weight (GsApp *app);
-guint gs_app_get_kudos_percentage (GsApp *app);
-gboolean gs_app_get_to_be_installed (GsApp *app);
-void gs_app_set_to_be_installed (GsApp *app,
+guint64 gs_app_get_kudos (AsApp *app);
+guint gs_app_get_kudos_weight (AsApp *app);
+guint gs_app_get_kudos_percentage (AsApp *app);
+gboolean gs_app_get_to_be_installed (AsApp *app);
+void gs_app_set_to_be_installed (AsApp *app,
gboolean to_be_installed);
G_END_DECLS
diff --git a/src/gs-category.c b/src/gs-category.c
index 70ba1a3..4c26a78 100644
--- a/src/gs-category.c
+++ b/src/gs-category.c
@@ -116,7 +116,7 @@ gs_category_get_parent (GsCategory *category)
/**
* gs_category_get_subcategories:
*
- * Return value: (element-type GsApp) (transfer container): A list of subcategories
+ * Return value: (element-type AsApp) (transfer container): A list of subcategories
**/
GList *
gs_category_get_subcategories (GsCategory *category)
diff --git a/src/gs-cmd.c b/src/gs-cmd.c
index e9288fd..4d5fd96 100644
--- a/src/gs-cmd.c
+++ b/src/gs-cmd.c
@@ -37,19 +37,19 @@ gs_cmd_show_results_apps (GList *list)
{
GList *l;
GPtrArray *related;
- GsApp *app;
- GsApp *app_rel;
+ AsApp *app;
+ AsApp *app_rel;
gchar *tmp;
guint i;
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
tmp = gs_app_to_string (app);
g_print ("%s\n", tmp);
g_free (tmp);
related = gs_app_get_related (app);
for (i = 0; i < related->len; i++) {
- app_rel = GS_APP (g_ptr_array_index (related, i));
+ app_rel = AS_APP (g_ptr_array_index (related, i));
tmp = gs_app_to_string (app_rel);
g_print ("\t%s\n", tmp);
g_free (tmp);
@@ -181,7 +181,7 @@ main (int argc, char **argv)
GList *list = NULL;
GList *categories = NULL;
GOptionContext *context;
- GsApp *app = NULL;
+ AsApp *app = NULL;
GsCategory *parent = NULL;
GsCategory *category = NULL;
GsPluginLoader *plugin_loader = NULL;
diff --git a/src/gs-feature-tile.c b/src/gs-feature-tile.c
index c0ef2c5..7e59157 100644
--- a/src/gs-feature-tile.c
+++ b/src/gs-feature-tile.c
@@ -28,7 +28,7 @@
struct _GsFeatureTilePrivate
{
- GsApp *app;
+ AsApp *app;
GtkWidget *button;
GtkWidget *image;
GtkWidget *title;
@@ -46,7 +46,7 @@ enum {
static guint signals [SIGNAL_LAST] = { 0 };
-GsApp *
+AsApp *
gs_feature_tile_get_app (GsFeatureTile *tile)
{
GsFeatureTilePrivate *priv;
@@ -58,7 +58,7 @@ gs_feature_tile_get_app (GsFeatureTile *tile)
}
static void
-app_state_changed (GsApp *app, GParamSpec *pspec, GsFeatureTile *tile)
+app_state_changed (AsApp *app, GParamSpec *pspec, GsFeatureTile *tile)
{
GsFeatureTilePrivate *priv;
AtkObject *accessible;
@@ -67,34 +67,34 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsFeatureTile *tile)
priv = gs_feature_tile_get_instance_private (tile);
accessible = gtk_widget_get_accessible (priv->button);
- switch (gs_app_get_state (app)) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_INSTALLED:
case AS_APP_STATE_INSTALLING:
case AS_APP_STATE_REMOVING:
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Installed"));
break;
case AS_APP_STATE_UPDATABLE:
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Updates"));
break;
case AS_APP_STATE_AVAILABLE:
default:
- name = g_strdup (gs_app_get_name (app));
+ name = g_strdup (as_app_get_name (app, NULL));
break;
}
if (GTK_IS_ACCESSIBLE (accessible)) {
atk_object_set_name (accessible, name);
- atk_object_set_description (accessible, gs_app_get_summary (app));
+ atk_object_set_description (accessible, as_app_get_comment (app, NULL));
}
g_free (name);
}
void
-gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
+gs_feature_tile_set_app (GsFeatureTile *tile, AsApp *app)
{
GsFeatureTilePrivate *priv;
GString *data = NULL;
@@ -121,21 +121,21 @@ gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
G_CALLBACK (app_state_changed), tile);
app_state_changed (priv->app, NULL, tile);
- gtk_label_set_label (GTK_LABEL (priv->title), gs_app_get_name (app));
- gtk_label_set_label (GTK_LABEL (priv->subtitle), gs_app_get_summary (app));
+ gtk_label_set_label (GTK_LABEL (priv->title), as_app_get_name (app, NULL));
+ gtk_label_set_label (GTK_LABEL (priv->subtitle), as_app_get_comment (app, NULL));
/* check the app has the featured data */
- text_color = gs_app_get_metadata_item (app, "Featured::text-color");
+ text_color = as_app_get_metadata_item (app, "Featured::text-color");
if (text_color == NULL) {
tmp = gs_app_to_string (app);
g_warning ("%s has no featured data: %s",
- gs_app_get_id (app), tmp);
+ as_app_get_id (app), tmp);
g_free (tmp);
goto out;
}
- background = gs_app_get_metadata_item (app, "Featured::background");
- stroke_color = gs_app_get_metadata_item (app, "Featured::stroke-color");
- text_shadow = gs_app_get_metadata_item (app, "Featured::text-shadow");
+ background = as_app_get_metadata_item (app, "Featured::background");
+ stroke_color = as_app_get_metadata_item (app, "Featured::stroke-color");
+ text_shadow = as_app_get_metadata_item (app, "Featured::text-shadow");
data = g_string_sized_new (1024);
g_string_append (data, ".button.featured-tile {\n");
@@ -233,7 +233,7 @@ gs_feature_tile_class_init (GsFeatureTileClass *klass)
}
GtkWidget *
-gs_feature_tile_new (GsApp *app)
+gs_feature_tile_new (AsApp *app)
{
GsFeatureTile *tile;
diff --git a/src/gs-feature-tile.h b/src/gs-feature-tile.h
index e8239b0..0972837 100644
--- a/src/gs-feature-tile.h
+++ b/src/gs-feature-tile.h
@@ -53,10 +53,10 @@ struct _GsFeatureTileClass
};
GType gs_feature_tile_get_type (void);
-GtkWidget *gs_feature_tile_new (GsApp *app);
-GsApp *gs_feature_tile_get_app (GsFeatureTile *tile);
+GtkWidget *gs_feature_tile_new (AsApp *app);
+AsApp *gs_feature_tile_get_app (GsFeatureTile *tile);
void gs_feature_tile_set_app (GsFeatureTile *tile,
- GsApp *app);
+ AsApp *app);
G_END_DECLS
diff --git a/src/gs-history-dialog.c b/src/gs-history-dialog.c
index 8533f44..7c7bf42 100644
--- a/src/gs-history-dialog.c
+++ b/src/gs-history-dialog.c
@@ -30,7 +30,7 @@
struct _GsHistoryDialogPrivate
{
- GsApp *app;
+ AsApp *app;
GtkSizeGroup *sizegroup_state;
GtkSizeGroup *sizegroup_timestamp;
GtkSizeGroup *sizegroup_version;
@@ -43,8 +43,8 @@ G_DEFINE_TYPE_WITH_PRIVATE (GsHistoryDialog, gs_history_dialog, GTK_TYPE_DIALOG)
static gint
history_sort_cb (gconstpointer a, gconstpointer b)
{
- gint64 timestamp_a = gs_app_get_install_date (*(GsApp **) a);
- gint64 timestamp_b = gs_app_get_install_date (*(GsApp **) b);
+ gint64 timestamp_a = gs_app_get_install_date (*(AsApp **) a);
+ gint64 timestamp_b = gs_app_get_install_date (*(AsApp **) b);
if (timestamp_a < timestamp_b)
return 1;
if (timestamp_a > timestamp_b)
@@ -53,7 +53,7 @@ history_sort_cb (gconstpointer a, gconstpointer b)
}
void
-gs_history_dialog_set_app (GsHistoryDialog *dialog, GsApp *app)
+gs_history_dialog_set_app (GsHistoryDialog *dialog, AsApp *app)
{
GsHistoryDialogPrivate *priv = gs_history_dialog_get_instance_private (dialog);
const gchar *tmp;
@@ -74,7 +74,7 @@ gs_history_dialog_set_app (GsHistoryDialog *dialog, GsApp *app)
box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
/* add the action */
- switch (gs_app_get_state (app)) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_AVAILABLE:
case AS_APP_STATE_REMOVING:
/* TRANSLATORS: this is the status in the history UI,
diff --git a/src/gs-history-dialog.h b/src/gs-history-dialog.h
index 6cf1829..77b98e9 100644
--- a/src/gs-history-dialog.h
+++ b/src/gs-history-dialog.h
@@ -52,7 +52,7 @@ struct _GsHistoryDialogClass
GType gs_history_dialog_get_type (void);
GtkWidget *gs_history_dialog_new (void);
void gs_history_dialog_set_app (GsHistoryDialog *dialog,
- GsApp *app);
+ AsApp *app);
#endif /* GS_HISTORY_DIALOG_H */
diff --git a/src/gs-plugin-loader-sync.c b/src/gs-plugin-loader-sync.c
index 462a2ba..5331478 100644
--- a/src/gs-plugin-loader-sync.c
+++ b/src/gs-plugin-loader-sync.c
@@ -26,14 +26,14 @@
/**
* gs_plugin_loader_get_app_by_id:
*/
-GsApp *
+AsApp *
gs_plugin_loader_get_app_by_id (GsPluginLoader *plugin_loader,
const gchar *id,
GsPluginRefineFlags flags,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
gboolean ret;
app = gs_app_new (id);
@@ -52,7 +52,7 @@ typedef struct {
GMainContext *context;
GMainLoop *loop;
gboolean ret;
- GsApp *app;
+ AsApp *app;
} GsPluginLoaderHelper;
static void
@@ -438,7 +438,7 @@ gs_plugin_loader_app_refine_finish_sync (GsPluginLoader *plugin_loader,
**/
gboolean
gs_plugin_loader_app_refine (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginRefineFlags flags,
GCancellable *cancellable,
GError **error)
@@ -488,7 +488,7 @@ gs_plugin_loader_app_action_finish_sync (GsPluginLoader *plugin_loader,
**/
gboolean
gs_plugin_loader_app_action (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginLoaderAction action,
GCancellable *cancellable,
GError **error)
@@ -585,7 +585,7 @@ gs_plugin_loader_filename_to_app_finish_sync (GObject *source_object,
/**
* gs_plugin_loader_filename_to_app:
**/
-GsApp *
+AsApp *
gs_plugin_loader_filename_to_app (GsPluginLoader *plugin_loader,
const gchar *filename,
GsPluginRefineFlags flags,
diff --git a/src/gs-plugin-loader-sync.h b/src/gs-plugin-loader-sync.h
index c600545..432e10b 100644
--- a/src/gs-plugin-loader-sync.h
+++ b/src/gs-plugin-loader-sync.h
@@ -63,12 +63,12 @@ GList *gs_plugin_loader_get_category_apps (GsPluginLoader
*plugin_loader,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_loader_app_refine (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginRefineFlags flags,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_loader_app_action (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginLoaderAction action,
GCancellable *cancellable,
GError **error);
@@ -77,12 +77,12 @@ gboolean gs_plugin_loader_refresh (GsPluginLoader *plugin_loader,
GsPluginRefreshFlags flags,
GCancellable *cancellable,
GError **error);
-GsApp *gs_plugin_loader_get_app_by_id (GsPluginLoader *plugin_loader,
+AsApp *gs_plugin_loader_get_app_by_id (GsPluginLoader *plugin_loader,
const gchar *id,
GsPluginRefineFlags flags,
GCancellable *cancellable,
GError **error);
-GsApp *gs_plugin_loader_filename_to_app (GsPluginLoader *plugin_loader,
+AsApp *gs_plugin_loader_filename_to_app (GsPluginLoader *plugin_loader,
const gchar *filename,
GsPluginRefineFlags flags,
GCancellable *cancellable,
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index ce36cdd..916abf1 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -80,17 +80,17 @@ gs_plugin_loader_error_quark (void)
static gint
gs_plugin_loader_app_sort_cb (gconstpointer a, gconstpointer b)
{
- return g_strcmp0 (gs_app_get_name (GS_APP (a)),
- gs_app_get_name (GS_APP (b)));
+ return g_strcmp0 (as_app_get_name (AS_APP (a), NULL),
+ as_app_get_name (AS_APP (b), NULL));
}
/**
* gs_plugin_loader_dedupe:
*/
-GsApp *
-gs_plugin_loader_dedupe (GsPluginLoader *plugin_loader, GsApp *app)
+AsApp *
+gs_plugin_loader_dedupe (GsPluginLoader *plugin_loader, AsApp *app)
{
- GsApp *new_app;
+ AsApp *new_app;
GsPluginLoaderPrivate *priv = plugin_loader->priv;
g_return_val_if_fail (GS_IS_PLUGIN_LOADER (plugin_loader), NULL);
@@ -99,13 +99,13 @@ gs_plugin_loader_dedupe (GsPluginLoader *plugin_loader, GsApp *app)
g_mutex_lock (&plugin_loader->priv->app_cache_mutex);
/* not yet set */
- if (gs_app_get_id (app) == NULL) {
+ if (as_app_get_id (app) == NULL) {
new_app = app;
goto out;
}
/* already exists */
- new_app = g_hash_table_lookup (priv->app_cache, gs_app_get_id (app));
+ new_app = g_hash_table_lookup (priv->app_cache, as_app_get_id (app));
if (new_app == app) {
new_app = app;
goto out;
@@ -115,7 +115,7 @@ gs_plugin_loader_dedupe (GsPluginLoader *plugin_loader, GsApp *app)
if (new_app == NULL) {
new_app = app;
g_hash_table_insert (priv->app_cache,
- g_strdup (gs_app_get_id (app)),
+ g_strdup (as_app_get_id (app)),
g_object_ref (app));
goto out;
}
@@ -142,7 +142,7 @@ gs_plugin_loader_list_dedupe (GsPluginLoader *plugin_loader, GList *list)
{
GList *l;
for (l = list; l != NULL; l = l->next)
- l->data = gs_plugin_loader_dedupe (plugin_loader, GS_APP (l->data));
+ l->data = gs_plugin_loader_dedupe (plugin_loader, AS_APP (l->data));
}
/**
@@ -229,7 +229,7 @@ gs_plugin_loader_run_refine (GsPluginLoader *plugin_loader,
GList *related_list = NULL;
GPtrArray *addons;
GPtrArray *related;
- GsApp *app;
+ AsApp *app;
GsPlugin *plugin;
gboolean ret = TRUE;
guint i;
@@ -260,13 +260,13 @@ gs_plugin_loader_run_refine (GsPluginLoader *plugin_loader,
if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS) > 0) {
flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_ADDONS;
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
addons = gs_app_get_addons (app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon = g_ptr_array_index (addons, i);
+ AsApp *addon = g_ptr_array_index (addons, i);
g_debug ("refining app %s addon %s",
- gs_app_get_id (app),
- gs_app_get_id (addon));
+ as_app_get_id (app),
+ as_app_get_id (addon));
gs_plugin_add_app (&addons_list, addon);
}
}
@@ -286,12 +286,12 @@ gs_plugin_loader_run_refine (GsPluginLoader *plugin_loader,
if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED) > 0) {
flags &= ~GS_PLUGIN_REFINE_FLAGS_REQUIRE_RELATED;
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
related = gs_app_get_related (app);
for (i = 0; i < related->len; i++) {
app = g_ptr_array_index (related, i);
g_debug ("refining related: %s[%s]",
- gs_app_get_id (app),
+ as_app_get_id (app),
gs_app_get_source_default (app));
gs_plugin_add_app (&related_list, app);
}
@@ -445,12 +445,12 @@ out:
* gs_plugin_loader_get_app_str:
**/
static const gchar *
-gs_plugin_loader_get_app_str (GsApp *app)
+gs_plugin_loader_get_app_str (AsApp *app)
{
const gchar *id;
/* first try the actual id */
- id = gs_app_get_id_full (app);
+ id = as_app_get_id_full (app);
if (id != NULL)
return id;
@@ -472,10 +472,10 @@ gs_plugin_loader_get_app_str (GsApp *app)
* gs_plugin_loader_app_is_valid:
**/
static gboolean
-gs_plugin_loader_app_is_valid (GsApp *app, gpointer user_data)
+gs_plugin_loader_app_is_valid (AsApp *app, gpointer user_data)
{
/* don't show unknown state */
- if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
+ if (as_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
g_debug ("app invalid as state unknown %s",
gs_plugin_loader_get_app_str (app));
return FALSE;
@@ -483,7 +483,7 @@ gs_plugin_loader_app_is_valid (GsApp *app, gpointer user_data)
/* don't show unconverted unavailables */
if (gs_app_get_kind (app) == GS_APP_KIND_UNKNOWN &&
- gs_app_get_state (app) == AS_APP_STATE_UNAVAILABLE) {
+ as_app_get_state (app) == AS_APP_STATE_UNAVAILABLE) {
g_debug ("app invalid as unconverted unavailable %s",
gs_plugin_loader_get_app_str (app));
return FALSE;
@@ -511,12 +511,12 @@ gs_plugin_loader_app_is_valid (GsApp *app, gpointer user_data)
}
/* don't show apps that do not have the required details */
- if (gs_app_get_name (app) == NULL) {
+ if (as_app_get_name (app, NULL) == NULL) {
g_debug ("app invalid as no name %s",
gs_plugin_loader_get_app_str (app));
return FALSE;
}
- if (gs_app_get_summary (app) == NULL) {
+ if (as_app_get_comment (app, NULL) == NULL) {
g_debug ("app invalid as no summary %s",
gs_plugin_loader_get_app_str (app));
return FALSE;
@@ -534,7 +534,7 @@ gs_plugin_loader_app_is_valid (GsApp *app, gpointer user_data)
* gs_plugin_loader_app_is_non_system:
**/
static gboolean
-gs_plugin_loader_app_is_non_system (GsApp *app, gpointer user_data)
+gs_plugin_loader_app_is_non_system (AsApp *app, gpointer user_data)
{
return gs_app_get_kind (app) != GS_APP_KIND_SYSTEM;
}
@@ -543,7 +543,7 @@ gs_plugin_loader_app_is_non_system (GsApp *app, gpointer user_data)
* gs_plugin_loader_get_app_is_compatible:
*/
static gboolean
-gs_plugin_loader_get_app_is_compatible (GsApp *app, gpointer user_data)
+gs_plugin_loader_get_app_is_compatible (AsApp *app, gpointer user_data)
{
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (user_data);
GsPluginLoaderPrivate *priv = plugin_loader->priv;
@@ -551,7 +551,7 @@ gs_plugin_loader_get_app_is_compatible (GsApp *app, gpointer user_data)
guint i;
/* search for any compatible projects */
- tmp = gs_app_get_project_group (app);
+ tmp = as_app_get_project_group (app);
if (tmp == NULL)
return TRUE;
for (i = 0; priv->compatible_projects[i] != NULL; i++) {
@@ -559,7 +559,7 @@ gs_plugin_loader_get_app_is_compatible (GsApp *app, gpointer user_data)
return TRUE;
}
g_debug ("removing incompatible %s from project group %s",
- gs_app_get_id (app), gs_app_get_project_group (app));
+ as_app_get_id (app), as_app_get_project_group (app));
return FALSE;
}
@@ -567,11 +567,11 @@ gs_plugin_loader_get_app_is_compatible (GsApp *app, gpointer user_data)
* gs_plugin_loader_get_app_has_appdata:
*/
static gboolean
-gs_plugin_loader_get_app_has_appdata (GsApp *app, gpointer user_data)
+gs_plugin_loader_get_app_has_appdata (AsApp *app, gpointer user_data)
{
- if (gs_app_get_description (app) != NULL)
+ if (as_app_get_description (app, NULL) != NULL)
return TRUE;
- g_debug ("removing app with no AppData %s", gs_app_get_id (app));
+ g_debug ("removing app with no AppData %s", as_app_get_id (app));
return FALSE;
}
@@ -581,7 +581,7 @@ gs_plugin_loader_get_app_has_appdata (GsApp *app, gpointer user_data)
static gboolean
gs_plugin_loader_run_action_plugin (GsPluginLoader *plugin_loader,
GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
const gchar *function_name,
GCancellable *cancellable,
GError **error)
@@ -629,7 +629,7 @@ out:
**/
static gboolean
gs_plugin_loader_run_action (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
const gchar *function_name,
GCancellable *cancellable,
GError **error)
@@ -685,7 +685,7 @@ typedef struct {
gchar *filename;
guint cache_age;
GsCategory *category;
- GsApp *app;
+ AsApp *app;
AsAppState state_success;
AsAppState state_failure;
} GsPluginLoaderAsyncState;
@@ -719,12 +719,12 @@ gs_plugin_loader_add_os_update_item (GList *list)
GdkPixbuf *pixbuf = NULL;
GList *l;
GList *list_new = list;
- GsApp *app_os;
- GsApp *app_tmp;
+ AsApp *app_os;
+ AsApp *app_tmp;
/* do we have any packages left that are not apps? */
for (l = list; l != NULL; l = l->next) {
- app_tmp = GS_APP (l->data);
+ app_tmp = AS_APP (l->data);
if (gs_app_get_kind (app_tmp) == GS_APP_KIND_PACKAGE)
has_os_update = TRUE;
}
@@ -748,9 +748,9 @@ gs_plugin_loader_add_os_update_item (GList *list)
"improvements for all users."));
gs_app_set_description (app_os,
GS_APP_QUALITY_NORMAL,
- gs_app_get_summary (app_os));
+ as_app_get_comment (app_os, NULL));
for (l = list; l != NULL; l = l->next) {
- app_tmp = GS_APP (l->data);
+ app_tmp = AS_APP (l->data);
if (gs_app_get_kind (app_tmp) != GS_APP_KIND_PACKAGE)
continue;
gs_app_add_related (app_os, app_tmp);
@@ -835,19 +835,19 @@ out:
* gs_plugin_loader_get_updates_async:
*
* This method calls all plugins that implement the gs_plugin_add_updates()
- * function. The plugins can either return #GsApp objects of kind
- * %GS_APP_KIND_NORMAL for bonafide applications, or #GsApp's of kind
+ * function. The plugins can either return #AsApp objects of kind
+ * %GS_APP_KIND_NORMAL for bonafide applications, or #AsApp's of kind
* %GS_APP_KIND_PACKAGE for packages that may or may not be applications.
*
- * Once the list of updates is refined, some of the #GsApp's of kind
+ * Once the list of updates is refined, some of the #AsApp's of kind
* %GS_APP_KIND_PACKAGE will have been promoted to a kind of %GS_APP_KIND_NORMAL,
* or if they are core applications, promoted again to a kind of %GS_APP_KIND_SYSTEM.
*
- * Any #GsApp's of kind %GS_APP_KIND_PACKAGE that remain after refining are
- * added to a new virtual #GsApp of kind %GS_APP_KIND_OS_UPDATE and all the
+ * Any #AsApp's of kind %GS_APP_KIND_PACKAGE that remain after refining are
+ * added to a new virtual #AsApp of kind %GS_APP_KIND_OS_UPDATE and all the
* %GS_APP_KIND_PACKAGE objects are moved to related packages of this object.
*
- * This means all of the #GsApp's returning from this function are of kind
+ * This means all of the #AsApp's returning from this function are of kind
* %GS_APP_KIND_NORMAL, %GS_APP_KIND_SYSTEM or %GS_APP_KIND_OS_UPDATE.
*
* The #GsApps may be in state %AS_APP_STATE_INSTALLED or %AS_APP_STATE_AVAILABLE
@@ -880,7 +880,7 @@ gs_plugin_loader_get_updates_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_get_updates_finish:
*
- * Return value: (element-type GsApp) (transfer full): A list of applications
+ * Return value: (element-type AsApp) (transfer full): A list of applications
**/
GList *
gs_plugin_loader_get_updates_finish (GsPluginLoader *plugin_loader,
@@ -945,7 +945,7 @@ out:
* gs_plugin_loader_get_sources_async:
*
* This method calls all plugins that implement the gs_plugin_add_sources()
- * function. The plugins return #GsApp objects of kind %GS_APP_KIND_SOURCE..
+ * function. The plugins return #AsApp objects of kind %GS_APP_KIND_SOURCE..
*
* The *applications* installed from each source can be obtained using
* gs_app_get_related() if this information is available.
@@ -977,7 +977,7 @@ gs_plugin_loader_get_sources_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_get_sources_finish:
*
- * Return value: (element-type GsApp) (transfer full): A list of applications
+ * Return value: (element-type AsApp) (transfer full): A list of applications
**/
GList *
gs_plugin_loader_get_sources_finish (GsPluginLoader *plugin_loader,
@@ -1040,18 +1040,18 @@ out:
* gs_plugin_loader_get_installed_async:
*
* This method calls all plugins that implement the gs_plugin_add_installed()
- * function. The plugins can either return #GsApp objects of kind
- * %GS_APP_KIND_NORMAL for bonafide applications, or #GsApp's of kind
+ * function. The plugins can either return #AsApp objects of kind
+ * %GS_APP_KIND_NORMAL for bonafide applications, or #AsApp's of kind
* %GS_APP_KIND_PACKAGE for packages that may or may not be applications.
*
- * Once the list of updates is refined, some of the #GsApp's of kind
+ * Once the list of updates is refined, some of the #AsApp's of kind
* %GS_APP_KIND_PACKAGE will have been promoted to a kind of %GS_APP_KIND_NORMAL,
* or if they are core applications, promoted again to a kind of %GS_APP_KIND_SYSTEM.
*
- * Any #GsApp's of kind %GS_APP_KIND_PACKAGE or %GS_APP_KIND_SYSTEM that remain
+ * Any #AsApp's of kind %GS_APP_KIND_PACKAGE or %GS_APP_KIND_SYSTEM that remain
* after refining are automatically removed.
*
- * This means all of the #GsApp's returning from this function are of kind
+ * This means all of the #AsApp's returning from this function are of kind
* %GS_APP_KIND_NORMAL.
*
* The #GsApps will all initially be in state %AS_APP_STATE_INSTALLED.
@@ -1083,7 +1083,7 @@ gs_plugin_loader_get_installed_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_get_installed_finish:
*
- * Return value: (element-type GsApp) (transfer full): A list of applications
+ * Return value: (element-type AsApp) (transfer full): A list of applications
**/
GList *
gs_plugin_loader_get_installed_finish (GsPluginLoader *plugin_loader,
@@ -1173,7 +1173,7 @@ gs_plugin_loader_get_popular_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_get_popular_finish:
*
- * Return value: (element-type GsApp) (transfer full): A list of applications
+ * Return value: (element-type AsApp) (transfer full): A list of applications
**/
GList *
gs_plugin_loader_get_popular_finish (GsPluginLoader *plugin_loader,
@@ -1194,9 +1194,9 @@ gs_plugin_loader_get_popular_finish (GsPluginLoader *plugin_loader,
* gs_plugin_loader_featured_debug:
**/
static gboolean
-gs_plugin_loader_featured_debug (GsApp *app, gpointer user_data)
+gs_plugin_loader_featured_debug (AsApp *app, gpointer user_data)
{
- if (g_strcmp0 (gs_app_get_id_full (app),
+ if (g_strcmp0 (as_app_get_id_full (app),
g_getenv ("GNOME_SOFTWARE_FEATURED")) == 0)
return TRUE;
return FALSE;
@@ -1251,18 +1251,18 @@ out:
* gs_plugin_loader_get_featured_async:
*
* This method calls all plugins that implement the gs_plugin_add_featured()
- * function. The plugins can either return #GsApp objects of kind
- * %GS_APP_KIND_NORMAL for bonafide applications, or #GsApp's of kind
+ * function. The plugins can either return #AsApp objects of kind
+ * %GS_APP_KIND_NORMAL for bonafide applications, or #AsApp's of kind
* %GS_APP_KIND_PACKAGE for packages that may or may not be applications.
*
- * Once the list of updates is refined, some of the #GsApp's of kind
+ * Once the list of updates is refined, some of the #AsApp's of kind
* %GS_APP_KIND_PACKAGE will have been promoted to a kind of %GS_APP_KIND_NORMAL,
* or if they are core applications, promoted again to a kind of %GS_APP_KIND_SYSTEM.
*
- * Any #GsApp's of kind %GS_APP_KIND_PACKAGE that remain after refining are
+ * Any #AsApp's of kind %GS_APP_KIND_PACKAGE that remain after refining are
* automatically removed.
*
- * This means all of the #GsApp's returning from this function are of kind
+ * This means all of the #AsApp's returning from this function are of kind
* %GS_APP_KIND_NORMAL or %GS_APP_KIND_SYSTEM.
*
* The #GsApps may be in state %AS_APP_STATE_INSTALLED or %AS_APP_STATE_AVAILABLE
@@ -1295,7 +1295,7 @@ gs_plugin_loader_get_featured_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_get_featured_finish:
*
- * Return value: (element-type GsApp) (transfer full): A list of applications
+ * Return value: (element-type AsApp) (transfer full): A list of applications
**/
GList *
gs_plugin_loader_get_featured_finish (GsPluginLoader *plugin_loader,
@@ -1316,7 +1316,7 @@ gs_plugin_loader_get_featured_finish (GsPluginLoader *plugin_loader,
* gs_plugin_loader_convert_unavailable_app:
**/
static gboolean
-gs_plugin_loader_convert_unavailable_app (GsApp *app, const gchar *search)
+gs_plugin_loader_convert_unavailable_app (AsApp *app, const gchar *search)
{
GPtrArray *keywords;
GString *tmp;
@@ -1324,7 +1324,7 @@ gs_plugin_loader_convert_unavailable_app (GsApp *app, const gchar *search)
guint i;
/* is the search string one of the codec keywords */
- keywords = gs_app_get_keywords (app);
+ keywords = as_app_get_keywords (app);
for (i = 0; i < keywords->len; i++) {
keyword = g_ptr_array_index (keywords, i);
if (g_ascii_strcasecmp (search, keyword) == 0) {
@@ -1345,7 +1345,7 @@ gs_plugin_loader_convert_unavailable_app (GsApp *app, const gchar *search)
gs_app_set_summary_missing (app, tmp->str);
gs_app_set_kind (app, GS_APP_KIND_MISSING);
gs_app_set_size (app, GS_APP_SIZE_MISSING);
- gs_app_set_icon (app, "dialog-question-symbolic");
+ as_app_set_icon (app, "dialog-question-symbolic", -1);
gs_app_load_icon (app, NULL);
g_string_free (tmp, TRUE);
return TRUE;
@@ -1358,19 +1358,19 @@ static void
gs_plugin_loader_convert_unavailable (GList *list, const gchar *search)
{
GList *l;
- GsApp *app;
+ AsApp *app;
gboolean ret;
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
if (gs_app_get_kind (app) != GS_APP_KIND_UNKNOWN &&
gs_app_get_kind (app) != GS_APP_KIND_MISSING)
continue;
- if (gs_app_get_state (app) != AS_APP_STATE_UNAVAILABLE)
+ if (as_app_get_state (app) != AS_APP_STATE_UNAVAILABLE)
continue;
- if (gs_app_get_id_kind (app) != AS_ID_KIND_CODEC)
+ if (as_app_get_id_kind (app) != AS_ID_KIND_CODEC)
continue;
- if (gs_app_get_url (app, GS_APP_URL_KIND_MISSING) == NULL)
+ if (as_app_get_url_item (app, AS_URL_KIND_MISSING) == NULL)
continue;
/* only convert the first unavailable codec */
@@ -1472,18 +1472,18 @@ out:
* gs_plugin_loader_search_async:
*
* This method calls all plugins that implement the gs_plugin_add_search()
- * function. The plugins can either return #GsApp objects of kind
- * %GS_APP_KIND_NORMAL for bonafide applications, or #GsApp's of kind
+ * function. The plugins can either return #AsApp objects of kind
+ * %GS_APP_KIND_NORMAL for bonafide applications, or #AsApp's of kind
* %GS_APP_KIND_PACKAGE for packages that may or may not be applications.
*
- * Once the list of updates is refined, some of the #GsApp's of kind
+ * Once the list of updates is refined, some of the #AsApp's of kind
* %GS_APP_KIND_PACKAGE will have been promoted to a kind of %GS_APP_KIND_NORMAL,
* or if they are core applications, promoted again to a kind of %GS_APP_KIND_SYSTEM.
*
- * Any #GsApp's of kind %GS_APP_KIND_PACKAGE or %GS_APP_KIND_SYSTEM that remain
+ * Any #AsApp's of kind %GS_APP_KIND_PACKAGE or %GS_APP_KIND_SYSTEM that remain
* after refining are automatically removed.
*
- * This means all of the #GsApp's returning from this function are of kind
+ * This means all of the #AsApp's returning from this function are of kind
* %GS_APP_KIND_NORMAL.
*
* The #GsApps may be in state %AS_APP_STATE_INSTALLED or %AS_APP_STATE_AVAILABLE
@@ -1518,7 +1518,7 @@ gs_plugin_loader_search_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_search_finish:
*
- * Return value: (element-type GsApp) (transfer full): A list of applications
+ * Return value: (element-type AsApp) (transfer full): A list of applications
**/
GList *
gs_plugin_loader_search_finish (GsPluginLoader *plugin_loader,
@@ -1747,18 +1747,18 @@ out:
* gs_plugin_loader_get_category_apps_async:
*
* This method calls all plugins that implement the gs_plugin_add_category_apps()
- * function. The plugins can either return #GsApp objects of kind
- * %GS_APP_KIND_NORMAL for bonafide applications, or #GsApp's of kind
+ * function. The plugins can either return #AsApp objects of kind
+ * %GS_APP_KIND_NORMAL for bonafide applications, or #AsApp's of kind
* %GS_APP_KIND_PACKAGE for packages that may or may not be applications.
*
- * Once the list of updates is refined, some of the #GsApp's of kind
+ * Once the list of updates is refined, some of the #AsApp's of kind
* %GS_APP_KIND_PACKAGE will have been promoted to a kind of %GS_APP_KIND_NORMAL,
* or if they are core applications, promoted again to a kind of %GS_APP_KIND_SYSTEM.
*
- * Any #GsApp's of kind %GS_APP_KIND_PACKAGE or %GS_APP_KIND_SYSTEM that remain
+ * Any #AsApp's of kind %GS_APP_KIND_PACKAGE or %GS_APP_KIND_SYSTEM that remain
* after refining are automatically removed.
*
- * This means all of the #GsApp's returning from this function are of kind
+ * This means all of the #AsApp's returning from this function are of kind
* %GS_APP_KIND_NORMAL.
*
* The #GsApps may be in state %AS_APP_STATE_INSTALLED or %AS_APP_STATE_AVAILABLE
@@ -1793,7 +1793,7 @@ gs_plugin_loader_get_category_apps_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_get_category_apps_finish:
*
- * Return value: (element-type GsApp) (transfer full): A list of applications
+ * Return value: (element-type AsApp) (transfer full): A list of applications
**/
GList *
gs_plugin_loader_get_category_apps_finish (GsPluginLoader *plugin_loader,
@@ -1851,7 +1851,7 @@ out:
**/
void
gs_plugin_loader_app_refine_async (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginRefineFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -1940,7 +1940,7 @@ gs_plugin_loader_app_action_thread_cb (GTask *task,
gs_app_set_state (state->app, state->state_success);
addons = gs_app_get_addons (state->app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon = g_ptr_array_index (addons, i);
+ AsApp *addon = g_ptr_array_index (addons, i);
if (gs_app_get_to_be_installed (addon)) {
gs_app_set_state (addon, state->state_success);
gs_app_set_to_be_installed (addon, FALSE);
@@ -1952,7 +1952,7 @@ gs_plugin_loader_app_action_thread_cb (GTask *task,
gs_app_set_state (state->app, state->state_failure);
addons = gs_app_get_addons (state->app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon = g_ptr_array_index (addons, i);
+ AsApp *addon = g_ptr_array_index (addons, i);
if (gs_app_get_to_be_installed (addon)) {
gs_app_set_state (addon, state->state_failure);
gs_app_set_to_be_installed (addon, FALSE);
@@ -1973,7 +1973,7 @@ static gboolean
load_install_queue (GsPluginLoader *plugin_loader, GError **error)
{
GList *list = NULL;
- GsApp *app;
+ AsApp *app;
gboolean ret = TRUE;
gchar **names = NULL;
gchar *contents = NULL;
@@ -2002,7 +2002,7 @@ load_install_queue (GsPluginLoader *plugin_loader, GError **error)
g_mutex_lock (&plugin_loader->priv->app_cache_mutex);
g_hash_table_insert (plugin_loader->priv->app_cache,
- g_strdup (gs_app_get_id (app)),
+ g_strdup (as_app_get_id (app)),
g_object_ref (app));
g_mutex_unlock (&plugin_loader->priv->app_cache_mutex);
@@ -2011,7 +2011,7 @@ load_install_queue (GsPluginLoader *plugin_loader, GError **error)
g_object_ref (app));
g_mutex_unlock (&plugin_loader->priv->pending_apps_mutex);
- g_debug ("adding pending app %s", gs_app_get_id (app));
+ g_debug ("adding pending app %s", as_app_get_id (app));
gs_plugin_add_app (&list, app);
g_object_unref (app);
}
@@ -2049,10 +2049,10 @@ save_install_queue (GsPluginLoader *plugin_loader)
pending_apps = plugin_loader->priv->pending_apps;
g_mutex_lock (&plugin_loader->priv->pending_apps_mutex);
for (i = pending_apps->len - 1; i >= 0; i--) {
- GsApp *app;
+ AsApp *app;
app = g_ptr_array_index (pending_apps, i);
- if (gs_app_get_state (app) == AS_APP_STATE_QUEUED_FOR_INSTALL) {
- g_string_append (s, gs_app_get_id (app));
+ if (as_app_get_state (app) == AS_APP_STATE_QUEUED_FOR_INSTALL) {
+ g_string_append (s, as_app_get_id (app));
g_string_append_c (s, '\n');
}
}
@@ -2075,7 +2075,7 @@ save_install_queue (GsPluginLoader *plugin_loader)
}
static void
-add_app_to_install_queue (GsPluginLoader *plugin_loader, GsApp *app)
+add_app_to_install_queue (GsPluginLoader *plugin_loader, AsApp *app)
{
GPtrArray *addons;
guint i;
@@ -2094,14 +2094,14 @@ add_app_to_install_queue (GsPluginLoader *plugin_loader, GsApp *app)
/* recursively queue any addons */
addons = gs_app_get_addons (app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon = g_ptr_array_index (addons, i);
+ AsApp *addon = g_ptr_array_index (addons, i);
if (gs_app_get_to_be_installed (addon))
add_app_to_install_queue (plugin_loader, addon);
}
}
static gboolean
-remove_app_from_install_queue (GsPluginLoader *plugin_loader, GsApp *app)
+remove_app_from_install_queue (GsPluginLoader *plugin_loader, AsApp *app)
{
GPtrArray *addons;
gboolean ret;
@@ -2121,7 +2121,7 @@ remove_app_from_install_queue (GsPluginLoader *plugin_loader, GsApp *app)
/* recursively remove any queued addons */
addons = gs_app_get_addons (app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon = g_ptr_array_index (addons, i);
+ AsApp *addon = g_ptr_array_index (addons, i);
remove_app_from_install_queue (plugin_loader, addon);
}
}
@@ -2137,7 +2137,7 @@ remove_app_from_install_queue (GsPluginLoader *plugin_loader, GsApp *app)
**/
void
gs_plugin_loader_app_action_async (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginLoaderAction action,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -2225,18 +2225,18 @@ gs_plugin_loader_app_action_finish (GsPluginLoader *plugin_loader,
* gs_plugin_loader_get_state_for_app:
**/
AsAppState
-gs_plugin_loader_get_state_for_app (GsPluginLoader *plugin_loader, GsApp *app)
+gs_plugin_loader_get_state_for_app (GsPluginLoader *plugin_loader, AsApp *app)
{
AsAppState state = AS_APP_STATE_UNKNOWN;
- GsApp *tmp;
+ AsApp *tmp;
GsPluginLoaderPrivate *priv = plugin_loader->priv;
guint i;
g_mutex_lock (&plugin_loader->priv->pending_apps_mutex);
for (i = 0; i < priv->pending_apps->len; i++) {
tmp = g_ptr_array_index (priv->pending_apps, i);
- if (g_strcmp0 (gs_app_get_id (tmp), gs_app_get_id (app)) == 0) {
- state = gs_app_get_state (tmp);
+ if (g_strcmp0 (as_app_get_id (tmp), as_app_get_id (app)) == 0) {
+ state = as_app_get_state (tmp);
break;
}
}
@@ -2311,7 +2311,7 @@ gs_plugin_loader_set_enabled (GsPluginLoader *plugin_loader,
*/
static void
gs_plugin_loader_status_update_cb (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GsPluginStatus status,
gpointer user_data)
{
@@ -2324,7 +2324,7 @@ gs_plugin_loader_status_update_cb (GsPlugin *plugin,
/* new, or an app, so emit */
g_debug ("emitting %s(%s)",
gs_plugin_status_to_string (status),
- app != NULL ? gs_app_get_id (app) : "<general>");
+ app != NULL ? as_app_get_id (app) : "<general>");
plugin_loader->priv->status_last = status;
g_signal_emit (plugin_loader,
signals[SIGNAL_STATUS_CHANGED],
@@ -2723,7 +2723,7 @@ gs_plugin_loader_app_installed_cb (GObject *source,
gpointer user_data)
{
GError *error = NULL;
- GsApp *app = GS_APP (user_data);
+ AsApp *app = AS_APP (user_data);
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
gboolean ret;
@@ -2733,7 +2733,7 @@ gs_plugin_loader_app_installed_cb (GObject *source,
if (!ret) {
remove_app_from_install_queue (plugin_loader, app);
g_warning ("failed to install %s: %s",
- gs_app_get_id (app),
+ as_app_get_id (app),
error->message);
g_error_free (error);
}
@@ -2749,7 +2749,7 @@ gs_plugin_loader_set_network_status (GsPluginLoader *plugin_loader,
{
GList *l;
GList *queue = NULL;
- GsApp *app;
+ AsApp *app;
guint i;
if (plugin_loader->priv->online == online)
@@ -2763,7 +2763,7 @@ gs_plugin_loader_set_network_status (GsPluginLoader *plugin_loader,
g_mutex_lock (&plugin_loader->priv->pending_apps_mutex);
for (i = 0; i < plugin_loader->priv->pending_apps->len; i++) {
app = g_ptr_array_index (plugin_loader->priv->pending_apps, i);
- if (gs_app_get_state (app) == AS_APP_STATE_QUEUED_FOR_INSTALL)
+ if (as_app_get_state (app) == AS_APP_STATE_QUEUED_FOR_INSTALL)
gs_plugin_add_app (&queue, app);
}
g_mutex_unlock (&plugin_loader->priv->pending_apps_mutex);
@@ -3050,11 +3050,11 @@ out:
* gs_plugin_loader_filename_to_app_async:
*
* This method calls all plugins that implement the gs_plugin_add_filename_to_app()
- * function. The plugins can either return #GsApp objects of kind
- * %GS_APP_KIND_NORMAL for bonafide applications, or #GsApp's of kind
+ * function. The plugins can either return #AsApp objects of kind
+ * %GS_APP_KIND_NORMAL for bonafide applications, or #AsApp's of kind
* %GS_APP_KIND_PACKAGE for packages that may or may not be applications.
*
- * Once the list of updates is refined, some of the #GsApp's of kind
+ * Once the list of updates is refined, some of the #AsApp's of kind
* %GS_APP_KIND_PACKAGE will have been promoted to a kind of %GS_APP_KIND_NORMAL,
* or if they are core applications.
**/
@@ -3087,9 +3087,9 @@ gs_plugin_loader_filename_to_app_async (GsPluginLoader *plugin_loader,
/**
* gs_plugin_loader_filename_to_app_finish:
*
- * Return value: (element-type GsApp) (transfer full): An application, or %NULL
+ * Return value: (element-type AsApp) (transfer full): An application, or %NULL
**/
-GsApp *
+AsApp *
gs_plugin_loader_filename_to_app_finish (GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error)
diff --git a/src/gs-plugin-loader.h b/src/gs-plugin-loader.h
index 2875a18..89d2e95 100644
--- a/src/gs-plugin-loader.h
+++ b/src/gs-plugin-loader.h
@@ -50,7 +50,7 @@ typedef struct
{
GObjectClass parent_class;
void (*status_changed) (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginStatus status);
void (*pending_apps_changed) (GsPluginLoader *plugin_loader);
void (*updates_changed) (GsPluginLoader *plugin_loader);
@@ -71,7 +71,7 @@ typedef enum {
} GsPluginLoaderAction;
typedef void (*GsPluginLoaderFinishedFunc) (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
gpointer user_data);
GQuark gs_plugin_loader_error_quark (void);
@@ -150,7 +150,7 @@ void gs_plugin_loader_filename_to_app_async (GsPluginLoader
*plugin_loader,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-GsApp *gs_plugin_loader_filename_to_app_finish(GsPluginLoader *plugin_loader,
+AsApp *gs_plugin_loader_filename_to_app_finish(GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error);
gboolean gs_plugin_loader_setup (GsPluginLoader *plugin_loader,
@@ -162,7 +162,7 @@ gboolean gs_plugin_loader_set_enabled (GsPluginLoader *plugin_loader,
void gs_plugin_loader_set_location (GsPluginLoader *plugin_loader,
const gchar *location);
void gs_plugin_loader_app_refine_async (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginRefineFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -171,7 +171,7 @@ gboolean gs_plugin_loader_app_refine_finish (GsPluginLoader *plugin_loader,
GAsyncResult *res,
GError **error);
void gs_plugin_loader_app_action_async (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginLoaderAction a,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -189,10 +189,10 @@ void gs_plugin_loader_refresh_async (GsPluginLoader
*plugin_loader,
GAsyncReadyCallback callback,
gpointer user_data);
AsAppState gs_plugin_loader_get_state_for_app (GsPluginLoader *plugin_loader,
- GsApp *app);
+ AsApp *app);
GPtrArray *gs_plugin_loader_get_pending (GsPluginLoader *plugin_loader);
-GsApp *gs_plugin_loader_dedupe (GsPluginLoader *plugin_loader,
- GsApp *app);
+AsApp *gs_plugin_loader_dedupe (GsPluginLoader *plugin_loader,
+ AsApp *app);
void gs_plugin_loader_set_network_status (GsPluginLoader *plugin_loader,
gboolean online);
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index eca115b..16c4d8d 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -95,7 +95,7 @@ out:
* gs_plugin_add_app:
**/
void
-gs_plugin_add_app (GList **list, GsApp *app)
+gs_plugin_add_app (GList **list, AsApp *app)
{
g_return_if_fail (list != NULL);
g_return_if_fail (GS_IS_APP (app));
@@ -114,21 +114,21 @@ gs_plugin_list_free (GList *list)
/**
* gs_plugin_list_filter:
*
- * If func() returns TRUE for the GsApp, then the app is kept.
+ * If func() returns TRUE for the AsApp, then the app is kept.
**/
void
gs_plugin_list_filter (GList **list, GsPluginListFilter func, gpointer user_data)
{
GList *l;
GList *new = NULL;
- GsApp *app;
+ AsApp *app;
g_return_if_fail (list != NULL);
g_return_if_fail (func != NULL);
/* see if any of the apps need filtering */
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
if (func (app, user_data))
gs_plugin_add_app (&new, app);
}
@@ -149,8 +149,8 @@ gs_plugin_list_randomize_cb (gconstpointer a, gconstpointer b, gpointer user_dat
gchar *key;
key = g_strdup_printf ("Plugin::sort-key[%p]", user_data);
- k1 = gs_app_get_metadata_item (GS_APP (a), key);
- k2 = gs_app_get_metadata_item (GS_APP (b), key);
+ k1 = as_app_get_metadata_item (AS_APP (a), key);
+ k2 = as_app_get_metadata_item (AS_APP (b), key);
g_free (key);
return g_strcmp0 (k1, k2);
}
@@ -166,7 +166,7 @@ gs_plugin_list_randomize (GList **list)
GDateTime *date;
GList *l;
GRand *rand;
- GsApp *app;
+ AsApp *app;
gchar *key;
gchar sort_key[] = { '\0', '\0', '\0', '\0' };
@@ -175,16 +175,16 @@ gs_plugin_list_randomize (GList **list)
date = g_date_time_new_now_utc ();
g_rand_set_seed (rand, g_date_time_get_day_of_year (date));
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
sort_key[0] = g_rand_int_range (rand, (gint32) 'A', (gint32) 'Z');
sort_key[1] = g_rand_int_range (rand, (gint32) 'A', (gint32) 'Z');
sort_key[2] = g_rand_int_range (rand, (gint32) 'A', (gint32) 'Z');
- gs_app_set_metadata (app, key, sort_key);
+ as_app_add_metadata (app, key, sort_key, -1);
}
*list = g_list_sort_with_data (*list, gs_plugin_list_randomize_cb, list);
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- gs_app_set_metadata (app, key, NULL);
+ app = AS_APP (l->data);
+ as_app_add_metadata (app, key, NULL, -1);
}
g_free (key);
g_rand_free (rand);
@@ -200,8 +200,8 @@ gs_plugin_list_filter_duplicates (GList **list)
GHashTable *hash;
GList *l;
GList *new = NULL;
- GsApp *app;
- GsApp *found;
+ AsApp *app;
+ AsApp *found;
const gchar *id;
g_return_if_fail (list != NULL);
@@ -209,8 +209,8 @@ gs_plugin_list_filter_duplicates (GList **list)
/* create a new list with just the unique items */
hash = g_hash_table_new (g_str_hash, g_str_equal);
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- id = gs_app_get_id_full (app);
+ app = AS_APP (l->data);
+ id = as_app_get_id_full (app);
if (id == NULL) {
gs_plugin_add_app (&new, app);
continue;
@@ -242,7 +242,7 @@ gs_plugin_list_copy (GList *list)
typedef struct {
GsPlugin *plugin;
- GsApp *app;
+ AsApp *app;
GsPluginStatus status;
} GsPluginStatusHelper;
@@ -269,7 +269,7 @@ gs_plugin_status_update_cb (gpointer user_data)
* gs_plugin_status_update:
**/
void
-gs_plugin_status_update (GsPlugin *plugin, GsApp *app, GsPluginStatus status)
+gs_plugin_status_update (GsPlugin *plugin, AsApp *app, GsPluginStatus status)
{
GsPluginStatusHelper *helper;
guint id;
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index c09a9ac..ab5d9a1 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -26,6 +26,7 @@
#include <gmodule.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
+#include <appstream-glib.h>
#include "gs-app.h"
#include "gs-category.h"
@@ -49,13 +50,13 @@ typedef enum {
} GsPluginStatus;
typedef void (*GsPluginStatusUpdate) (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GsPluginStatus status,
gpointer user_data);
typedef void (*GsPluginUpdatesChanged) (GsPlugin *plugin,
gpointer user_data);
-typedef gboolean (*GsPluginListFilter) (GsApp *app,
+typedef gboolean (*GsPluginListFilter) (AsApp *app,
gpointer user_data);
struct GsPlugin {
@@ -128,7 +129,7 @@ typedef gboolean (*GsPluginResultsFunc) (GsPlugin *plugin,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginActionFunc) (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error);
typedef gboolean (*GsPluginRefineFunc) (GsPlugin *plugin,
@@ -155,7 +156,7 @@ void gs_plugin_set_enabled (GsPlugin *plugin,
gboolean gs_plugin_check_distro_id (GsPlugin *plugin,
const gchar *distro_id);
void gs_plugin_add_app (GList **list,
- GsApp *app);
+ AsApp *app);
void gs_plugin_list_free (GList *list);
GList *gs_plugin_list_copy (GList *list);
void gs_plugin_list_filter (GList **list,
@@ -165,7 +166,7 @@ void gs_plugin_list_filter_duplicates (GList **list);
void gs_plugin_list_randomize (GList **list);
void gs_plugin_status_update (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GsPluginStatus status);
void gs_plugin_updates_changed (GsPlugin *plugin);
const gchar *gs_plugin_status_to_string (GsPluginStatus status);
@@ -214,19 +215,19 @@ gboolean gs_plugin_refine (GsPlugin *plugin,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_app_install (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_app_update (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_app_remove (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_app_set_rating (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error);
gboolean gs_plugin_refresh (GsPlugin *plugin,
diff --git a/src/gs-popular-tile.c b/src/gs-popular-tile.c
index 801b87e..ffc0d53 100644
--- a/src/gs-popular-tile.c
+++ b/src/gs-popular-tile.c
@@ -28,7 +28,7 @@
struct _GsPopularTilePrivate
{
- GsApp *app;
+ AsApp *app;
GtkWidget *button;
GtkWidget *label;
GtkWidget *image;
@@ -45,7 +45,7 @@ enum {
static guint signals [SIGNAL_LAST] = { 0 };
-GsApp *
+AsApp *
gs_popular_tile_get_app (GsPopularTile *tile)
{
GsPopularTilePrivate *priv;
@@ -57,7 +57,7 @@ gs_popular_tile_get_app (GsPopularTile *tile)
}
static void
-app_state_changed (GsApp *app, GParamSpec *pspec, GsPopularTile *tile)
+app_state_changed (AsApp *app, GParamSpec *pspec, GsPopularTile *tile)
{
AtkObject *accessible;
GsPopularTilePrivate *priv;
@@ -69,13 +69,13 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsPopularTile *tile)
accessible = gtk_widget_get_accessible (priv->button);
label = gtk_bin_get_child (GTK_BIN (priv->eventbox));
- switch (gs_app_get_state (app)) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_INSTALLED:
case AS_APP_STATE_INSTALLING:
case AS_APP_STATE_REMOVING:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Installed"));
/* TRANSLATORS: this is the small blue label on the tile
* that tells the user the application is installed */
@@ -84,7 +84,7 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsPopularTile *tile)
case AS_APP_STATE_UPDATABLE:
installed = TRUE;
name = g_strdup_printf ("%s (%s)",
- gs_app_get_name (app),
+ as_app_get_name (app, NULL),
_("Updates"));
/* TRANSLATORS: this is the small blue label on the tile
* that tells the user there is an update for the installed
@@ -94,7 +94,7 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsPopularTile *tile)
case AS_APP_STATE_AVAILABLE:
default:
installed = FALSE;
- name = g_strdup (gs_app_get_name (app));
+ name = g_strdup (as_app_get_name (app, NULL));
break;
}
@@ -102,13 +102,13 @@ app_state_changed (GsApp *app, GParamSpec *pspec, GsPopularTile *tile)
if (GTK_IS_ACCESSIBLE (accessible)) {
atk_object_set_name (accessible, name);
- atk_object_set_description (accessible, gs_app_get_summary (app));
+ atk_object_set_description (accessible, as_app_get_comment (app, NULL));
}
g_free (name);
}
void
-gs_popular_tile_set_app (GsPopularTile *tile, GsApp *app)
+gs_popular_tile_set_app (GsPopularTile *tile, AsApp *app)
{
GsPopularTilePrivate *priv;
@@ -130,7 +130,7 @@ gs_popular_tile_set_app (GsPopularTile *tile, GsApp *app)
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image), gs_app_get_pixbuf (priv->app));
- gtk_label_set_label (GTK_LABEL (priv->label), gs_app_get_name (app));
+ gtk_label_set_label (GTK_LABEL (priv->label), as_app_get_name (app, NULL));
}
static void
@@ -192,7 +192,7 @@ gs_popular_tile_class_init (GsPopularTileClass *klass)
}
GtkWidget *
-gs_popular_tile_new (GsApp *app)
+gs_popular_tile_new (AsApp *app)
{
GsPopularTile *tile;
diff --git a/src/gs-popular-tile.h b/src/gs-popular-tile.h
index 2be5a7e..2c04295 100644
--- a/src/gs-popular-tile.h
+++ b/src/gs-popular-tile.h
@@ -53,10 +53,10 @@ struct _GsPopularTileClass
};
GType gs_popular_tile_get_type (void);
-GtkWidget *gs_popular_tile_new (GsApp *app);
-GsApp *gs_popular_tile_get_app (GsPopularTile *tile);
+GtkWidget *gs_popular_tile_new (AsApp *app);
+AsApp *gs_popular_tile_get_app (GsPopularTile *tile);
void gs_popular_tile_set_app (GsPopularTile *tile,
- GsApp *app);
+ AsApp *app);
G_END_DECLS
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index d50c594..34e5163 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -216,11 +216,11 @@ gs_markdown_func (void)
}
static gboolean
-gs_plugin_list_filter_cb (GsApp *app, gpointer user_data)
+gs_plugin_list_filter_cb (AsApp *app, gpointer user_data)
{
- if (g_strcmp0 (gs_app_get_id (app), "a") == 0)
+ if (g_strcmp0 (as_app_get_id (app), "a") == 0)
return FALSE;
- if (g_strcmp0 (gs_app_get_id (app), "c") == 0)
+ if (g_strcmp0 (as_app_get_id (app), "c") == 0)
return FALSE;
return TRUE;
}
@@ -231,7 +231,7 @@ gs_plugin_func (void)
GList *list = NULL;
GList *list_dup;
GList *list_remove = NULL;
- GsApp *app;
+ AsApp *app;
/* add a couple of duplicate IDs */
app = gs_app_new ("a");
@@ -239,11 +239,11 @@ gs_plugin_func (void)
g_object_unref (app);
/* test refcounting */
- g_assert_cmpstr (gs_app_get_id (GS_APP (list->data)), ==, "a");
+ g_assert_cmpstr (as_app_get_id (GS_APP (list->data)), ==, "a");
list_dup = gs_plugin_list_copy (list);
gs_plugin_list_free (list);
g_assert_cmpint (g_list_length (list_dup), ==, 1);
- g_assert_cmpstr (gs_app_get_id (GS_APP (list_dup->data)), ==, "a");
+ g_assert_cmpstr (as_app_get_id (GS_APP (list_dup->data)), ==, "a");
gs_plugin_list_free (list_dup);
/* test removing obects */
@@ -259,7 +259,7 @@ gs_plugin_func (void)
g_assert_cmpint (g_list_length (list_remove), ==, 3);
gs_plugin_list_filter (&list_remove, gs_plugin_list_filter_cb, NULL);
g_assert_cmpint (g_list_length (list_remove), ==, 1);
- g_assert_cmpstr (gs_app_get_id (GS_APP (list_remove->data)), ==, "b");
+ g_assert_cmpstr (as_app_get_id (GS_APP (list_remove->data)), ==, "b");
/* test removing duplicates */
app = gs_app_new ("b");
@@ -270,21 +270,21 @@ gs_plugin_func (void)
g_object_unref (app);
gs_plugin_list_filter_duplicates (&list_remove);
g_assert_cmpint (g_list_length (list_remove), ==, 1);
- g_assert_cmpstr (gs_app_get_id (GS_APP (list_remove->data)), ==, "b");
+ g_assert_cmpstr (as_app_get_id (GS_APP (list_remove->data)), ==, "b");
gs_plugin_list_free (list_remove);
}
static void
gs_app_subsume_func (void)
{
- GsApp *new;
- GsApp *old;
+ AsApp *new;
+ AsApp *old;
new = gs_app_new ("xxx.desktop");
old = gs_app_new ("yyy.desktop");
- gs_app_set_metadata (old, "foo", "bar");
+ as_app_add_metadata (old, "foo", "bar");
gs_app_subsume (new, old);
- g_assert_cmpstr (gs_app_get_metadata_item (new, "foo"), ==, "bar");
+ g_assert_cmpstr (as_app_get_metadata_item (new, "foo"), ==, "bar");
g_object_unref (new);
g_object_unref (old);
@@ -293,12 +293,12 @@ gs_app_subsume_func (void)
static void
gs_app_func (void)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_new ("gnome-software");
g_assert (GS_IS_APP (app));
- g_assert_cmpstr (gs_app_get_id (app), ==, "gnome-software");
+ g_assert_cmpstr (as_app_get_id (app), ==, "gnome-software");
/* check we clean up the version, but not at the expense of having
* the same string as the update version */
@@ -311,11 +311,11 @@ gs_app_func (void)
/* check the quality stuff works */
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "dave");
- g_assert_cmpstr (gs_app_get_name (app), ==, "dave");
+ g_assert_cmpstr (as_app_get_name (app, NULL), ==, "dave");
gs_app_set_name (app, GS_APP_QUALITY_LOWEST, "brian");
- g_assert_cmpstr (gs_app_get_name (app), ==, "dave");
+ g_assert_cmpstr (as_app_get_name (app, NULL), ==, "dave");
gs_app_set_name (app, GS_APP_QUALITY_HIGHEST, "hugh");
- g_assert_cmpstr (gs_app_get_name (app), ==, "hugh");
+ g_assert_cmpstr (as_app_get_name (app, NULL), ==, "hugh");
g_object_unref (app);
}
@@ -324,7 +324,7 @@ static guint _status_changed_cnt = 0;
static void
gs_plugin_loader_status_changed_cb (GsPluginLoader *plugin_loader,
- GsApp *app,
+ AsApp *app,
GsPluginStatus status,
gpointer user_data)
{
@@ -334,8 +334,8 @@ gs_plugin_loader_status_changed_cb (GsPluginLoader *plugin_loader,
static void
gs_plugin_loader_dedupe_func (void)
{
- GsApp *app1;
- GsApp *app2;
+ AsApp *app1;
+ AsApp *app2;
GsPluginLoader *loader;
loader = gs_plugin_loader_new ();
@@ -344,16 +344,16 @@ gs_plugin_loader_dedupe_func (void)
app1 = gs_app_new ("app1");
gs_app_set_description (app1, GS_APP_QUALITY_NORMAL, "description");
app1 = gs_plugin_loader_dedupe (loader, app1);
- g_assert_cmpstr (gs_app_get_id (app1), ==, "app1");
- g_assert_cmpstr (gs_app_get_description (app1), ==, "description");
+ g_assert_cmpstr (as_app_get_id (app1), ==, "app1");
+ g_assert_cmpstr (as_app_get_description (app1), ==, "description");
app2 = gs_app_new ("app1");
app2 = gs_plugin_loader_dedupe (loader, app2);
- g_assert_cmpstr (gs_app_get_id (app2), ==, "app1");
- g_assert_cmpstr (gs_app_get_description (app2), ==, "description");
+ g_assert_cmpstr (as_app_get_id (app2), ==, "app1");
+ g_assert_cmpstr (as_app_get_description (app2), ==, "description");
app2 = gs_plugin_loader_dedupe (loader, app2);
- g_assert_cmpstr (gs_app_get_id (app2), ==, "app1");
- g_assert_cmpstr (gs_app_get_description (app2), ==, "description");
+ g_assert_cmpstr (as_app_get_id (app2), ==, "app1");
+ g_assert_cmpstr (as_app_get_description (app2), ==, "description");
g_object_unref (app1);
g_object_unref (app2);
@@ -368,7 +368,7 @@ gs_plugin_loader_func (void)
GError *error = NULL;
GList *list;
GList *l;
- GsApp *app;
+ AsApp *app;
GsPluginLoader *loader;
/* not avaiable in make distcheck */
@@ -408,12 +408,12 @@ gs_plugin_loader_func (void)
g_assert_cmpint (_status_changed_cnt, ==, 1);
g_assert_cmpint (g_list_length (list), ==, 6);
app = g_list_nth_data (list, 0);
- g_assert_cmpstr (gs_app_get_id (app), ==, "gnome-boxes");
- g_assert_cmpstr (gs_app_get_name (app), ==, "Boxes");
+ g_assert_cmpstr (as_app_get_id (app), ==, "gnome-boxes");
+ g_assert_cmpstr (as_app_get_name (app, NULL), ==, "Boxes");
app = g_list_nth_data (list, 1);
- g_assert_cmpstr (gs_app_get_id (app), ==, "gedit");
- g_assert_cmpstr (gs_app_get_summary (app), ==, "Edit text files");
+ g_assert_cmpstr (as_app_get_id (app), ==, "gedit");
+ g_assert_cmpstr (as_app_get_comment (app, NULL), ==, "Edit text files");
gs_plugin_list_free (list);
@@ -425,15 +425,15 @@ gs_plugin_loader_func (void)
g_assert_cmpint (_status_changed_cnt, >=, 1);
g_assert_cmpint (g_list_length (list), ==, 2);
app = g_list_nth_data (list, 0);
- g_assert_cmpstr (gs_app_get_id (app), ==,
"os-update:gnome-boxes-libs;0.0.1;i386;updates-testing,libvirt-glib-devel;0.0.1;noarch;fedora");
- g_assert_cmpstr (gs_app_get_name (app), ==, "OS Updates");
-// g_assert_cmpstr (gs_app_get_summary (app), ==, "Includes performance, stability and security
improvements for all users\nDo not segfault when using newer versons of libvirt.\nFix several memory leaks.");
+ g_assert_cmpstr (as_app_get_id (app), ==,
"os-update:gnome-boxes-libs;0.0.1;i386;updates-testing,libvirt-glib-devel;0.0.1;noarch;fedora");
+ g_assert_cmpstr (as_app_get_name (app, NULL), ==, "OS Updates");
+// g_assert_cmpstr (as_app_get_comment (app, NULL), ==, "Includes performance, stability and security
improvements for all users\nDo not segfault when using newer versons of libvirt.\nFix several memory leaks.");
g_assert_cmpint (gs_app_get_kind (app), ==, GS_APP_KIND_OS_UPDATE);
app = g_list_nth_data (list, 1);
- g_assert_cmpstr (gs_app_get_id (app), ==, "gnome-boxes");
- g_assert_cmpstr (gs_app_get_name (app), ==, "Boxes");
- g_assert_cmpstr (gs_app_get_summary (app), ==, "Do not segfault when using newer versons of
libvirt.");
+ g_assert_cmpstr (as_app_get_id (app), ==, "gnome-boxes");
+ g_assert_cmpstr (as_app_get_name (app, NULL), ==, "Boxes");
+ g_assert_cmpstr (as_app_get_comment (app, NULL), ==, "Do not segfault when using newer versons of
libvirt.");
g_assert_cmpint (gs_app_get_kind (app), ==, GS_APP_KIND_NORMAL);
gs_plugin_list_free (list);
@@ -453,14 +453,14 @@ gs_plugin_loader_func (void)
/* find a specific app */
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (g_strcmp0 (gs_app_get_id (app), "gnome-screenshot") == 0)
+ app = AS_APP (l->data);
+ if (g_strcmp0 (as_app_get_id (app), "gnome-screenshot") == 0)
break;
}
- g_assert_cmpstr (gs_app_get_id (app), ==, "gnome-screenshot");
- g_assert_cmpstr (gs_app_get_name (app), ==, "Screenshot");
- g_assert_cmpstr (gs_app_get_summary (app), ==, "Save images of your screen or individual windows");
- g_assert_cmpint (gs_app_get_state (app), ==, AS_APP_STATE_INSTALLED);
+ g_assert_cmpstr (as_app_get_id (app), ==, "gnome-screenshot");
+ g_assert_cmpstr (as_app_get_name (app, NULL), ==, "Screenshot");
+ g_assert_cmpstr (as_app_get_comment (app, NULL), ==, "Save images of your screen or individual
windows");
+ g_assert_cmpint (as_app_get_state (app), ==, AS_APP_STATE_INSTALLED);
g_assert_cmpint (gs_app_get_kind (app), ==, GS_APP_KIND_SYSTEM);
g_assert (gs_app_get_pixbuf (app) != NULL);
gs_plugin_list_free (list);
@@ -509,7 +509,7 @@ static void
gs_plugin_loader_refine_func (void)
{
GError *error = NULL;
- GsApp *app;
+ AsApp *app;
GsPluginLoader *loader;
const gchar *url;
gboolean ret;
@@ -542,9 +542,9 @@ gs_plugin_loader_refine_func (void)
g_assert_no_error (error);
g_assert (ret);
- g_assert_cmpstr (gs_app_get_licence (app), ==, "<a
href=\"http://spdx.org/licenses/GPL-3.0+\">GPL-3.0+</a> and <a
href=\"http://spdx.org/licenses/GPL-3.0\">GPL-3.0</a>");
- g_assert_cmpstr (gs_app_get_description (app), !=, NULL);
- url = gs_app_get_url (app, GS_APP_URL_KIND_HOMEPAGE);
+ g_assert_cmpstr (as_app_get_project_license (app), ==, "<a
href=\"http://spdx.org/licenses/GPL-3.0+\">GPL-3.0+</a> and <a
href=\"http://spdx.org/licenses/GPL-3.0\">GPL-3.0</a>");
+ g_assert_cmpstr (as_app_get_description (app, NULL), !=, NULL);
+ url = as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE);
g_assert_cmpstr (url, ==, "http://www.gimp.org/");
g_object_unref (app);
@@ -624,7 +624,7 @@ gs_plugin_loader_empty_func (void)
gs_category_get_id (category),
gs_category_get_id (sub),
gs_app_get_source_default (GS_APP (g->data)),
- gs_app_get_id (GS_APP (g->data)));
+ as_app_get_id (GS_APP (g->data)));
}
}
g_debug ("APPS[%i]:\t%s/%s",
@@ -646,7 +646,7 @@ static void
gs_plugin_loader_webapps_func (void)
{
GsPluginLoader *loader;
- GsApp *app;
+ AsApp *app;
gchar *path;
gboolean ret;
GError *error = NULL;
@@ -693,7 +693,7 @@ gs_plugin_loader_webapps_func (void)
&error);
g_assert_no_error (error);
g_assert (ret);
- g_assert_cmpint (gs_app_get_state (app), ==, AS_APP_STATE_UNAVAILABLE);
+ g_assert_cmpint (as_app_get_state (app), ==, AS_APP_STATE_UNAVAILABLE);
g_unlink (path);
g_free (path);
diff --git a/src/gs-shell-category.c b/src/gs-shell-category.c
index 284847a..5602b31 100644
--- a/src/gs-shell-category.c
+++ b/src/gs-shell-category.c
@@ -68,7 +68,7 @@ static void
app_tile_clicked (GsAppTile *tile, gpointer data)
{
GsShellCategory *shell = GS_SHELL_CATEGORY (data);
- GsApp *app;
+ AsApp *app;
app = gs_app_tile_get_app (tile);
gs_shell_show_app (shell->priv->shell, app);
@@ -86,7 +86,7 @@ gs_shell_category_get_apps_cb (GObject *source_object,
gint i = 0;
GList *l;
GList *list;
- GsApp *app;
+ AsApp *app;
GtkWidget *tile;
GsShellCategory *shell = GS_SHELL_CATEGORY (user_data);
GsShellCategoryPrivate *priv = shell->priv;
@@ -106,7 +106,7 @@ gs_shell_category_get_apps_cb (GObject *source_object,
gtk_grid_remove_column (GTK_GRID (priv->category_detail_grid), 0);
for (l = list, i = 0; l != NULL; l = l->next, i++) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
tile = gs_app_tile_new (app);
g_signal_connect (tile, "clicked",
G_CALLBACK (app_tile_clicked), shell);
diff --git a/src/gs-shell-details.c b/src/gs-shell-details.c
index d4c66bc..39204b4 100644
--- a/src/gs-shell-details.c
+++ b/src/gs-shell-details.c
@@ -48,7 +48,7 @@ struct GsShellDetailsPrivate
GtkBuilder *builder;
GCancellable *cancellable;
gboolean cache_valid;
- GsApp *app;
+ AsApp *app;
GsShell *shell;
GtkWidget *history_dialog;
GtkWidget *star;
@@ -156,7 +156,7 @@ gs_shell_details_refresh (GsShellDetails *shell_details)
gtk_widget_show (widget);
kind = gs_app_get_kind (priv->app);
- state = gs_app_get_state (priv->app);
+ state = as_app_get_state (priv->app);
/* label */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "header_label"));
@@ -286,7 +286,7 @@ gs_shell_details_refresh (GsShellDetails *shell_details)
* gs_shell_details_notify_state_changed_cb:
**/
static void
-gs_shell_details_notify_state_changed_cb (GsApp *app,
+gs_shell_details_notify_state_changed_cb (AsApp *app,
GParamSpec *pspec,
GsShellDetails *shell_details)
{
@@ -332,10 +332,10 @@ gs_shell_details_refresh_screenshots (GsShellDetails *shell_details)
guint i;
/* treat screenshots differently */
- if (gs_app_get_id_kind (priv->app) == AS_ID_KIND_FONT) {
+ if (as_app_get_id_kind (priv->app) == AS_ID_KIND_FONT) {
gs_container_remove_all (GTK_CONTAINER (priv->box_details_screenshot_thumbnails));
gs_container_remove_all (GTK_CONTAINER (priv->box_details_screenshot_main));
- screenshots = gs_app_get_screenshots (priv->app);
+ screenshots = as_app_get_screenshots (priv->app);
for (i = 0; i < screenshots->len; i++) {
ss = g_ptr_array_index (screenshots, i);
@@ -364,7 +364,7 @@ gs_shell_details_refresh_screenshots (GsShellDetails *shell_details)
/* set screenshots */
gs_container_remove_all (GTK_CONTAINER (priv->box_details_screenshot_main));
- screenshots = gs_app_get_screenshots (priv->app);
+ screenshots = as_app_get_screenshots (priv->app);
gtk_widget_set_visible (priv->box_details_screenshot, screenshots->len > 0);
if (screenshots->len == 0) {
gs_container_remove_all (GTK_CONTAINER (priv->box_details_screenshot_thumbnails));
@@ -437,7 +437,7 @@ gs_shell_details_website_cb (GtkWidget *widget, GsShellDetails *shell_details)
const gchar *url;
gboolean ret;
- url = gs_app_get_url (priv->app, GS_APP_URL_KIND_HOMEPAGE);
+ url = as_app_get_url_item (priv->app, AS_URL_KIND_HOMEPAGE);
ret = gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error);
if (!ret) {
g_warning ("spawn of '%s' failed", url);
@@ -492,10 +492,10 @@ out:
* gs_shell_details_is_addon_id_kind
**/
static gboolean
-gs_shell_details_is_addon_id_kind (GsApp *app)
+gs_shell_details_is_addon_id_kind (AsApp *app)
{
AsIdKind id_kind;
- id_kind = gs_app_get_id_kind (app);
+ id_kind = as_app_get_id_kind (app);
if (id_kind == AS_ID_KIND_DESKTOP)
return FALSE;
if (id_kind == AS_ID_KIND_WEB_APP)
@@ -520,7 +520,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
guint64 updated;
/* change widgets */
- tmp = gs_app_get_name (priv->app);
+ tmp = as_app_get_name (priv->app, NULL);
widget2 = GTK_WIDGET (gtk_builder_get_object (priv->builder, "application_details_header"));
if (tmp != NULL && tmp[0] != '\0') {
gtk_label_set_label (GTK_LABEL (priv->application_details_title), tmp);
@@ -530,7 +530,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
gtk_widget_set_visible (priv->application_details_title, FALSE);
gtk_label_set_label (GTK_LABEL (widget2), "");
}
- tmp = gs_app_get_summary (priv->app);
+ tmp = as_app_get_comment (priv->app, NULL);
if (tmp != NULL && tmp[0] != '\0') {
gtk_label_set_label (GTK_LABEL (priv->application_details_summary), tmp);
gtk_widget_set_visible (priv->application_details_summary, TRUE);
@@ -539,11 +539,11 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* set the description */
- tmp = gs_app_get_description (priv->app);
+ tmp = as_app_get_description (priv->app, NULL);
gs_shell_details_set_description (shell_details, tmp);
/* set the icon */
- tmp = gs_app_get_metadata_item (priv->app, "DataDir::desktop-icon");
+ tmp = as_app_get_metadata_item (priv->app, "DataDir::desktop-icon");
if (tmp != NULL) {
pixbuf = gs_pixbuf_load (tmp, 96, &error);
if (pixbuf == NULL) {
@@ -554,7 +554,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
if (pixbuf == NULL)
pixbuf = gs_app_get_pixbuf (priv->app);
- if (pixbuf == NULL && gs_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL) {
+ if (pixbuf == NULL && as_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL) {
if (gs_app_get_kind (priv->app) == GS_APP_KIND_SOURCE)
pixbuf = gs_pixbuf_load ("x-package-repository", 96, NULL);
else if (gs_shell_details_is_addon_id_kind (priv->app))
@@ -569,7 +569,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
gtk_widget_set_visible (priv->application_details_icon, FALSE);
}
- tmp = gs_app_get_url (priv->app, GS_APP_URL_KIND_HOMEPAGE);
+ tmp = as_app_get_url_item (priv->app, AS_URL_KIND_HOMEPAGE);
if (tmp != NULL && tmp[0] != '\0') {
gtk_widget_set_visible (priv->button_details_website, TRUE);
} else {
@@ -577,7 +577,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* set the project group */
- tmp = gs_app_get_project_group (priv->app);
+ tmp = as_app_get_project_group (priv->app);
if (tmp == NULL) {
gtk_widget_set_visible (priv->label_details_developer_title, FALSE);
gtk_widget_set_visible (priv->label_details_developer_value, FALSE);
@@ -588,7 +588,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* set the licence */
- tmp = gs_app_get_licence (priv->app);
+ tmp = as_app_get_project_license (priv->app);
if (tmp == NULL) {
/* TRANSLATORS: this is where the licence is not known */
gtk_label_set_label (GTK_LABEL (priv->label_details_licence_value), C_("license", "Unknown"));
@@ -655,14 +655,14 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
gtk_label_set_label (GTK_LABEL (priv->label_details_origin_value), tmp);
}
gtk_widget_set_visible (priv->label_details_origin_value,
- gs_app_get_state (priv->app) == AS_APP_STATE_INSTALLED ||
- gs_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
+ as_app_get_state (priv->app) == AS_APP_STATE_INSTALLED ||
+ as_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
gtk_widget_set_visible (priv->label_details_origin_title,
- gs_app_get_state (priv->app) == AS_APP_STATE_INSTALLED ||
- gs_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
+ as_app_get_state (priv->app) == AS_APP_STATE_INSTALLED ||
+ as_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
/* set the rating */
- switch (gs_app_get_id_kind (priv->app)) {
+ switch (as_app_get_id_kind (priv->app)) {
case AS_ID_KIND_WEB_APP:
gtk_widget_set_visible (priv->star, FALSE);
break;
@@ -681,20 +681,20 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* don't show a missing rating on a local file */
- if (gs_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL &&
+ if (as_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL &&
gs_app_get_rating (priv->app) < 0)
gtk_widget_set_visible (priv->star, FALSE);
/* only mark the stars as sensitive if the application is installed */
gtk_widget_set_sensitive (priv->star,
- gs_app_get_state (priv->app) == AS_APP_STATE_INSTALLED);
+ as_app_get_state (priv->app) == AS_APP_STATE_INSTALLED);
/* only show launch button when the application is installed */
- switch (gs_app_get_state (priv->app)) {
+ switch (as_app_get_state (priv->app)) {
case AS_APP_STATE_INSTALLED:
case AS_APP_STATE_UPDATABLE:
- if (gs_app_get_id_kind (priv->app) == AS_ID_KIND_DESKTOP ||
- gs_app_get_id_kind (priv->app) == AS_ID_KIND_WEB_APP) {
+ if (as_app_get_id_kind (priv->app) == AS_ID_KIND_DESKTOP ||
+ as_app_get_id_kind (priv->app) == AS_ID_KIND_WEB_APP) {
gtk_widget_set_visible (priv->button_details_launch, TRUE);
} else {
gtk_widget_set_visible (priv->button_details_launch, FALSE);
@@ -707,7 +707,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
/* make history button insensitive if there is none */
history = gs_app_get_history (priv->app);
- switch (gs_app_get_id_kind (priv->app)) {
+ switch (as_app_get_id_kind (priv->app)) {
case AS_ID_KIND_WEB_APP:
gtk_widget_set_visible (priv->button_history, FALSE);
break;
@@ -718,7 +718,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* don't show missing history on a local file */
- if (gs_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL &&
+ if (as_app_get_state (priv->app) == AS_APP_STATE_AVAILABLE_LOCAL &&
history->len == 0)
gtk_widget_set_visible (priv->button_history, FALSE);
@@ -735,7 +735,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
/* is this a repo-release */
switch (gs_app_get_kind (priv->app)) {
case GS_APP_KIND_SOURCE:
- gtk_widget_set_visible (priv->infobar_details_repo, gs_app_get_state (priv->app) ==
AS_APP_STATE_AVAILABLE_LOCAL);
+ gtk_widget_set_visible (priv->infobar_details_repo, as_app_get_state (priv->app) ==
AS_APP_STATE_AVAILABLE_LOCAL);
break;
default:
gtk_widget_set_visible (priv->infobar_details_repo, FALSE);
@@ -743,11 +743,11 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* installing a app with a repo file */
- tmp = gs_app_get_metadata_item (priv->app, "PackageKit::has-source");
+ tmp = as_app_get_metadata_item (priv->app, "PackageKit::has-source");
switch (gs_app_get_kind (priv->app)) {
case GS_APP_KIND_NORMAL:
case GS_APP_KIND_SYSTEM:
- gtk_widget_set_visible (priv->infobar_details_app_repo, tmp != NULL && gs_app_get_state
(priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
+ gtk_widget_set_visible (priv->infobar_details_app_repo, tmp != NULL && as_app_get_state
(priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
break;
default:
gtk_widget_set_visible (priv->infobar_details_app_repo, FALSE);
@@ -758,7 +758,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
switch (gs_app_get_kind (priv->app)) {
case GS_APP_KIND_NORMAL:
case GS_APP_KIND_SYSTEM:
- gtk_widget_set_visible (priv->infobar_details_app_norepo, tmp == NULL && gs_app_get_state
(priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
+ gtk_widget_set_visible (priv->infobar_details_app_norepo, tmp == NULL && as_app_get_state
(priv->app) == AS_APP_STATE_AVAILABLE_LOCAL);
break;
default:
gtk_widget_set_visible (priv->infobar_details_app_norepo, FALSE);
@@ -766,7 +766,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* installing a webapp */
- switch (gs_app_get_id_kind (priv->app)) {
+ switch (as_app_get_id_kind (priv->app)) {
case AS_ID_KIND_WEB_APP:
gtk_widget_set_visible (priv->infobar_details_webapp, TRUE);
break;
@@ -776,7 +776,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
}
/* only show the "select addons" string if the app isn't yet installed */
- switch (gs_app_get_state (priv->app)) {
+ switch (as_app_get_state (priv->app)) {
case AS_APP_STATE_INSTALLED:
case AS_APP_STATE_UPDATABLE:
gtk_widget_set_visible (priv->label_addons_uninstalled_app, FALSE);
@@ -790,7 +790,7 @@ gs_shell_details_refresh_all (GsShellDetails *shell_details)
gtk_widget_set_visible (priv->box_addons, addons != NULL);
for (l = addons; l; l = l->next) {
/* show checkboxes in front of addons if the app isn't yet installed */
- switch (gs_app_get_state (priv->app)) {
+ switch (as_app_get_state (priv->app)) {
case AS_APP_STATE_INSTALLED:
case AS_APP_STATE_UPDATABLE:
break;
@@ -817,11 +817,11 @@ list_sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
- GsApp *a1 = gs_app_addon_row_get_addon (GS_APP_ADDON_ROW (a));
- GsApp *a2 = gs_app_addon_row_get_addon (GS_APP_ADDON_ROW (b));
+ AsApp *a1 = gs_app_addon_row_get_addon (GS_APP_ADDON_ROW (a));
+ AsApp *a2 = gs_app_addon_row_get_addon (GS_APP_ADDON_ROW (b));
- return g_strcmp0 (gs_app_get_name (a1),
- gs_app_get_name (a2));
+ return g_strcmp0 (as_app_get_name (a1, NULL),
+ as_app_get_name (a2, NULL));
}
static void gs_shell_details_addon_selected_cb (GsAppAddonRow *row, GParamSpec *pspec, GsShellDetails
*shell_details);
@@ -837,7 +837,7 @@ gs_shell_details_refresh_addons (GsShellDetails *shell_details)
addons = gs_app_get_addons (priv->app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon;
+ AsApp *addon;
GtkWidget *row;
addon = g_ptr_array_index (addons, i);
@@ -872,7 +872,7 @@ gs_shell_details_app_refine_cb (GObject *source,
&error);
if (!ret) {
g_warning ("failed to refine %s: %s",
- gs_app_get_id (priv->app),
+ as_app_get_id (priv->app),
error->message);
g_error_free (error);
return;
@@ -902,7 +902,7 @@ gs_shell_details_filename_to_app_cb (GObject *source,
res,
&error);
if (priv->app == NULL) {
- g_warning ("failed to convert to GsApp: %s", error->message);
+ g_warning ("failed to convert to AsApp: %s", error->message);
g_error_free (error);
return;
}
@@ -952,7 +952,7 @@ gs_shell_details_set_filename (GsShellDetails *shell_details, const gchar *filen
* gs_shell_details_set_app:
**/
void
-gs_shell_details_set_app (GsShellDetails *shell_details, GsApp *app)
+gs_shell_details_set_app (GsShellDetails *shell_details, AsApp *app)
{
GsShellDetailsPrivate *priv = shell_details->priv;
gchar *app_dump;
@@ -1000,7 +1000,7 @@ gs_shell_details_set_app (GsShellDetails *shell_details, GsApp *app)
gs_shell_details_refresh_all (shell_details);
}
-GsApp *
+AsApp *
gs_shell_details_get_app (GsShellDetails *shell_details)
{
return shell_details->priv->app;
@@ -1008,7 +1008,7 @@ gs_shell_details_get_app (GsShellDetails *shell_details)
typedef struct {
GsShellDetails *shell_details;
- GsApp *app;
+ AsApp *app;
} GsShellDetailsHelper;
/**
@@ -1029,7 +1029,7 @@ gs_shell_details_app_installed_cb (GObject *source,
&error);
if (!ret) {
g_warning ("failed to install %s: %s",
- gs_app_get_id (helper->app),
+ as_app_get_id (helper->app),
error->message);
gs_app_notify_failed_modal (helper->shell_details->priv->builder,
helper->app,
@@ -1040,7 +1040,7 @@ gs_shell_details_app_installed_cb (GObject *source,
}
/* only show this if the window is not active */
- if (gs_app_get_state (helper->app) != AS_APP_STATE_QUEUED_FOR_INSTALL &&
+ if (as_app_get_state (helper->app) != AS_APP_STATE_QUEUED_FOR_INSTALL &&
!gs_shell_is_active (helper->shell_details->priv->shell))
gs_app_notify_installed (helper->app);
gs_shell_details_refresh_all (helper->shell_details);
@@ -1067,7 +1067,7 @@ gs_shell_details_app_removed_cb (GObject *source,
&error);
if (!ret) {
g_warning ("failed to remove %s: %s",
- gs_app_get_id (helper->app),
+ as_app_get_id (helper->app),
error->message);
gs_app_notify_failed_modal (helper->shell_details->priv->builder,
helper->app,
@@ -1087,7 +1087,7 @@ gs_shell_details_app_removed_cb (GObject *source,
* gs_shell_details_app_remove
**/
static void
-gs_shell_details_app_remove (GsShellDetails *shell_details, GsApp *app)
+gs_shell_details_app_remove (GsShellDetails *shell_details, AsApp *app)
{
GsShellDetailsHelper *helper;
GsShellDetailsPrivate *priv = shell_details->priv;
@@ -1102,7 +1102,7 @@ gs_shell_details_app_remove (GsShellDetails *shell_details, GsApp *app)
/* TRANSLATORS: this is a prompt message, and
* '%s' is an application summary, e.g. 'GNOME Clocks' */
_("Are you sure you want to remove %s?"),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
g_string_prepend (markup, "<b>");
g_string_append (markup, "</b>");
dialog = gtk_message_dialog_new (window,
@@ -1114,15 +1114,15 @@ gs_shell_details_app_remove (GsShellDetails *shell_details, GsApp *app)
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
/* TRANSLATORS: longer dialog text */
_("%s will be removed, and you will have to install it to
use it again."),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
/* TRANSLATORS: this is button text to remove the application */
gtk_dialog_add_button (GTK_DIALOG (dialog), _("Remove"), GTK_RESPONSE_OK);
- if (gs_app_get_state (app) == AS_APP_STATE_INSTALLED)
+ if (as_app_get_state (app) == AS_APP_STATE_INSTALLED)
response = gtk_dialog_run (GTK_DIALOG (dialog));
else
response = GTK_RESPONSE_OK; /* pending install */
if (response == GTK_RESPONSE_OK) {
- g_debug ("remove %s", gs_app_get_id (app));
+ g_debug ("remove %s", as_app_get_id (app));
helper = g_new0 (GsShellDetailsHelper, 1);
helper->shell_details = g_object_ref (shell_details);
helper->app = g_object_ref (app);
@@ -1152,7 +1152,7 @@ gs_shell_details_app_remove_button_cb (GtkWidget *widget, GsShellDetails *shell_
* gs_shell_details_app_install:
**/
static void
-gs_shell_details_app_install (GsShellDetails *shell_details, GsApp *app)
+gs_shell_details_app_install (GsShellDetails *shell_details, AsApp *app)
{
GsShellDetailsPrivate *priv = shell_details->priv;
GsShellDetailsHelper *helper;
@@ -1181,9 +1181,9 @@ gs_shell_details_app_install_button_cb (GtkWidget *widget, GsShellDetails *shell
addons = gtk_container_get_children (GTK_CONTAINER (priv->list_box_addons));
for (l = addons; l; l = l->next) {
if (gs_app_addon_row_get_selected (l->data)) {
- GsApp *addon = gs_app_addon_row_get_addon (l->data);
+ AsApp *addon = gs_app_addon_row_get_addon (l->data);
- if (gs_app_get_state (addon) == AS_APP_STATE_AVAILABLE)
+ if (as_app_get_state (addon) == AS_APP_STATE_AVAILABLE)
gs_app_set_to_be_installed (addon, TRUE);
}
}
@@ -1201,14 +1201,14 @@ gs_shell_details_addon_selected_cb (GsAppAddonRow *row,
GsShellDetails *shell_details)
{
GsShellDetailsPrivate *priv = shell_details->priv;
- GsApp *addon;
+ AsApp *addon;
addon = gs_app_addon_row_get_addon (row);
/* If the main app is already installed, ticking the addon checkbox
* triggers an immediate install. Otherwise we'll install the addon
* together with the main app. */
- switch (gs_app_get_state (priv->app)) {
+ switch (as_app_get_state (priv->app)) {
case AS_APP_STATE_INSTALLED:
case AS_APP_STATE_UPDATABLE:
if (gs_app_addon_row_get_selected (row))
@@ -1233,7 +1233,7 @@ gs_shell_details_app_launch_button_cb (GtkWidget *widget, GsShellDetails *shell_
GdkDisplay *display;
const gchar *desktop_id;
- desktop_id = gs_app_get_id_full (shell_details->priv->app);
+ desktop_id = as_app_get_id_full (shell_details->priv->app);
display = gdk_display_get_default ();
appinfo = G_APP_INFO (g_desktop_app_info_new (desktop_id));
if (appinfo == NULL) {
@@ -1286,7 +1286,7 @@ gs_shell_details_app_set_ratings_cb (GObject *source,
&error);
if (!ret) {
g_warning ("failed to set rating %s: %s",
- gs_app_get_id (priv->app),
+ as_app_get_id (priv->app),
error->message);
g_error_free (error);
}
@@ -1303,7 +1303,7 @@ gs_shell_details_rating_changed_cb (GsStarWidget *star,
GsShellDetailsPrivate *priv = shell_details->priv;
g_debug ("%s rating changed from %i%% to %i%%",
- gs_app_get_id (priv->app),
+ as_app_get_id (priv->app),
gs_app_get_rating (priv->app),
rating);
diff --git a/src/gs-shell-details.h b/src/gs-shell-details.h
index 000961f..c1485c9 100644
--- a/src/gs-shell-details.h
+++ b/src/gs-shell-details.h
@@ -56,10 +56,10 @@ GType gs_shell_details_get_type (void);
GsShellDetails *gs_shell_details_new (void);
void gs_shell_details_invalidate (GsShellDetails *shell_details);
void gs_shell_details_set_app (GsShellDetails *shell_details,
- GsApp *app);
+ AsApp *app);
void gs_shell_details_set_filename (GsShellDetails *shell_details,
const gchar *filename);
-GsApp *gs_shell_details_get_app (GsShellDetails *shell_details);
+AsApp *gs_shell_details_get_app (GsShellDetails *shell_details);
void gs_shell_details_refresh (GsShellDetails *shell_details);
void gs_shell_details_setup (GsShellDetails *shell_details,
GsShell *shell,
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index e37910a..f3ef5ab 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -83,7 +83,7 @@ gs_shell_installed_app_row_activated_cb (GtkListBox *list_box,
selected = gs_app_row_get_selected (GS_APP_ROW (row));
gs_app_row_set_selected (GS_APP_ROW (row), !selected);
} else {
- GsApp *app;
+ AsApp *app;
app = gs_app_row_get_app (GS_APP_ROW (row));
gs_shell_show_app (shell_installed->priv->shell, app);
}
@@ -115,7 +115,7 @@ gs_shell_installed_app_removed_cb (GObject *source,
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source);
GsShellInstalledHelper *helper = (GsShellInstalledHelper *) user_data;
GsShellInstalledPrivate *priv = helper->shell_installed->priv;
- GsApp *app;
+ AsApp *app;
gboolean ret;
ret = gs_plugin_loader_app_action_finish (plugin_loader,
@@ -124,7 +124,7 @@ gs_shell_installed_app_removed_cb (GObject *source,
if (!ret) {
app = gs_app_row_get_app (helper->app_row);
g_warning ("failed to remove %s: %s",
- gs_app_get_id (app),
+ as_app_get_id (app),
error->message);
gs_app_notify_failed_modal (priv->builder,
app,
@@ -134,7 +134,7 @@ gs_shell_installed_app_removed_cb (GObject *source,
} else {
/* remove from the list */
app = gs_app_row_get_app (helper->app_row);
- g_debug ("removed %s", gs_app_get_id (app));
+ g_debug ("removed %s", as_app_get_id (app));
gs_app_row_unreveal (helper->app_row);
g_signal_connect (helper->app_row, "unrevealed",
G_CALLBACK (row_unrevealed), NULL);
@@ -152,7 +152,7 @@ static void
gs_shell_installed_app_remove_cb (GsAppRow *app_row,
GsShellInstalled *shell_installed)
{
- GsApp *app;
+ AsApp *app;
GsShellInstalledPrivate *priv = shell_installed->priv;
GString *markup;
GtkResponseType response;
@@ -167,7 +167,7 @@ gs_shell_installed_app_remove_cb (GsAppRow *app_row,
/* TRANSLATORS: this is a prompt message, and
* '%s' is an application summary, e.g. 'GNOME Clocks' */
_("Are you sure you want to remove %s?"),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
g_string_prepend (markup, "<b>");
g_string_append (markup, "</b>");
dialog = gtk_message_dialog_new (window,
@@ -179,15 +179,15 @@ gs_shell_installed_app_remove_cb (GsAppRow *app_row,
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
/* TRANSLATORS: longer dialog text */
_("%s will be removed, and you will have to install it to
use it again."),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
/* TRANSLATORS: this is button text to remove the application */
gtk_dialog_add_button (GTK_DIALOG (dialog), _("Remove"), GTK_RESPONSE_OK);
- if (gs_app_get_state (app) == AS_APP_STATE_QUEUED_FOR_INSTALL)
+ if (as_app_get_state (app) == AS_APP_STATE_QUEUED_FOR_INSTALL)
response = GTK_RESPONSE_OK; /* pending install */
else
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_OK) {
- g_debug ("removing %s", gs_app_get_id (app));
+ g_debug ("removing %s", as_app_get_id (app));
helper = g_new0 (GsShellInstalledHelper, 1);
helper->shell_installed = g_object_ref (shell_installed);
helper->app_row = g_object_ref (app_row);
@@ -206,7 +206,7 @@ gs_shell_installed_app_remove_cb (GsAppRow *app_row,
* gs_shell_installed_notify_state_changed_cb:
**/
static void
-gs_shell_installed_notify_state_changed_cb (GsApp *app,
+gs_shell_installed_notify_state_changed_cb (AsApp *app,
GParamSpec *pspec,
GsShellInstalled *shell)
{
@@ -216,7 +216,7 @@ gs_shell_installed_notify_state_changed_cb (GsApp *app,
static void selection_changed (GsShellInstalled *shell);
static void
-gs_shell_installed_add_app (GsShellInstalled *shell, GsApp *app)
+gs_shell_installed_add_app (GsShellInstalled *shell, AsApp *app)
{
GsShellInstalledPrivate *priv = shell->priv;
GtkWidget *app_row;
@@ -253,7 +253,7 @@ gs_shell_installed_get_installed_cb (GObject *source_object,
GError *error = NULL;
GList *l;
GList *list;
- GsApp *app;
+ AsApp *app;
GsShellInstalled *shell_installed = GS_SHELL_INSTALLED (user_data);
GsShellInstalledPrivate *priv = shell_installed->priv;
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
@@ -273,7 +273,7 @@ gs_shell_installed_get_installed_cb (GObject *source_object,
goto out;
}
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
gs_shell_installed_add_app (shell_installed, app);
}
out:
@@ -353,7 +353,7 @@ gs_shell_installed_refresh (GsShellInstalled *shell_installed, gboolean scroll_u
* by name.
**/
static gchar *
-gs_shell_installed_get_app_sort_key (GsApp *app)
+gs_shell_installed_get_app_sort_key (AsApp *app)
{
GString *key;
gchar *casefolded_name;
@@ -361,7 +361,7 @@ gs_shell_installed_get_app_sort_key (GsApp *app)
key = g_string_sized_new (64);
/* sort installed, removing, other */
- switch (gs_app_get_state (app)) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_INSTALLING:
case AS_APP_STATE_QUEUED_FOR_INSTALL:
g_string_append (key, "1:");
@@ -375,7 +375,7 @@ gs_shell_installed_get_app_sort_key (GsApp *app)
}
/* sort desktop files, then addons */
- switch (gs_app_get_id_kind (app)) {
+ switch (as_app_get_id_kind (app)) {
case AS_ID_KIND_DESKTOP:
case AS_ID_KIND_WEB_APP:
g_string_append (key, "1:");
@@ -399,7 +399,7 @@ gs_shell_installed_get_app_sort_key (GsApp *app)
}
/* finally, sort by short name */
- casefolded_name = g_utf8_casefold (gs_app_get_name (app), -1);
+ casefolded_name = g_utf8_casefold (as_app_get_name (app, NULL), -1);
g_string_append (key, casefolded_name);
g_free (casefolded_name);
@@ -414,7 +414,7 @@ gs_shell_installed_sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
- GsApp *a1, *a2;
+ AsApp *a1, *a2;
gchar *key1 = NULL;
gchar *key2 = NULL;
gint retval = 0;
@@ -442,10 +442,10 @@ out:
* gs_shell_installed_is_addon_id_kind
**/
static gboolean
-gs_shell_installed_is_addon_id_kind (GsApp *app)
+gs_shell_installed_is_addon_id_kind (AsApp *app)
{
AsIdKind id_kind;
- id_kind = gs_app_get_id_kind (app);
+ id_kind = as_app_get_id_kind (app);
if (id_kind == AS_ID_KIND_DESKTOP)
return FALSE;
if (id_kind == AS_ID_KIND_WEB_APP)
@@ -454,9 +454,9 @@ gs_shell_installed_is_addon_id_kind (GsApp *app)
}
static gboolean
-gs_shell_installed_is_system_application (GsApp *app)
+gs_shell_installed_is_system_application (AsApp *app)
{
- if (gs_app_get_id_kind (app) == AS_ID_KIND_DESKTOP &&
+ if (as_app_get_id_kind (app) == AS_ID_KIND_DESKTOP &&
gs_app_get_kind (app) == GS_APP_KIND_SYSTEM)
return TRUE;
return FALSE;
@@ -506,7 +506,7 @@ gs_shell_installed_list_header_func (GtkListBoxRow *row,
static gboolean
gs_shell_installed_has_app (GsShellInstalled *shell_installed,
- GsApp *app)
+ AsApp *app)
{
GsShellInstalledPrivate *priv = shell_installed->priv;
GList *children, *l;
@@ -533,7 +533,7 @@ gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
GsShellInstalled *shell_installed)
{
GPtrArray *pending;
- GsApp *app;
+ AsApp *app;
GtkWidget *widget;
gchar *label;
guint i;
@@ -550,7 +550,7 @@ gs_shell_installed_pending_apps_changed_cb (GsPluginLoader *plugin_loader,
g_free (label);
}
for (i = 0; i < pending->len; i++) {
- app = GS_APP (g_ptr_array_index (pending, i));
+ app = AS_APP (g_ptr_array_index (pending, i));
/* Be careful not to add pending apps more than once. */
if (gs_shell_installed_has_app (shell_installed, app) == FALSE)
gs_shell_installed_add_app (shell_installed, app);
@@ -650,7 +650,7 @@ selection_changed (GsShellInstalled *shell_installed)
GsShellInstalledPrivate *priv = shell_installed->priv;
GsFolders *folders;
GList *apps, *l;
- GsApp *app;
+ AsApp *app;
gboolean has_folders, has_nonfolders;
folders = gs_folders_get ();
@@ -659,8 +659,8 @@ selection_changed (GsShellInstalled *shell_installed)
for (l = apps; l; l = l->next) {
app = l->data;
if (gs_folders_get_app_folder (folders,
- gs_app_get_id_full (app),
- gs_app_get_categories (app))) {
+ as_app_get_id_full (app),
+ as_app_get_categories (app))) {
has_folders = TRUE;
} else {
has_nonfolders = TRUE;
@@ -701,15 +701,15 @@ remove_folders (GtkButton *button, GsShellInstalled *shell_installed)
{
GList *apps, *l;
GsFolders *folders;
- GsApp *app;
+ AsApp *app;
folders = gs_folders_get ();
apps = get_selected_apps (shell_installed);
for (l = apps; l; l = l->next) {
app = l->data;
gs_folders_set_app_folder (folders,
- gs_app_get_id_full (app),
- gs_app_get_categories (app),
+ as_app_get_id_full (app),
+ as_app_get_categories (app),
NULL);
}
g_list_free (apps);
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index ed8ab1e..072c766 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -75,7 +75,7 @@ static void
popular_tile_clicked (GsPopularTile *tile, gpointer data)
{
GsShellOverview *shell = GS_SHELL_OVERVIEW (data);
- GsApp *app;
+ AsApp *app;
app = gs_popular_tile_get_app (tile);
gs_shell_show_app (shell->priv->shell, app);
@@ -95,7 +95,7 @@ gs_shell_overview_get_popular_cb (GObject *source_object,
GError *error = NULL;
GList *l;
GList *list;
- GsApp *app;
+ AsApp *app;
gint i;
GtkWidget *tile;
@@ -111,7 +111,7 @@ gs_shell_overview_get_popular_cb (GObject *source_object,
gs_container_remove_all (GTK_CONTAINER (priv->box_popular));
for (l = list, i = 0; l != NULL && i < 6; l = l->next, i++) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
tile = gs_popular_tile_new (app);
g_signal_connect (tile, "clicked",
G_CALLBACK (popular_tile_clicked), shell);
@@ -131,7 +131,7 @@ static void
feature_tile_clicked (GsFeatureTile *tile, gpointer data)
{
GsShellOverview *shell = GS_SHELL_OVERVIEW (data);
- GsApp *app;
+ AsApp *app;
app = gs_feature_tile_get_app (tile);
gs_shell_show_app (shell->priv->shell, app);
@@ -148,7 +148,7 @@ gs_shell_overview_get_featured_cb (GObject *source_object,
GtkWidget *tile;
GList *list;
GError *error = NULL;
- GsApp *app;
+ AsApp *app;
gs_container_remove_all (GTK_CONTAINER (priv->bin_featured));
@@ -161,7 +161,7 @@ gs_shell_overview_get_featured_cb (GObject *source_object,
}
/* at the moment, we only care about the first app */
- app = GS_APP (list->data);
+ app = AS_APP (list->data);
tile = gs_feature_tile_new (app);
g_signal_connect (tile, "clicked",
G_CALLBACK (feature_tile_clicked), shell);
diff --git a/src/gs-shell-search-provider.c b/src/gs-shell-search-provider.c
index f168bd9..638f660 100644
--- a/src/gs-shell-search-provider.c
+++ b/src/gs-shell-search-provider.c
@@ -95,8 +95,8 @@ static gint
search_sort_by_kudo_cb (gconstpointer a, gconstpointer b)
{
guint pa, pb;
- pa = gs_app_get_kudos_percentage (GS_APP (a));
- pb = gs_app_get_kudos_percentage (GS_APP (b));
+ pa = gs_app_get_kudos_percentage (AS_APP (a));
+ pb = gs_app_get_kudos_percentage (AS_APP (b));
if (pa < pb)
return 1;
else if (pa > pb)
@@ -134,10 +134,10 @@ search_done_cb (GObject *source,
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
for (l = list; l != NULL; l = l->next) {
- GsApp *app = GS_APP (l->data);
- if (gs_app_get_state (app) != AS_APP_STATE_AVAILABLE)
+ AsApp *app = AS_APP (l->data);
+ if (as_app_get_state (app) != AS_APP_STATE_AVAILABLE)
continue;
- g_variant_builder_add (&builder, "s", gs_app_get_id (app));
+ g_variant_builder_add (&builder, "s", as_app_get_id (app));
}
g_dbus_method_invocation_return_value (self->current_search->invocation, g_variant_new ("(as)",
&builder));
@@ -221,7 +221,7 @@ handle_get_result_metas (GsShellSearchProvider2 *skeleton,
g_debug ("****** GetResultMetas");
for (i = 0; results[i]; i++) {
- GsApp *app;
+ AsApp *app;
if (g_hash_table_lookup (self->metas_cache, results[i]))
continue;
@@ -241,14 +241,14 @@ handle_get_result_metas (GsShellSearchProvider2 *skeleton,
}
g_variant_builder_init (&meta, G_VARIANT_TYPE ("a{sv}"));
- g_variant_builder_add (&meta, "{sv}", "id", g_variant_new_string (gs_app_get_id (app)));
- g_variant_builder_add (&meta, "{sv}", "name", g_variant_new_string (gs_app_get_name (app)));
+ g_variant_builder_add (&meta, "{sv}", "id", g_variant_new_string (as_app_get_id (app)));
+ g_variant_builder_add (&meta, "{sv}", "name", g_variant_new_string (as_app_get_name (app,
NULL)));
pixbuf = gs_app_get_pixbuf (app);
if (pixbuf != NULL)
g_variant_builder_add (&meta, "{sv}", "icon", g_icon_serialize (G_ICON (pixbuf)));
- g_variant_builder_add (&meta, "{sv}", "description", g_variant_new_string (gs_app_get_summary
(app)));
+ g_variant_builder_add (&meta, "{sv}", "description", g_variant_new_string (as_app_get_comment
(app, NULL)));
meta_variant = g_variant_builder_end (&meta);
- g_hash_table_insert (self->metas_cache, g_strdup (gs_app_get_id (app)), g_variant_ref_sink
(meta_variant));
+ g_hash_table_insert (self->metas_cache, g_strdup (as_app_get_id (app)), g_variant_ref_sink
(meta_variant));
g_object_unref (app);
}
diff --git a/src/gs-shell-search.c b/src/gs-shell-search.c
index 680de4c..5541ded 100644
--- a/src/gs-shell-search.c
+++ b/src/gs-shell-search.c
@@ -56,14 +56,14 @@ gs_shell_search_app_row_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
GsShellSearch *shell_search)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_row_get_app (GS_APP_ROW (row));
gs_shell_show_app (shell_search->priv->shell, app);
}
typedef struct {
- GsApp *app;
+ AsApp *app;
GsShellSearch *shell_search;
} GsShellSearchHelper;
@@ -82,7 +82,7 @@ gs_shell_search_app_installed_cb (GObject *source,
&error);
if (!ret) {
g_warning ("failed to install %s: %s",
- gs_app_get_id (helper->app),
+ as_app_get_id (helper->app),
error->message);
gs_app_notify_failed_modal (helper->shell_search->priv->builder,
helper->app,
@@ -133,7 +133,7 @@ gs_shell_search_app_removed_cb (GObject *source,
* gs_shell_search_app_remove:
**/
static void
-gs_shell_search_app_remove (GsShellSearch *shell_search, GsApp *app)
+gs_shell_search_app_remove (GsShellSearch *shell_search, AsApp *app)
{
GsShellSearchPrivate *priv = shell_search->priv;
GString *markup;
@@ -147,7 +147,7 @@ gs_shell_search_app_remove (GsShellSearch *shell_search, GsApp *app)
/* TRANSLATORS: this is a prompt message, and
* '%s' is an application summary, e.g. 'GNOME Clocks' */
_("Are you sure you want to remove %s?"),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
g_string_prepend (markup, "<b>");
g_string_append (markup, "</b>");
dialog = gtk_message_dialog_new (window,
@@ -159,13 +159,13 @@ gs_shell_search_app_remove (GsShellSearch *shell_search, GsApp *app)
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
/* TRANSLATORS: longer dialog text */
_("%s will be removed, and you will have to install it to
use it again."),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
/* TRANSLATORS: this is button text to remove the application */
gtk_dialog_add_button (GTK_DIALOG (dialog), _("Remove"), GTK_RESPONSE_OK);
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (response == GTK_RESPONSE_OK) {
GsShellSearchHelper *helper;
- g_debug ("remove %s", gs_app_get_id (app));
+ g_debug ("remove %s", as_app_get_id (app));
helper = g_new0 (GsShellSearchHelper, 1);
helper->app = g_object_ref (app);
helper->shell_search = g_object_ref (shell_search);
@@ -184,7 +184,7 @@ gs_shell_search_app_remove (GsShellSearch *shell_search, GsApp *app)
* gs_shell_search_app_install:
**/
static void
-gs_shell_search_app_install (GsShellSearch *shell_search, GsApp *app)
+gs_shell_search_app_install (GsShellSearch *shell_search, AsApp *app)
{
GsShellSearchPrivate *priv = shell_search->priv;
GsShellSearchHelper *helper;
@@ -203,13 +203,13 @@ gs_shell_search_app_install (GsShellSearch *shell_search, GsApp *app)
* gs_shell_search_show_missing_url:
**/
static void
-gs_shell_search_show_missing_url (GsApp *app)
+gs_shell_search_show_missing_url (AsApp *app)
{
GError *error = NULL;
const gchar *url;
gboolean ret;
- url = gs_app_get_url (app, GS_APP_URL_KIND_MISSING);
+ url = as_app_get_url_item (app, AS_URL_KIND_MISSING);
ret = gtk_show_uri (NULL, url, GDK_CURRENT_TIME, &error);
if (!ret) {
g_warning ("spawn of '%s' failed", url);
@@ -224,13 +224,13 @@ static void
gs_shell_search_app_row_clicked_cb (GsAppRow *app_row,
GsShellSearch *shell_search)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_row_get_app (app_row);
- if (gs_app_get_state (app) == AS_APP_STATE_AVAILABLE)
+ if (as_app_get_state (app) == AS_APP_STATE_AVAILABLE)
gs_shell_search_app_install (shell_search, app);
- else if (gs_app_get_state (app) == AS_APP_STATE_INSTALLED)
+ else if (as_app_get_state (app) == AS_APP_STATE_INSTALLED)
gs_shell_search_app_remove (shell_search, app);
- else if (gs_app_get_state (app) == AS_APP_STATE_UNAVAILABLE)
+ else if (as_app_get_state (app) == AS_APP_STATE_UNAVAILABLE)
gs_shell_search_show_missing_url (app);
}
@@ -245,7 +245,7 @@ gs_shell_search_get_search_cb (GObject *source_object,
GError *error = NULL;
GList *l;
GList *list;
- GsApp *app;
+ AsApp *app;
GsShellSearch *shell_search = GS_SHELL_SEARCH (user_data);
GsShellSearchPrivate *priv = shell_search->priv;
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
@@ -269,7 +269,7 @@ gs_shell_search_get_search_cb (GObject *source_object,
}
gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_search), "results");
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
app_row = gs_app_row_new ();
g_signal_connect (app_row, "button-clicked",
G_CALLBACK (gs_shell_search_app_row_clicked_cb),
@@ -350,7 +350,7 @@ gs_shell_search_refresh (GsShellSearch *shell_search, const gchar *value, gboole
* 5. Name
**/
static gchar *
-gs_shell_search_get_app_sort_key (GsApp *app)
+gs_shell_search_get_app_sort_key (AsApp *app)
{
GPtrArray *ss;
GString *key;
@@ -371,7 +371,7 @@ gs_shell_search_get_app_sort_key (GsApp *app)
}
/* artificially cut the rating of applications with no description */
- desc = gs_app_get_description (app);
+ desc = as_app_get_description (app, NULL);
g_string_append_printf (key, "%c:", desc != NULL ? '2' : '1');
/* sort by rating */
@@ -383,7 +383,7 @@ gs_shell_search_get_app_sort_key (GsApp *app)
desc != NULL ? strlen (desc) : 0);
/* sort by number of screenshots */
- ss = gs_app_get_screenshots (app);
+ ss = as_app_get_screenshots (app);
g_string_append_printf (key, "%02i:", ss->len);
/* sort by install date */
@@ -391,7 +391,7 @@ gs_shell_search_get_app_sort_key (GsApp *app)
G_MAXUINT64 - gs_app_get_install_date (app));
/* finally, sort by short name */
- g_string_append (key, gs_app_get_name (app));
+ g_string_append (key, as_app_get_name (app, NULL));
return g_string_free (key, FALSE);
}
@@ -404,8 +404,8 @@ gs_shell_search_sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
- GsApp *a1 = gs_app_row_get_app (GS_APP_ROW (a));
- GsApp *a2 = gs_app_row_get_app (GS_APP_ROW (b));
+ AsApp *a1 = gs_app_row_get_app (GS_APP_ROW (a));
+ AsApp *a2 = gs_app_row_get_app (GS_APP_ROW (b));
gchar *key1 = gs_shell_search_get_app_sort_key (a1);
gchar *key2 = gs_shell_search_get_app_sort_key (a2);
gint retval;
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index bc9c109..6ca7e6b 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -456,7 +456,7 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
}
for (l = list; l != NULL; l = l->next) {
gs_update_list_add_app (GS_UPDATE_LIST (priv->list_box_updates),
- GS_APP (l->data));
+ AS_APP (l->data));
}
out:
@@ -518,7 +518,7 @@ gs_shell_updates_refresh (GsShellUpdates *shell_updates,
}
static void
-show_update_details (GsApp *app, GsShellUpdates *shell_updates)
+show_update_details (AsApp *app, GsShellUpdates *shell_updates)
{
GsShellUpdatesPrivate *priv = shell_updates->priv;
GtkWidget *dialog;
@@ -541,7 +541,7 @@ gs_shell_updates_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
GsShellUpdates *shell_updates)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_row_get_app (GS_APP_ROW (row));
diff --git a/src/gs-shell.c b/src/gs-shell.c
index 04bb60f..6388970 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -50,7 +50,7 @@ static void gs_shell_finalize (GObject *object);
typedef struct {
GsShellMode mode;
GtkWidget *focus;
- GsApp *app;
+ AsApp *app;
GsCategory *category;
} BackEntry;
@@ -105,7 +105,7 @@ gs_shell_activate (GsShell *shell)
static void
gs_shell_change_mode (GsShell *shell,
GsShellMode mode,
- GsApp *app,
+ AsApp *app,
gpointer data,
gboolean scroll_up)
{
@@ -670,7 +670,7 @@ gs_shell_show_sources (GsShell *shell)
}
void
-gs_shell_show_app (GsShell *shell, GsApp *app)
+gs_shell_show_app (GsShell *shell, AsApp *app)
{
save_back_entry (shell);
gs_shell_change_mode (shell, GS_SHELL_MODE_DETAILS, app, NULL, TRUE);
@@ -705,7 +705,7 @@ gs_shell_show_filename (GsShell *shell, const gchar *filename)
typedef struct {
GsShell *shell;
- GsApp *app;
+ AsApp *app;
} RefineData;
static void
diff --git a/src/gs-shell.h b/src/gs-shell.h
index c3959b0..db15899 100644
--- a/src/gs-shell.h
+++ b/src/gs-shell.h
@@ -75,7 +75,7 @@ GsShellMode gs_shell_get_mode (GsShell *shell);
void gs_shell_show_installed_updates(GsShell *shell);
void gs_shell_show_sources (GsShell *shell);
void gs_shell_show_app (GsShell *shell,
- GsApp *app);
+ AsApp *app);
void gs_shell_show_category (GsShell *shell,
GsCategory *category);
void gs_shell_show_search (GsShell *shell,
diff --git a/src/gs-sources-dialog.c b/src/gs-sources-dialog.c
index ca75244..2dfd64e 100644
--- a/src/gs-sources-dialog.c
+++ b/src/gs-sources-dialog.c
@@ -46,9 +46,9 @@ struct _GsSourcesDialogPrivate
G_DEFINE_TYPE_WITH_PRIVATE (GsSourcesDialog, gs_sources_dialog, GTK_TYPE_DIALOG)
static void
-add_source (GtkListBox *listbox, GsApp *app)
+add_source (GtkListBox *listbox, AsApp *app)
{
- GsApp *app_tmp;
+ AsApp *app_tmp;
GtkWidget *widget;
GtkWidget *box;
GtkStyleContext *context;
@@ -64,7 +64,7 @@ add_source (GtkListBox *listbox, GsApp *app)
gtk_widget_set_margin_bottom (box, 12);
gtk_widget_set_margin_end (box, 12);
- widget = gtk_label_new (gs_app_get_name (app));
+ widget = gtk_label_new (as_app_get_name (app, NULL));
gtk_widget_set_halign (widget, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0);
related = gs_app_get_related (app);
@@ -72,7 +72,7 @@ add_source (GtkListBox *listbox, GsApp *app)
/* split up the types */
for (i = 0; i < related->len; i++) {
app_tmp = g_ptr_array_index (related, i);
- switch (gs_app_get_id_kind (app_tmp)) {
+ switch (as_app_get_id_kind (app_tmp)) {
case AS_ID_KIND_WEB_APP:
case AS_ID_KIND_DESKTOP:
cnt_apps++;
@@ -129,7 +129,7 @@ get_sources_cb (GsPluginLoader *plugin_loader,
GError *error = NULL;
GList *l;
GList *list;
- GsApp *app;
+ AsApp *app;
GsSourcesDialogPrivate *priv = gs_sources_dialog_get_instance_private (dialog);
/* show results */
@@ -153,7 +153,7 @@ get_sources_cb (GsPluginLoader *plugin_loader,
/* add each */
gtk_stack_set_visible_child_name (GTK_STACK (priv->stack), "sources");
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
add_source (GTK_LIST_BOX (priv->listbox), app);
}
out:
@@ -200,7 +200,7 @@ list_sort_func (GtkListBoxRow *a,
}
static void
-add_app (GtkListBox *listbox, GsApp *app)
+add_app (GtkListBox *listbox, AsApp *app)
{
GtkWidget *box;
GtkWidget *widget;
@@ -211,7 +211,7 @@ add_app (GtkListBox *listbox, GsApp *app)
gtk_widget_set_margin_bottom (box, 12);
gtk_widget_set_margin_end (box, 12);
- widget = gtk_label_new (gs_app_get_name (app));
+ widget = gtk_label_new (as_app_get_name (app, NULL));
gtk_widget_set_halign (widget, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (box), widget, FALSE, FALSE, 0);
@@ -226,7 +226,7 @@ list_row_activated_cb (GtkListBox *list_box,
GsSourcesDialog *dialog)
{
GPtrArray *related;
- GsApp *app;
+ AsApp *app;
GsSourcesDialogPrivate *priv = gs_sources_dialog_get_instance_private (dialog);
guint cnt_apps = 0;
guint i;
@@ -236,7 +236,7 @@ list_row_activated_cb (GtkListBox *list_box,
gtk_widget_show (priv->button_back);
gs_container_remove_all (GTK_CONTAINER (priv->listbox_apps));
- app = GS_APP (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (row))),
+ app = AS_APP (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (row))),
"GsShell::app"));
related = gs_app_get_related (app);
for (i = 0; i < related->len; i++) {
@@ -303,7 +303,7 @@ app_removed_cb (GObject *source,
static void
remove_button_cb (GtkWidget *widget, GsSourcesDialog *dialog)
{
- GsApp *app;
+ AsApp *app;
GsSourcesDialogPrivate *priv = gs_sources_dialog_get_instance_private (dialog);
/* disable button */
@@ -315,7 +315,7 @@ remove_button_cb (GtkWidget *widget, GsSourcesDialog *dialog)
gtk_widget_set_sensitive (priv->listbox_apps, FALSE);
/* remove source */
- app = GS_APP (g_object_get_data (G_OBJECT (priv->stack), "GsShell::app"));
+ app = AS_APP (g_object_get_data (G_OBJECT (priv->stack), "GsShell::app"));
gs_plugin_loader_app_action_async (priv->plugin_loader,
app,
GS_PLUGIN_LOADER_ACTION_REMOVE,
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 875f5c3..be4f488 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -78,7 +78,7 @@ back_entry_free (BackEntry *entry)
}
static void
-set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
+set_updates_description_ui (GsUpdateDialog *dialog, AsApp *app)
{
GsUpdateDialogPrivate *priv = gs_update_dialog_get_instance_private (dialog);
GsAppKind kind;
@@ -90,7 +90,7 @@ set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
/* set window title */
kind = gs_app_get_kind (app);
if (kind == GS_APP_KIND_OS_UPDATE) {
- gtk_window_set_title (GTK_WINDOW (dialog), gs_app_get_name (app));
+ gtk_window_set_title (GTK_WINDOW (dialog), as_app_get_name (app, NULL));
} else {
tmp = g_strdup_printf ("%s %s",
gs_app_get_source_default (app),
@@ -117,8 +117,8 @@ set_updates_description_ui (GsUpdateDialog *dialog, GsApp *app)
gtk_widget_set_visible (priv->box_header, kind == GS_APP_KIND_NORMAL || kind == GS_APP_KIND_SYSTEM);
gtk_label_set_markup (GTK_LABEL (priv->label_details), update_desc);
gtk_image_set_from_pixbuf (GTK_IMAGE (priv->image_icon), gs_app_get_pixbuf (app));
- gtk_label_set_label (GTK_LABEL (priv->label_name), gs_app_get_name (app));
- gtk_label_set_label (GTK_LABEL (priv->label_summary), gs_app_get_summary (app));
+ gtk_label_set_label (GTK_LABEL (priv->label_name), as_app_get_name (app, NULL));
+ gtk_label_set_label (GTK_LABEL (priv->label_summary), as_app_get_comment (app, NULL));
g_free (update_desc);
/* show the back button if needed */
@@ -130,9 +130,9 @@ row_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
GsUpdateDialog *dialog)
{
- GsApp *app;
+ AsApp *app;
- app = GS_APP (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (row))), "app"));
+ app = AS_APP (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (row))), "app"));
/* save the current stack state for the back button */
save_back_entry (dialog);
@@ -146,7 +146,7 @@ installed_updates_row_activated_cb (GtkListBox *list_box,
GtkListBoxRow *row,
GsUpdateDialog *dialog)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_row_get_app (GS_APP_ROW (row));
@@ -190,15 +190,15 @@ gs_update_dialog_show_installed_updates (GsUpdateDialog *dialog, GList *installe
gs_container_remove_all (GTK_CONTAINER (priv->list_box_installed_updates));
for (l = installed_updates; l != NULL; l = l->next) {
gs_update_list_add_app (GS_UPDATE_LIST (priv->list_box_installed_updates),
- GS_APP (l->data));
+ AS_APP (l->data));
}
}
void
-gs_update_dialog_show_update_details (GsUpdateDialog *dialog, GsApp *app)
+gs_update_dialog_show_update_details (GsUpdateDialog *dialog, AsApp *app)
{
GsUpdateDialogPrivate *priv = gs_update_dialog_get_instance_private (dialog);
- GsApp *app_related;
+ AsApp *app_related;
GsAppKind kind;
const gchar *sort;
diff --git a/src/gs-update-dialog.h b/src/gs-update-dialog.h
index d6ffd44..0360dc6 100644
--- a/src/gs-update-dialog.h
+++ b/src/gs-update-dialog.h
@@ -54,7 +54,7 @@ GtkWidget *gs_update_dialog_new (void);
void gs_update_dialog_show_installed_updates (GsUpdateDialog *dialog,
GList *installed_updates);
void gs_update_dialog_show_update_details (GsUpdateDialog *dialog,
- GsApp *app);
+ AsApp *app);
#endif /* GS_UPDATE_DIALOG_H */
diff --git a/src/gs-update-list.c b/src/gs-update-list.c
index 2008ec1..b46f118 100644
--- a/src/gs-update-list.c
+++ b/src/gs-update-list.c
@@ -40,7 +40,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GsUpdateList, gs_update_list, GTK_TYPE_LIST_BOX)
void
gs_update_list_add_app (GsUpdateList *update_list,
- GsApp *app)
+ AsApp *app)
{
GsUpdateListPrivate *priv = gs_update_list_get_instance_private (update_list);
GtkWidget *app_row;
@@ -56,10 +56,10 @@ gs_update_list_add_app (GsUpdateList *update_list,
}
static gboolean
-is_addon_id_kind (GsApp *app)
+is_addon_id_kind (AsApp *app)
{
AsIdKind id_kind;
- id_kind = gs_app_get_id_kind (app);
+ id_kind = as_app_get_id_kind (app);
if (id_kind == AS_ID_KIND_DESKTOP)
return FALSE;
if (id_kind == AS_ID_KIND_WEB_APP)
@@ -98,7 +98,7 @@ list_header_func (GtkListBoxRow *row,
}
static gchar *
-get_app_sort_key (GsApp *app)
+get_app_sort_key (AsApp *app)
{
GString *key;
@@ -115,7 +115,7 @@ get_app_sort_key (GsApp *app)
}
/* sort desktop files, then addons */
- switch (gs_app_get_id_kind (app)) {
+ switch (as_app_get_id_kind (app)) {
case AS_ID_KIND_DESKTOP:
g_string_append (key, "1:");
break;
@@ -129,7 +129,7 @@ get_app_sort_key (GsApp *app)
G_MAXUINT64 - gs_app_get_install_date (app));
/* finally, sort by short name */
- g_string_append (key, gs_app_get_name (app));
+ g_string_append (key, as_app_get_name (app, NULL));
return g_string_free (key, FALSE);
}
@@ -138,8 +138,8 @@ list_sort_func (GtkListBoxRow *a,
GtkListBoxRow *b,
gpointer user_data)
{
- GsApp *a1 = gs_app_row_get_app (GS_APP_ROW (a));
- GsApp *a2 = gs_app_row_get_app (GS_APP_ROW (b));
+ AsApp *a1 = gs_app_row_get_app (GS_APP_ROW (a));
+ AsApp *a2 = gs_app_row_get_app (GS_APP_ROW (b));
gchar *key1 = get_app_sort_key (a1);
gchar *key2 = get_app_sort_key (a2);
gint retval;
diff --git a/src/gs-update-list.h b/src/gs-update-list.h
index ff2611b..4c08801 100644
--- a/src/gs-update-list.h
+++ b/src/gs-update-list.h
@@ -52,7 +52,7 @@ struct _GsUpdateListClass
GType gs_update_list_get_type (void);
GtkWidget *gs_update_list_new (void);
void gs_update_list_add_app (GsUpdateList *update_list,
- GsApp *app);
+ AsApp *app);
G_END_DECLS
diff --git a/src/gs-utils.c b/src/gs-utils.c
index 781f924..847e821 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -121,23 +121,23 @@ gs_grab_focus_when_mapped (GtkWidget *widget)
}
void
-gs_app_notify_installed (GsApp *app)
+gs_app_notify_installed (AsApp *app)
{
gchar *summary;
GNotification *n;
/* TRANSLATORS: this is the summary of a notification that an application
* has been successfully installed */
- summary = g_strdup_printf (_("%s is now installed"), gs_app_get_name (app));
+ summary = g_strdup_printf (_("%s is now installed"), as_app_get_name (app, NULL));
n = g_notification_new (summary);
- if (gs_app_get_id_kind (app) == AS_ID_KIND_DESKTOP) {
+ if (as_app_get_id_kind (app) == AS_ID_KIND_DESKTOP) {
/* TRANSLATORS: this is button that opens the newly installed application */
g_notification_add_button_with_target (n, _("Launch"),
"app.launch", "s",
- gs_app_get_id_full (app));
+ as_app_get_id_full (app));
}
g_notification_set_default_action_and_target (n, "app.details", "(ss)",
- gs_app_get_id_full (app), "");
+ as_app_get_id_full (app), "");
g_application_send_notification (g_application_get_default (), "installed", n);
g_object_unref (n);
g_free (summary);
@@ -148,7 +148,7 @@ gs_app_notify_installed (GsApp *app)
**/
void
gs_app_notify_failed_modal (GtkBuilder *builder,
- GsApp *app,
+ AsApp *app,
GsPluginLoaderAction action,
const GError *error)
{
@@ -162,12 +162,12 @@ gs_app_notify_failed_modal (GtkBuilder *builder,
case GS_PLUGIN_LOADER_ACTION_INSTALL:
/* TRANSLATORS: this is when the install fails */
msg = g_strdup_printf (_("Installation of %s failed."),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
break;
case GS_PLUGIN_LOADER_ACTION_REMOVE:
/* TRANSLATORS: this is when the remove fails */
msg = g_strdup_printf (_("Removal of %s failed."),
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
break;
default:
g_assert_not_reached ();
diff --git a/src/gs-utils.h b/src/gs-utils.h
index ecfdd84..49ea5ce 100644
--- a/src/gs-utils.h
+++ b/src/gs-utils.h
@@ -34,9 +34,9 @@ void gs_stop_spinner (GtkSpinner *spinner);
void gs_container_remove_all (GtkContainer *container);
void gs_grab_focus_when_mapped (GtkWidget *widget);
-void gs_app_notify_installed (GsApp *app);
+void gs_app_notify_installed (AsApp *app);
void gs_app_notify_failed_modal (GtkBuilder *builder,
- GsApp *app,
+ AsApp *app,
GsPluginLoaderAction action,
const GError *error);
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 27d02f5..fd3ed71 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -35,7 +35,7 @@ struct GsPluginPrivate {
gsize done_init;
};
-static gboolean gs_plugin_refine_item (GsPlugin *plugin, GsApp *app, AsApp *item, GError **error);
+static gboolean gs_plugin_refine_item (GsPlugin *plugin, AsApp *app, AsApp *item, GError **error);
/**
* gs_plugin_get_name:
@@ -224,7 +224,7 @@ out:
* gs_plugin_refine_item_pixbuf:
*/
static void
-gs_plugin_refine_item_pixbuf (GsPlugin *plugin, GsApp *app, AsApp *item)
+gs_plugin_refine_item_pixbuf (GsPlugin *plugin, AsApp *app, AsApp *item)
{
GError *error = NULL;
const gchar *icon;
@@ -235,10 +235,10 @@ gs_plugin_refine_item_pixbuf (GsPlugin *plugin, GsApp *app, AsApp *item)
icon = as_app_get_icon (item);
switch (as_app_get_icon_kind (item)) {
case AS_ICON_KIND_REMOTE:
- gs_app_set_icon (app, icon);
+ as_app_set_icon (app, icon, -1);
break;
case AS_ICON_KIND_STOCK:
- gs_app_set_icon (app, icon);
+ as_app_set_icon (app, icon, -1);
ret = gs_app_load_icon (app, &error);
if (!ret) {
g_warning ("failed to load stock icon %s: %s",
@@ -252,7 +252,7 @@ gs_plugin_refine_item_pixbuf (GsPlugin *plugin, GsApp *app, AsApp *item)
/* we assume <icon type="local">gnome-chess.png</icon> */
icon_dir = as_app_get_icon_path (item);
icon_path = g_build_filename (icon_dir, icon, NULL);
- gs_app_set_icon (app, icon_path);
+ as_app_set_icon (app, icon_path, -1);
ret = gs_app_load_icon (app, &error);
if (!ret) {
g_warning ("falling back to searching for %s", icon_path);
@@ -266,7 +266,7 @@ gs_plugin_refine_item_pixbuf (GsPlugin *plugin, GsApp *app, AsApp *item)
g_warning ("failed to load cached icon %s", icon);
goto out;
}
- gs_app_set_icon (app, icon_path);
+ as_app_set_icon (app, icon_path, -1);
ret = gs_app_load_icon (app, &error);
if (!ret) {
g_warning ("failed to load cached icon %s: %s",
@@ -288,7 +288,7 @@ out:
* gs_plugin_refine_add_addons:
*/
static void
-gs_plugin_refine_add_addons (GsPlugin *plugin, GsApp *app, AsApp *item)
+gs_plugin_refine_add_addons (GsPlugin *plugin, AsApp *app, AsApp *item)
{
GPtrArray *addons;
guint i;
@@ -299,7 +299,7 @@ gs_plugin_refine_add_addons (GsPlugin *plugin, GsApp *app, AsApp *item)
for (i = 0; i < addons->len; i++) {
AsApp *as_addon = g_ptr_array_index (addons, i);
- GsApp *addon;
+ AsApp *addon;
GError *error = NULL;
gboolean ret;
@@ -320,7 +320,7 @@ gs_plugin_refine_add_addons (GsPlugin *plugin, GsApp *app, AsApp *item)
* gs_plugin_refine_add_screenshots:
*/
static void
-gs_plugin_refine_add_screenshots (GsApp *app, AsApp *item)
+gs_plugin_refine_add_screenshots (AsApp *app, AsApp *item)
{
AsScreenshot *ss;
GPtrArray *images_as;
@@ -334,7 +334,7 @@ gs_plugin_refine_add_screenshots (GsApp *app, AsApp *item)
/* does the app already have some */
gs_app_add_kudo (app, GS_APP_KUDO_HAS_SCREENSHOTS);
- if (gs_app_get_screenshots(app)->len > 0)
+ if (as_app_get_screenshots(app)->len > 0)
return;
/* add any we know */
@@ -346,7 +346,7 @@ gs_plugin_refine_add_screenshots (GsApp *app, AsApp *item)
continue;
if (as_screenshot_get_kind (ss) == AS_SCREENSHOT_KIND_UNKNOWN)
continue;
- gs_app_add_screenshot (app, ss);
+ as_app_add_screenshot (app, ss);
}
}
@@ -354,7 +354,7 @@ gs_plugin_refine_add_screenshots (GsApp *app, AsApp *item)
* gs_plugin_appstream_set_license:
*/
static void
-gs_plugin_appstream_set_license (GsApp *app, const gchar *license_string)
+gs_plugin_appstream_set_license (AsApp *app, const gchar *license_string)
{
GString *urld;
gchar **tokens;
@@ -382,7 +382,7 @@ gs_plugin_appstream_set_license (GsApp *app, const gchar *license_string)
"<a href=\"http://spdx.org/licenses/%s\">%s</a>",
tokens[i], tokens[i]);
}
- gs_app_set_licence (app, urld->str);
+ as_app_set_project_license (app, urld->str, -1);
g_strfreev (tokens);
g_string_free (urld, TRUE);
}
@@ -414,11 +414,11 @@ gs_plugin_appstream_is_recent_release (AsApp *app)
*/
static gboolean
gs_plugin_refine_item (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
AsApp *item,
GError **error)
{
- GHashTable *urls;
+// GHashTable *urls;
GPtrArray *pkgnames;
const gchar *tmp;
gboolean ret = TRUE;
@@ -435,7 +435,7 @@ gs_plugin_refine_item (GsPlugin *plugin,
}
/* is installed already */
- if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
+ if (as_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
switch (as_app_get_source_kind (item)) {
case AS_APP_SOURCE_KIND_APPDATA:
case AS_APP_SOURCE_KIND_DESKTOP:
@@ -450,14 +450,14 @@ gs_plugin_refine_item (GsPlugin *plugin,
/* give the desktopdb plugin a fighting chance */
if (as_app_get_source_file (item) != NULL &&
- gs_app_get_metadata_item (app, "DataDir::desktop-filename") == NULL) {
- gs_app_set_metadata (app, "DataDir::desktop-filename",
- as_app_get_source_file (item));
+ as_app_get_metadata_item (app, "DataDir::desktop-filename") == NULL) {
+ as_app_add_metadata (app, "DataDir::desktop-filename",
+ as_app_get_source_file (item), -1);
}
/* set id */
- if (as_app_get_id (item) != NULL && gs_app_get_id (app) == NULL)
- gs_app_set_id (app, as_app_get_id (item));
+ if (as_app_get_id (item) != NULL && as_app_get_id (app) == NULL)
+ as_app_set_id_full (app, as_app_get_id_full (item), -1);
/* set name */
tmp = as_app_get_name (item, NULL);
@@ -476,28 +476,28 @@ gs_plugin_refine_item (GsPlugin *plugin,
}
/* add urls */
- urls = as_app_get_urls (item);
- if (g_hash_table_size (urls) > 0 &&
- gs_app_get_url (app, GS_APP_URL_KIND_HOMEPAGE) == NULL) {
- GList *keys;
- GList *l;
- keys = g_hash_table_get_keys (urls);
- for (l = keys; l != NULL; l = l->next) {
- gs_app_set_url (app,
- l->data,
- g_hash_table_lookup (urls, l->data));
- }
- g_list_free (keys);
- }
+// urls = as_app_get_urls (item);
+// if (g_hash_table_size (urls) > 0 &&
+// as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE) == NULL) {
+// GList *keys;
+// GList *l;
+// keys = g_hash_table_get_keys (urls);
+// for (l = keys; l != NULL; l = l->next) {
+// as_app_add_url (app,
+// l->data,
+// g_hash_table_lookup (urls, l->data));
+// }
+// g_list_free (keys);
+// }
/* set licence */
- if (as_app_get_project_license (item) != NULL && gs_app_get_licence (app) == NULL)
+ if (as_app_get_project_license (item) != NULL && as_app_get_project_license (app) == NULL)
gs_plugin_appstream_set_license (app, as_app_get_project_license (item));
/* set keywords */
if (as_app_get_keywords (item) != NULL &&
- gs_app_get_keywords (app) == NULL) {
- gs_app_set_keywords (app, as_app_get_keywords (item));
+ as_app_get_keywords (app) == NULL) {
+// as_app_set_keywords (app, as_app_get_keywords (item));
gs_app_add_kudo (app, GS_APP_KUDO_HAS_KEYWORDS);
}
@@ -520,14 +520,14 @@ gs_plugin_refine_item (GsPlugin *plugin,
gs_plugin_refine_item_pixbuf (plugin, app, item);
/* set categories */
- if (as_app_get_categories (item) != NULL &&
- gs_app_get_categories (app)->len == 0)
- gs_app_set_categories (app, as_app_get_categories (item));
+// if (as_app_get_categories (item) != NULL &&
+// as_app_get_categories (app)->len == 0)
+// as_app_set_categories (app, as_app_get_categories (item));
/* set project group */
- if (as_app_get_project_group (item) != NULL &&
- gs_app_get_project_group (app) == NULL)
- gs_app_set_project_group (app, as_app_get_project_group (item));
+// if (as_app_get_project_group (item) != NULL &&
+// as_app_get_project_group (app) == NULL)
+// as_app_set_project_group (app, as_app_get_project_group (item));
/* this is a core application for the desktop and cannot be removed */
if (as_app_has_compulsory_for_desktop (item, "GNOME") &&
@@ -535,8 +535,8 @@ gs_plugin_refine_item (GsPlugin *plugin,
gs_app_set_kind (app, GS_APP_KIND_SYSTEM);
/* set id kind */
- if (gs_app_get_id_kind (app) == AS_ID_KIND_UNKNOWN)
- gs_app_set_id_kind (app, as_app_get_id_kind (item));
+ if (as_app_get_id_kind (app) == AS_ID_KIND_UNKNOWN)
+ as_app_set_id_kind (app, as_app_get_id_kind (item));
/* set package names */
pkgnames = as_app_get_pkgnames (item);
@@ -581,7 +581,7 @@ out:
*/
static gboolean
gs_plugin_refine_from_id (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
gboolean *found,
GError **error)
{
@@ -590,7 +590,7 @@ gs_plugin_refine_from_id (GsPlugin *plugin,
AsApp *item = NULL;
/* find anything that matches the ID */
- id = gs_app_get_id_full (app);
+ id = as_app_get_id_full (app);
if (id == NULL)
goto out;
item = as_store_get_app_by_id (plugin->priv->store, id);
@@ -611,7 +611,7 @@ out:
*/
static gboolean
gs_plugin_refine_from_pkgname (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GError **error)
{
AsApp *item = NULL;
@@ -655,7 +655,7 @@ gs_plugin_refine (GsPlugin *plugin,
gboolean ret;
gboolean found;
GList *l;
- GsApp *app;
+ AsApp *app;
/* load XML files */
if (g_once_init_enter (&plugin->priv->done_init)) {
@@ -667,7 +667,7 @@ gs_plugin_refine (GsPlugin *plugin,
gs_profile_start (plugin->profile, "appstream::refine");
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
ret = gs_plugin_refine_from_id (plugin, app, &found, error);
if (!ret) {
gs_profile_stop (plugin->profile, "appstream::refine");
@@ -702,7 +702,7 @@ gs_plugin_add_category_apps (GsPlugin *plugin,
const gchar *search_id1;
const gchar *search_id2 = NULL;
gboolean ret = TRUE;
- GsApp *app;
+ AsApp *app;
AsApp *item;
GsCategory *parent;
GPtrArray *array;
@@ -765,7 +765,7 @@ gs_plugin_add_search (GsPlugin *plugin,
AsApp *item;
gboolean ret = TRUE;
GPtrArray *array;
- GsApp *app;
+ AsApp *app;
guint i;
/* load XML files */
@@ -806,7 +806,7 @@ gs_plugin_add_installed (GsPlugin *plugin,
AsApp *item;
gboolean ret = TRUE;
GPtrArray *array;
- GsApp *app;
+ AsApp *app;
guint i;
/* load XML files */
diff --git a/src/plugins/gs-plugin-desktopdb.c b/src/plugins/gs-plugin-desktopdb.c
index dfa5205..5d2ef86 100644
--- a/src/plugins/gs-plugin-desktopdb.c
+++ b/src/plugins/gs-plugin-desktopdb.c
@@ -76,7 +76,7 @@ gs_plugin_destroy (GsPlugin *plugin)
*/
static void
gs_plugin_desktopdb_set_metadata (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
const gchar *pkg_name)
{
gchar *desktop_file;
@@ -119,9 +119,9 @@ gs_plugin_desktopdb_set_metadata (GsPlugin *plugin,
}
/* also set the ID if it's missing */
- if (gs_app_get_id (app) == NULL) {
+ if (as_app_get_id (app) == NULL) {
id = g_path_get_basename (desktop_file);
- gs_app_set_id (app, id);
+ as_app_set_id_full (app, id, -1);
}
/* promote to an app if just a package */
@@ -129,12 +129,12 @@ gs_plugin_desktopdb_set_metadata (GsPlugin *plugin,
gs_app_set_kind (app, GS_APP_KIND_NORMAL);
/* promote to a desktop type */
- if (gs_app_get_id_kind (app) == AS_ID_KIND_UNKNOWN)
- gs_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ if (as_app_get_id_kind (app) == AS_ID_KIND_UNKNOWN)
+ as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
- gs_app_set_metadata (app,
+ as_app_add_metadata (app,
"DataDir::desktop-filename",
- desktop_file);
+ desktop_file, -1);
g_free (desktop_file);
out:
@@ -155,7 +155,7 @@ gs_plugin_refine (GsPlugin *plugin,
{
GList *l;
GPtrArray *sources;
- GsApp *app;
+ AsApp *app;
const gchar *pkgname;
gboolean ret = TRUE;
guint i;
@@ -171,8 +171,8 @@ gs_plugin_refine (GsPlugin *plugin,
/* can we convert a package to an application */
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_metadata_item (app, "DataDir::desktop-filename") != NULL)
+ app = AS_APP (l->data);
+ if (as_app_get_metadata_item (app, "DataDir::desktop-filename") != NULL)
continue;
sources = gs_app_get_sources (app);
for (i = 0; i < sources->len; i++) {
diff --git a/src/plugins/gs-plugin-dummy.c b/src/plugins/gs-plugin-dummy.c
index d957612..4a781b2 100644
--- a/src/plugins/gs-plugin-dummy.c
+++ b/src/plugins/gs-plugin-dummy.c
@@ -83,7 +83,7 @@ gs_plugin_add_updates (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
/* update UI as this might take some time */
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING);
@@ -96,7 +96,7 @@ gs_plugin_add_updates (GsPlugin *plugin,
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "Boxes");
gs_app_set_summary (app, GS_APP_QUALITY_NORMAL, "Do not segfault when using newer versons of
libvirt.");
gs_app_set_kind (app, GS_APP_KIND_NORMAL);
- gs_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
gs_plugin_add_app (list, app);
/* add an OS update */
@@ -104,7 +104,7 @@ gs_plugin_add_updates (GsPlugin *plugin,
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "libvirt-glib-devel");
gs_app_set_summary (app, GS_APP_QUALITY_NORMAL, "Fix several memory leaks.");
gs_app_set_kind (app, GS_APP_KIND_PACKAGE);
- gs_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
gs_plugin_add_app (list, app);
/* add a second OS update */
@@ -112,7 +112,7 @@ gs_plugin_add_updates (GsPlugin *plugin,
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "gnome-boxes-libs");
gs_app_set_summary (app, GS_APP_QUALITY_NORMAL, "Do not segfault when using newer versons of
libvirt.");
gs_app_set_kind (app, GS_APP_KIND_PACKAGE);
- gs_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
gs_plugin_add_app (list, app);
return TRUE;
@@ -127,7 +127,7 @@ gs_plugin_add_installed (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_new ("gnome-power-manager");
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "Power Manager");
@@ -135,7 +135,7 @@ gs_plugin_add_installed (GsPlugin *plugin,
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
gs_app_set_kind (app, GS_APP_KIND_NORMAL);
gs_plugin_add_app (list, app);
- gs_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
return TRUE;
}
@@ -149,7 +149,7 @@ gs_plugin_add_popular (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_new ("gnome-power-manager");
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "Power Manager");
@@ -157,7 +157,7 @@ gs_plugin_add_popular (GsPlugin *plugin,
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
gs_app_set_kind (app, GS_APP_KIND_NORMAL);
gs_plugin_add_app (list, app);
- gs_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
return TRUE;
}
@@ -172,13 +172,13 @@ gs_plugin_refine (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
GList *l;
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_name (app) == NULL) {
- if (g_strcmp0 (gs_app_get_id (app), "gnome-boxes") == 0) {
+ app = AS_APP (l->data);
+ if (as_app_get_name (app, NULL) == NULL) {
+ if (g_strcmp0 (as_app_get_id (app), "gnome-boxes") == 0) {
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "Boxes");
gs_app_set_summary (app, GS_APP_QUALITY_NORMAL, "A simple GNOME 3 application
to access remote or virtual systems");
}
@@ -197,15 +197,15 @@ gs_plugin_add_category_apps (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
app = gs_app_new ("gnome-boxes");
gs_app_set_name (app, GS_APP_QUALITY_NORMAL, "Boxes");
gs_app_set_summary (app, GS_APP_QUALITY_NORMAL, "View and use virtual machines");
- gs_app_set_url (app, GS_APP_URL_KIND_HOMEPAGE, "http://www.box.org");
+ as_app_add_url (app, AS_URL_KIND_HOMEPAGE, "http://www.box.org", -1);
gs_app_set_kind (app, GS_APP_KIND_NORMAL);
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
gs_app_set_pixbuf (app, gdk_pixbuf_new_from_file
("/usr/share/icons/hicolor/48x48/apps/gnome-boxes.png", NULL));
- gs_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
+ as_app_set_id_kind (app, AS_ID_KIND_DESKTOP);
gs_plugin_add_app (list, app);
return TRUE;
}
diff --git a/src/plugins/gs-plugin-epiphany.c b/src/plugins/gs-plugin-epiphany.c
index b4899f1..142b162 100644
--- a/src/plugins/gs-plugin-epiphany.c
+++ b/src/plugins/gs-plugin-epiphany.c
@@ -83,7 +83,7 @@ gs_plugin_destroy (GsPlugin *plugin)
static gboolean
gs_plugin_add_installed_file (GsPlugin *plugin,
const gchar *filename,
- GsApp **app,
+ AsApp **app,
GError **error)
{
GKeyFile *kf;
@@ -148,13 +148,13 @@ gs_plugin_add_installed_file (GsPlugin *plugin,
gs_app_set_name (*app, GS_APP_QUALITY_NORMAL, name);
gs_app_set_summary (*app, GS_APP_QUALITY_NORMAL, comment);
/* TRANSLATORS: this is the licence of the web-app */
- gs_app_set_licence (*app, _("Proprietary"));
+ as_app_set_project_license (*app, _("Proprietary"), -1);
gs_app_set_state (*app, no_display ? AS_APP_STATE_AVAILABLE :
AS_APP_STATE_INSTALLED);
gs_app_set_kind (*app, GS_APP_KIND_NORMAL);
- gs_app_set_id_kind (*app, AS_ID_KIND_WEB_APP);
+ as_app_set_id_kind (*app, AS_ID_KIND_WEB_APP);
gs_app_add_source_id (*app, path);
- gs_app_set_icon (*app, icon);
+ as_app_set_icon (*app, icon, -1);
ret = gs_app_load_icon (*app, error);
if (!ret)
goto out;
@@ -174,7 +174,7 @@ static gboolean
gs_plugin_epiphany_load_db (GsPlugin *plugin, GError **error)
{
GDir *dir;
- GsApp *app = NULL;
+ AsApp *app = NULL;
const gchar *filename;
gboolean ret = TRUE;
gchar *path;
@@ -220,7 +220,7 @@ gs_plugin_add_installed (GsPlugin *plugin,
GError **error)
{
GList *l;
- GsApp *app;
+ AsApp *app;
gboolean ret = TRUE;
/* already loaded */
@@ -233,8 +233,8 @@ gs_plugin_add_installed (GsPlugin *plugin,
/* add all installed apps */
for (l = plugin->priv->list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_state (app) != AS_APP_STATE_INSTALLED)
+ app = AS_APP (l->data);
+ if (as_app_get_state (app) != AS_APP_STATE_INSTALLED)
continue;
gs_plugin_add_app (list, app);
}
@@ -246,11 +246,11 @@ out:
* gs_plugin_epiphany_match_app_value:
*/
static gboolean
-gs_plugin_epiphany_match_app_value (GsApp *app, const gchar *value)
+gs_plugin_epiphany_match_app_value (AsApp *app, const gchar *value)
{
- if (strcasestr (gs_app_get_name (app), value) != NULL)
+ if (strcasestr (as_app_get_name (app, NULL), value) != NULL)
return TRUE;
- if (strcasestr (gs_app_get_summary (app), value) != NULL)
+ if (strcasestr (as_app_get_comment (app, NULL), value) != NULL)
return TRUE;
return FALSE;
}
@@ -259,12 +259,12 @@ gs_plugin_epiphany_match_app_value (GsApp *app, const gchar *value)
* gs_plugin_epiphany_match_app:
*/
static gboolean
-gs_plugin_epiphany_match_app (GsApp *app, gchar **values)
+gs_plugin_epiphany_match_app (AsApp *app, gchar **values)
{
gboolean matches = FALSE;
guint i;
- /* does the GsApp match *all* search keywords */
+ /* does the AsApp match *all* search keywords */
for (i = 0; values[i] != NULL; i++) {
matches = gs_plugin_epiphany_match_app_value (app, values[i]);
if (!matches)
@@ -284,7 +284,7 @@ gs_plugin_add_search (GsPlugin *plugin,
GError **error)
{
GList *l;
- GsApp *app;
+ AsApp *app;
gboolean ret = TRUE;
/* already loaded */
@@ -297,7 +297,7 @@ gs_plugin_add_search (GsPlugin *plugin,
/* add any matching apps */
for (l = plugin->priv->list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
if (gs_plugin_epiphany_match_app (app, values))
gs_plugin_add_app (list, app);
}
@@ -348,7 +348,7 @@ out:
*/
gboolean
gs_plugin_app_install (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -383,7 +383,7 @@ out:
*/
gboolean
gs_plugin_app_remove (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -418,7 +418,7 @@ out:
* gs_plugin_write_file:
*/
static gboolean
-gs_plugin_write_file (GsApp *app, const gchar *filename, GError **error)
+gs_plugin_write_file (AsApp *app, const gchar *filename, GError **error)
{
GKeyFile *kf;
const gchar *url;
@@ -434,16 +434,16 @@ gs_plugin_write_file (GsApp *app, const gchar *filename, GError **error)
g_key_file_set_string (kf,
G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_NAME,
- gs_app_get_name (app));
+ as_app_get_name (app, NULL));
g_key_file_set_string (kf,
G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_COMMENT,
- gs_app_get_summary (app));
+ as_app_get_comment (app, NULL));
- url = gs_app_get_url (app, GS_APP_URL_KIND_HOMEPAGE);
+ url = as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE);
wmclass = g_strdup_printf ("%s-%s",
- gs_app_get_id (app),
- gs_app_get_metadata_item (app, "Epiphany::hash"));
+ as_app_get_id (app),
+ as_app_get_metadata_item (app, "Epiphany::hash"));
profile = g_strdup_printf ("%s/epiphany/app-%s",
g_get_user_config_dir (), wmclass);
exec = g_strdup_printf ("epiphany --application-mode "
@@ -460,7 +460,7 @@ gs_plugin_write_file (GsApp *app, const gchar *filename, GError **error)
G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_TERMINAL,
FALSE);
- switch (gs_app_get_state (app)) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_INSTALLING:
case AS_APP_STATE_INSTALLED:
enabled = TRUE;
@@ -480,7 +480,7 @@ gs_plugin_write_file (GsApp *app, const gchar *filename, GError **error)
g_key_file_set_string (kf,
G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_ICON,
- gs_app_get_icon (app));
+ as_app_get_icon (app));
g_key_file_set_string (kf,
G_KEY_FILE_DESKTOP_GROUP,
G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS,
@@ -606,7 +606,7 @@ out:
* gs_plugin_refine_app:
*/
static gboolean
-gs_plugin_refine_app (GsPlugin *plugin, GsApp *app, GError **error)
+gs_plugin_refine_app (GsPlugin *plugin, AsApp *app, GError **error)
{
gboolean ret;
gchar *filename = NULL;
@@ -619,20 +619,20 @@ gs_plugin_refine_app (GsPlugin *plugin, GsApp *app, GError **error)
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
/* calculate SHA1 hash of name */
- hash = g_compute_checksum_for_string (G_CHECKSUM_SHA1, gs_app_get_name (app), -1);
- gs_app_set_metadata (app, "Epiphany::hash", hash);
+ hash = g_compute_checksum_for_string (G_CHECKSUM_SHA1, as_app_get_name (app, NULL), -1);
+ as_app_add_metadata (app, "Epiphany::hash", hash, -1);
/* download icon if it does not exist */
filename_icon = g_strdup_printf ("%s/epiphany/app-%s-%s/app-icon.png",
g_get_user_config_dir (),
- gs_app_get_id (app),
+ as_app_get_id (app),
hash);
if (!g_file_test (filename_icon, G_FILE_TEST_EXISTS)) {
ret = gs_mkdir_parent (filename_icon, error);
if (!ret)
goto out;
ret = gs_plugin_epiphany_download (plugin,
- gs_app_get_icon (app),
+ as_app_get_icon (app),
filename_icon,
&error_local);
if (!ret) {
@@ -640,7 +640,7 @@ gs_plugin_refine_app (GsPlugin *plugin, GsApp *app, GError **error)
gs_app_set_state (app, AS_APP_STATE_UNKNOWN);
gs_app_set_state (app, AS_APP_STATE_UNAVAILABLE);
g_debug ("Failed to download %s: %s",
- gs_app_get_icon (app), error_local->message);
+ as_app_get_icon (app), error_local->message);
g_error_free (error_local);
ret = TRUE;
goto out;
@@ -648,13 +648,13 @@ gs_plugin_refine_app (GsPlugin *plugin, GsApp *app, GError **error)
}
/* set local icon name */
- gs_app_set_icon (app, filename_icon);
+ as_app_set_icon (app, filename_icon, -1);
ret = gs_app_load_icon (app, error);
if (!ret)
goto out;
/* save file */
- filename = g_strdup_printf ("%s.desktop", gs_app_get_id (app));
+ filename = g_strdup_printf ("%s.desktop", as_app_get_id (app));
path = g_build_filename (g_get_user_data_dir (),
"applications",
filename,
@@ -686,7 +686,7 @@ gs_plugin_refine (GsPlugin *plugin,
GError **error)
{
GList *l;
- GsApp *app;
+ AsApp *app;
const gchar *tmp;
gboolean ret = TRUE;
@@ -699,8 +699,8 @@ gs_plugin_refine (GsPlugin *plugin,
}
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_id_kind (app) != AS_ID_KIND_WEB_APP)
+ app = AS_APP (l->data);
+ if (as_app_get_id_kind (app) != AS_ID_KIND_WEB_APP)
continue;
gs_app_set_size (app, 4096);
tmp = gs_app_get_source_id_default (app);
diff --git a/src/plugins/gs-plugin-fedora-tagger-ratings.c b/src/plugins/gs-plugin-fedora-tagger-ratings.c
index 6af385c..9a68101 100644
--- a/src/plugins/gs-plugin-fedora-tagger-ratings.c
+++ b/src/plugins/gs-plugin-fedora-tagger-ratings.c
@@ -234,7 +234,7 @@ gs_plugin_app_set_rating_pkg (GsPlugin *plugin,
*/
gboolean
gs_plugin_app_set_rating (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -246,7 +246,7 @@ gs_plugin_app_set_rating (GsPlugin *plugin,
/* get the package name */
sources = gs_app_get_sources (app);
if (sources->len == 0) {
- g_warning ("no pkgname for %s", gs_app_get_id (app));
+ g_warning ("no pkgname for %s", as_app_get_id (app));
goto out;
}
@@ -663,7 +663,7 @@ gs_plugin_refine (GsPlugin *plugin,
{
GList *l;
GPtrArray *sources;
- GsApp *app;
+ AsApp *app;
const gchar *pkgname;
gboolean ret = TRUE;
gint rating;
@@ -684,7 +684,7 @@ gs_plugin_refine (GsPlugin *plugin,
/* add any missing ratings data */
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
if (gs_app_get_rating (app) != -1)
continue;
sources = gs_app_get_sources (app);
@@ -705,7 +705,7 @@ gs_plugin_refine (GsPlugin *plugin,
gs_app_set_rating_kind (app, GS_APP_RATING_KIND_SYSTEM);
if (confidence > 50 && rating > 80) {
g_debug ("%s is popular [confidence %i]",
- gs_app_get_id (app), confidence);
+ as_app_get_id (app), confidence);
gs_app_add_kudo (app, GS_APP_KUDO_POPULAR);
}
}
diff --git a/src/plugins/gs-plugin-fedora-tagger-usage.c b/src/plugins/gs-plugin-fedora-tagger-usage.c
index 3be2284..d2f133a 100644
--- a/src/plugins/gs-plugin-fedora-tagger-usage.c
+++ b/src/plugins/gs-plugin-fedora-tagger-usage.c
@@ -179,7 +179,7 @@ gs_plugin_app_set_usage_pkg (GsPlugin *plugin,
*/
static gboolean
gs_plugin_app_set_usage_app (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
gboolean is_install,
GError **error)
{
@@ -217,7 +217,7 @@ out:
*/
gboolean
gs_plugin_app_install (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -229,7 +229,7 @@ gs_plugin_app_install (GsPlugin *plugin,
*/
gboolean
gs_plugin_app_remove (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
diff --git a/src/plugins/gs-plugin-hardcoded-categories.c b/src/plugins/gs-plugin-hardcoded-categories.c
index 286e325..ac7d3ea 100644
--- a/src/plugins/gs-plugin-hardcoded-categories.c
+++ b/src/plugins/gs-plugin-hardcoded-categories.c
@@ -181,7 +181,7 @@ gs_plugin_add_category_apps (GsPlugin *plugin,
GsCategory *parent;
const gchar *id;
guint i;
- GsApp *app;
+ AsApp *app;
if (g_strcmp0 (gs_category_get_id (category), "featured") != 0)
return TRUE;
@@ -211,13 +211,13 @@ gs_plugin_refine (GsPlugin *plugin,
{
const gchar *id;
GList *l;
- GsApp *app;
+ AsApp *app;
guint i;
for (i = 0; i < G_N_ELEMENTS (featured); i++) {
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- id = gs_app_get_id_full (app);
+ app = AS_APP (l->data);
+ id = as_app_get_id_full (app);
if (g_strcmp0 (id, featured[i].app) != 0)
continue;
gs_app_add_kudo (app, GS_APP_KUDO_FEATURED_RECOMMENDED);
diff --git a/src/plugins/gs-plugin-hardcoded-featured.c b/src/plugins/gs-plugin-hardcoded-featured.c
index 35712e7..020febb 100644
--- a/src/plugins/gs-plugin-hardcoded-featured.c
+++ b/src/plugins/gs-plugin-hardcoded-featured.c
@@ -41,7 +41,7 @@ gs_plugin_add_featured_app (GList **list,
const gchar *id,
GError **error)
{
- GsApp *app = NULL;
+ AsApp *app = NULL;
gboolean ret = TRUE;
gchar *background = NULL;
gchar *stroke_color = NULL;
@@ -70,11 +70,11 @@ gs_plugin_add_featured_app (GList **list,
/* add app */
app = gs_app_new (id);
gs_app_add_kudo (app, GS_APP_KUDO_FEATURED_RECOMMENDED);
- gs_app_set_metadata (app, "Featured::background", background);
- gs_app_set_metadata (app, "Featured::stroke-color", stroke_color);
- gs_app_set_metadata (app, "Featured::text-color", text_color);
+ as_app_add_metadata (app, "Featured::background", background, -1);
+ as_app_add_metadata (app, "Featured::stroke-color", stroke_color, -1);
+ as_app_add_metadata (app, "Featured::text-color", text_color, -1);
if (text_shadow != NULL)
- gs_app_set_metadata (app, "Featured::text-shadow", text_shadow);
+ as_app_add_metadata (app, "Featured::text-shadow", text_shadow, -1);
gs_plugin_add_app (list, app);
out:
if (app != NULL)
diff --git a/src/plugins/gs-plugin-local-ratings.c b/src/plugins/gs-plugin-local-ratings.c
index d4a96dd..4f1a6a9 100644
--- a/src/plugins/gs-plugin-local-ratings.c
+++ b/src/plugins/gs-plugin-local-ratings.c
@@ -161,7 +161,7 @@ gs_plugin_local_find_app (GsPlugin *plugin, const gchar *app_id)
*/
gboolean
gs_plugin_app_set_rating (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -182,7 +182,7 @@ gs_plugin_app_set_rating (GsPlugin *plugin,
/* insert the entry */
statement = g_strdup_printf ("INSERT OR REPLACE INTO ratings (app_id, rating) "
"VALUES ('%s', '%i');",
- gs_app_get_id (app),
+ as_app_get_id (app),
gs_app_get_rating (app));
rc = sqlite3_exec (plugin->priv->db, statement, NULL, NULL, &error_msg);
if (rc != SQLITE_OK) {
@@ -213,7 +213,7 @@ gs_plugin_refine (GsPlugin *plugin,
gboolean ret = TRUE;
gint rating;
GList *l;
- GsApp *app;
+ AsApp *app;
/* nothing to do here */
if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING) == 0)
@@ -230,12 +230,12 @@ gs_plugin_refine (GsPlugin *plugin,
/* add any missing ratings data */
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_id (app) == NULL)
+ app = AS_APP (l->data);
+ if (as_app_get_id (app) == NULL)
continue;
if (gs_app_get_rating (app) != -1)
continue;
- rating = gs_plugin_local_find_app (plugin, gs_app_get_id (app));
+ rating = gs_plugin_local_find_app (plugin, as_app_get_id (app));
if (rating != -1) {
gs_app_set_rating (app, rating);
gs_app_set_rating_confidence (app, 100);
diff --git a/src/plugins/gs-plugin-menu-spec-refine.c b/src/plugins/gs-plugin-menu-spec-refine.c
index 99cc83b..ec82f1f 100644
--- a/src/plugins/gs-plugin-menu-spec-refine.c
+++ b/src/plugins/gs-plugin-menu-spec-refine.c
@@ -42,7 +42,7 @@ const gchar **
gs_plugin_get_deps (GsPlugin *plugin)
{
static const gchar *deps[] = {
- "appstream", /* need GsApp category data */
+ "appstream", /* need AsApp category data */
"menu-spec-categories", /* need menu-spec data */
NULL };
return deps;
@@ -53,7 +53,7 @@ gs_plugin_get_deps (GsPlugin *plugin)
*/
static gboolean
gs_plugin_refine_app_category (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
const MenuSpecData *cat)
{
const MenuSpecData *msdata;
@@ -69,7 +69,7 @@ gs_plugin_refine_app_category (GsPlugin *plugin,
continue;
if (!g_str_has_prefix (msdata[i].path, cat->path))
continue;
- ret = gs_app_has_category (app, tmp + 2);
+ ret = as_app_has_category (app, tmp + 2);
if (ret) {
tmp = g_strdup_printf ("%s → %s",
gettext (cat->text),
@@ -86,7 +86,7 @@ gs_plugin_refine_app_category (GsPlugin *plugin,
* gs_plugin_refine_app:
*/
static gboolean
-gs_plugin_refine_app (GsPlugin *plugin, GsApp *app)
+gs_plugin_refine_app (GsPlugin *plugin, AsApp *app)
{
const MenuSpecData *msdata;
gboolean ret = FALSE;
@@ -99,7 +99,7 @@ gs_plugin_refine_app (GsPlugin *plugin, GsApp *app)
tmp = g_strstr_len (msdata[i].path, -1, "::");
if (tmp != NULL)
continue;
- ret = gs_app_has_category (app, msdata[i].path);
+ ret = as_app_has_category (app, msdata[i].path);
if (ret) {
ret = gs_plugin_refine_app_category (plugin, app,
&msdata[i]);
@@ -120,7 +120,7 @@ gs_plugin_refine (GsPlugin *plugin,
GError **error)
{
GList *l;
- GsApp *app;
+ AsApp *app;
gboolean ret;
/* nothing to do here */
@@ -128,7 +128,7 @@ gs_plugin_refine (GsPlugin *plugin,
goto out;
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
if (gs_app_get_menu_path (app) == NULL) {
ret = gs_plugin_refine_app (plugin, app);
if (!ret) {
diff --git a/src/plugins/gs-plugin-moduleset.c b/src/plugins/gs-plugin-moduleset.c
index 65c4cca..f840c43 100644
--- a/src/plugins/gs-plugin-moduleset.c
+++ b/src/plugins/gs-plugin-moduleset.c
@@ -104,7 +104,7 @@ gs_plugin_add_popular (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
gboolean ret = TRUE;
gchar **apps = NULL;
guint i;
@@ -148,7 +148,7 @@ gs_plugin_refine (GsPlugin *plugin,
GError **error)
{
GList *l;
- GsApp *app;
+ AsApp *app;
gboolean ret = TRUE;
gchar **apps = NULL;
gchar **pkgs = NULL;
@@ -167,9 +167,9 @@ gs_plugin_refine (GsPlugin *plugin,
GS_MODULESET_MODULE_KIND_APPLICATION,
"system");
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
for (i = 0; apps[i] != NULL; i++) {
- if (g_strcmp0 (apps[i], gs_app_get_id_full (app)) == 0) {
+ if (g_strcmp0 (apps[i], as_app_get_id_full (app)) == 0) {
gs_app_set_kind (app, GS_APP_KIND_SYSTEM);
break;
}
@@ -181,7 +181,7 @@ gs_plugin_refine (GsPlugin *plugin,
GS_MODULESET_MODULE_KIND_PACKAGE,
"core");
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
for (i = 0; pkgs[i] != NULL; i++) {
if (g_strcmp0 (pkgs[i], gs_app_get_source_default (app)) == 0) {
gs_app_set_kind (app, GS_APP_KIND_CORE);
diff --git a/src/plugins/gs-plugin-packagekit-history.c b/src/plugins/gs-plugin-packagekit-history.c
index 6670c5b..b2a2502 100644
--- a/src/plugins/gs-plugin-packagekit-history.c
+++ b/src/plugins/gs-plugin-packagekit-history.c
@@ -78,18 +78,18 @@ gs_plugin_destroy (GsPlugin *plugin)
* gs_plugin_packagekit_refine_add_history:
*/
static void
-gs_plugin_packagekit_refine_add_history (GsApp *app, GVariant *dict)
+gs_plugin_packagekit_refine_add_history (AsApp *app, GVariant *dict)
{
const gchar *version;
gboolean ret;
- GsApp *history;
+ AsApp *history;
guint64 timestamp;
PkInfoEnum info_enum;
/* create new history item with same ID as parent */
- history = gs_app_new (gs_app_get_id_full (app));
+ history = gs_app_new (as_app_get_id_full (app));
gs_app_set_kind (history, GS_APP_KIND_PACKAGE);
- gs_app_set_name (history, GS_APP_QUALITY_NORMAL, gs_app_get_name (app));
+ gs_app_set_name (history, GS_APP_QUALITY_NORMAL, as_app_get_name (app, NULL));
/* get the installed state */
ret = g_variant_lookup (dict, "info", "u", &info_enum);
@@ -160,8 +160,8 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
gboolean ret = TRUE;
GError *error_local = NULL;
GList *l;
- GsApp *app;
- GsApp *app_dummy;
+ AsApp *app;
+ AsApp *app_dummy;
guint i = 0;
GVariantIter iter;
GVariant *result = NULL;
@@ -179,7 +179,7 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
/* get an array of package names */
package_names = g_new0 (const gchar *, g_list_length (list) + 1);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
package_names[i++] = gs_app_get_source_default (app);
}
@@ -206,7 +206,7 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
/* just set this to something non-zero so we don't keep
* trying to call GetPackageHistory */
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
gs_app_set_install_date (app, GS_APP_INSTALL_DATE_UNKNOWN);
}
} else if (g_error_matches (error_local,
@@ -216,7 +216,7 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
error_local->message);
g_error_free (error_local);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
gs_app_set_install_date (app, GS_APP_INSTALL_DATE_UNKNOWN);
}
} else {
@@ -229,7 +229,7 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
/* get any results */
tuple = g_variant_get_child_value (result, 0);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
ret = g_variant_lookup (tuple,
gs_app_get_source_default (app),
"@aa{sv}",
@@ -237,8 +237,8 @@ gs_plugin_packagekit_refine (GsPlugin *plugin,
if (!ret) {
/* make up a fake entry as we know this package was at
* least installed at some point in time */
- if (gs_app_get_state (app) == AS_APP_STATE_INSTALLED) {
- app_dummy = gs_app_new (gs_app_get_id_full (app));
+ if (as_app_get_state (app) == AS_APP_STATE_INSTALLED) {
+ app_dummy = gs_app_new (as_app_get_id_full (app));
gs_app_set_install_date (app_dummy, GS_APP_INSTALL_DATE_UNKNOWN);
gs_app_set_kind (app_dummy, GS_APP_KIND_PACKAGE);
gs_app_set_state (app_dummy, AS_APP_STATE_INSTALLED);
@@ -282,7 +282,7 @@ gs_plugin_refine (GsPlugin *plugin,
gboolean ret = TRUE;
GList *l;
GList *packages = NULL;
- GsApp *app;
+ AsApp *app;
GPtrArray *sources;
if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_HISTORY) == 0)
@@ -290,7 +290,7 @@ gs_plugin_refine (GsPlugin *plugin,
/* add any missing history data */
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
sources = gs_app_get_sources (app);
if (sources->len == 0)
continue;
diff --git a/src/plugins/gs-plugin-packagekit-offline.c b/src/plugins/gs-plugin-packagekit-offline.c
index 20eb00a..dce0df9 100644
--- a/src/plugins/gs-plugin-packagekit-offline.c
+++ b/src/plugins/gs-plugin-packagekit-offline.c
@@ -50,7 +50,7 @@ gs_plugin_add_updates_historical (GsPlugin *plugin,
gchar *packages = NULL;
gchar **split;
GKeyFile *key_file = NULL;
- GsApp *app;
+ AsApp *app;
guint i;
/* was any offline update attempted */
diff --git a/src/plugins/gs-plugin-packagekit-refine.c b/src/plugins/gs-plugin-packagekit-refine.c
index 40d64ed..1441969 100644
--- a/src/plugins/gs-plugin-packagekit-refine.c
+++ b/src/plugins/gs-plugin-packagekit-refine.c
@@ -121,7 +121,7 @@ gs_plugin_packagekit_progress_cb (PkProgress *progress,
**/
static void
gs_plugin_packagekit_set_origin (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
const gchar *id)
{
const gchar *name;
@@ -138,7 +138,7 @@ gs_plugin_packagekit_set_origin (GsPlugin *plugin,
static void
gs_plugin_packagekit_resolve_packages_app (GsPlugin *plugin,
GPtrArray *packages,
- GsApp *app)
+ AsApp *app)
{
GPtrArray *sources;
PkPackage *package;
@@ -195,12 +195,12 @@ gs_plugin_packagekit_resolve_packages_app (GsPlugin *plugin,
/* if *all* the source packages for the app are installed then the
* application is considered completely installed */
if (number_installed == sources->len && number_available == 0) {
- if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
+ if (as_app_get_state (app) == AS_APP_STATE_UNKNOWN)
gs_app_set_state (app, AS_APP_STATE_INSTALLED);
} else if (number_installed + number_available == sources->len) {
/* if all the source packages are installed and all the rest
* of the packages are available then the app is available */
- if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
+ if (as_app_get_state (app) == AS_APP_STATE_UNKNOWN)
gs_app_set_state (app, AS_APP_STATE_AVAILABLE);
} else if (number_installed + number_available > sources->len) {
/* we have more packages returned than source packages */
@@ -230,7 +230,7 @@ gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
GPtrArray *package_ids = NULL;
GPtrArray *packages = NULL;
GPtrArray *sources;
- GsApp *app;
+ AsApp *app;
PkError *error_code = NULL;
PkResults *results = NULL;
const gchar *pkgname;
@@ -239,7 +239,7 @@ gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
package_ids = g_ptr_array_new_with_free_func (g_free);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
sources = gs_app_get_sources (app);
for (i = 0; i < sources->len; i++) {
pkgname = g_ptr_array_index (sources, i);
@@ -276,7 +276,7 @@ gs_plugin_packagekit_resolve_packages (GsPlugin *plugin,
/* get results */
packages = pk_results_get_package_array (results);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
gs_plugin_packagekit_resolve_packages_app (plugin, packages, app);
}
out:
@@ -295,7 +295,7 @@ out:
static gboolean
gs_plugin_packagekit_refine_from_desktop (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
const gchar *filename,
GCancellable *cancellable,
GError **error)
@@ -342,7 +342,7 @@ gs_plugin_packagekit_refine_from_desktop (GsPlugin *plugin,
gs_app_set_management_plugin (app, "PackageKit");
} else {
g_warning ("Failed to find one package for %s, %s, [%d]",
- gs_app_get_id (app), filename, packages->len);
+ as_app_get_id (app), filename, packages->len);
}
out:
if (packages != NULL)
@@ -370,7 +370,7 @@ gs_plugin_packagekit_refine_updatedetails (GsPlugin *plugin,
const gchar **package_ids;
GList *l;
GPtrArray *array = NULL;
- GsApp *app;
+ AsApp *app;
guint i = 0;
guint size;
PkResults *results = NULL;
@@ -379,7 +379,7 @@ gs_plugin_packagekit_refine_updatedetails (GsPlugin *plugin,
size = g_list_length (list);
package_ids = g_new0 (const gchar *, size + 1);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
package_id = gs_app_get_source_id_default (app);
package_ids[i++] = package_id;
}
@@ -398,7 +398,7 @@ gs_plugin_packagekit_refine_updatedetails (GsPlugin *plugin,
/* set the update details for the update */
array = pk_results_get_update_detail_array (results);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
package_id = gs_app_get_source_id_default (app);
for (i = 0; i < array->len; i++) {
/* right package? */
@@ -462,7 +462,7 @@ gs_pk_compare_ids (const gchar *package_id1, const gchar *package_id2)
static void
gs_plugin_packagekit_refine_details_app (GsPlugin *plugin,
GPtrArray *array,
- GsApp *app)
+ AsApp *app)
{
GPtrArray *source_ids;
PkDetails *details;
@@ -482,12 +482,12 @@ gs_plugin_packagekit_refine_details_app (GsPlugin *plugin,
pk_details_get_package_id (details)) != 0) {
continue;
}
- if (gs_app_get_licence (app) == NULL)
- gs_app_set_licence (app, pk_details_get_license (details));
- if (gs_app_get_url (app, GS_APP_URL_KIND_HOMEPAGE) == NULL) {
- gs_app_set_url (app,
- GS_APP_URL_KIND_HOMEPAGE,
- pk_details_get_url (details));
+ if (as_app_get_project_license (app) == NULL)
+ as_app_set_project_license (app, pk_details_get_license (details), -1);
+ if (as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE) == NULL) {
+ as_app_add_url (app,
+ AS_URL_KIND_HOMEPAGE,
+ pk_details_get_url (details), -1);
}
size += pk_details_get_size (details);
desc = gs_pk_format_desc (pk_details_get_description (details));
@@ -522,7 +522,7 @@ gs_plugin_packagekit_refine_details (GsPlugin *plugin,
GPtrArray *array = NULL;
GPtrArray *package_ids;
GPtrArray *source_ids;
- GsApp *app;
+ AsApp *app;
PkResults *results = NULL;
const gchar *package_id;
gboolean ret = TRUE;
@@ -530,7 +530,7 @@ gs_plugin_packagekit_refine_details (GsPlugin *plugin,
package_ids = g_ptr_array_new_with_free_func (g_free);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
source_ids = gs_app_get_source_ids (app);
for (i = 0; i < source_ids->len; i++) {
package_id = g_ptr_array_index (source_ids, i);
@@ -553,7 +553,7 @@ gs_plugin_packagekit_refine_details (GsPlugin *plugin,
/* set the update details for the update */
array = pk_results_get_details_array (results);
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
gs_plugin_packagekit_refine_details_app (plugin, array, app);
}
out:
@@ -569,15 +569,15 @@ out:
* gs_plugin_refine_app_needs_details:
*/
static gboolean
-gs_plugin_refine_app_needs_details (GsPlugin *plugin, GsApp *app)
+gs_plugin_refine_app_needs_details (GsPlugin *plugin, AsApp *app)
{
- if (gs_app_get_licence (app) == NULL)
+ if (as_app_get_project_license (app) == NULL)
return TRUE;
- if (gs_app_get_url (app, GS_APP_URL_KIND_HOMEPAGE) == NULL)
+ if (as_app_get_url_item (app, AS_URL_KIND_HOMEPAGE) == NULL)
return TRUE;
if (gs_app_get_size (app) == GS_APP_SIZE_UNKNOWN)
return TRUE;
- if (gs_app_get_description (app) == NULL && plugin->use_pkg_descriptions)
+ if (as_app_get_description (app, NULL) == NULL && plugin->use_pkg_descriptions)
return TRUE;
return FALSE;
}
@@ -593,13 +593,13 @@ gs_plugin_refine_require_details (GsPlugin *plugin,
{
GList *l;
GList *list_tmp = NULL;
- GsApp *app;
+ AsApp *app;
gboolean ret = TRUE;
gs_profile_start (plugin->profile, "packagekit-refine[source->licence]");
for (l = list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_id_kind (app) == AS_ID_KIND_WEB_APP)
+ app = AS_APP (l->data);
+ if (as_app_get_id_kind (app) == AS_ID_KIND_WEB_APP)
continue;
if (gs_app_get_source_id_default (app) == NULL)
continue;
@@ -666,7 +666,7 @@ out:
* gs_plugin_refine_requires_version:
*/
static gboolean
-gs_plugin_refine_requires_version (GsApp *app, GsPluginRefineFlags flags)
+gs_plugin_refine_requires_version (AsApp *app, GsPluginRefineFlags flags)
{
const gchar *tmp;
tmp = gs_app_get_version (app);
@@ -679,7 +679,7 @@ gs_plugin_refine_requires_version (GsApp *app, GsPluginRefineFlags flags)
* gs_plugin_refine_requires_update_details:
*/
static gboolean
-gs_plugin_refine_requires_update_details (GsApp *app, GsPluginRefineFlags flags)
+gs_plugin_refine_requires_update_details (AsApp *app, GsPluginRefineFlags flags)
{
const gchar *tmp;
tmp = gs_app_get_update_details (app);
@@ -692,7 +692,7 @@ gs_plugin_refine_requires_update_details (GsApp *app, GsPluginRefineFlags flags)
* gs_plugin_refine_requires_package_id:
*/
static gboolean
-gs_plugin_refine_requires_package_id (GsApp *app, GsPluginRefineFlags flags)
+gs_plugin_refine_requires_package_id (AsApp *app, GsPluginRefineFlags flags)
{
const gchar *tmp;
tmp = gs_app_get_source_id_default (app);
@@ -731,7 +731,7 @@ gs_plugin_refine (GsPlugin *plugin,
GList *resolve_all = NULL;
GList *updatedetails_all = NULL;
GPtrArray *sources;
- GsApp *app;
+ AsApp *app;
const gchar *tmp;
gboolean ret = TRUE;
@@ -748,15 +748,15 @@ gs_plugin_refine (GsPlugin *plugin,
/* can we resolve in one go? */
gs_profile_start (plugin->profile, "packagekit-refine[name->id]");
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
if (gs_app_get_source_id_default (app) != NULL)
continue;
- if (gs_app_get_id_kind (app) == AS_ID_KIND_WEB_APP)
+ if (as_app_get_id_kind (app) == AS_ID_KIND_WEB_APP)
continue;
sources = gs_app_get_sources (app);
if (sources->len == 0)
continue;
- if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN ||
+ if (as_app_get_state (app) == AS_APP_STATE_UNKNOWN ||
gs_plugin_refine_requires_package_id (app, flags) ||
gs_plugin_refine_requires_version (app, flags)) {
resolve_all = g_list_prepend (resolve_all, app);
@@ -777,10 +777,10 @@ gs_plugin_refine (GsPlugin *plugin,
for (l = *list; l != NULL; l = l->next) {
if ((flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_SETUP_ACTION) == 0)
continue;
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
if (gs_app_get_source_id_default (app) != NULL)
continue;
- tmp = gs_app_get_metadata_item (app, "DataDir::desktop-filename");
+ tmp = as_app_get_metadata_item (app, "DataDir::desktop-filename");
if (tmp == NULL)
continue;
ret = gs_plugin_packagekit_refine_from_desktop (plugin,
@@ -796,8 +796,8 @@ gs_plugin_refine (GsPlugin *plugin,
/* any update details missing? */
gs_profile_start (plugin->profile, "packagekit-refine[id->update-details]");
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_state (app) != AS_APP_STATE_UPDATABLE)
+ app = AS_APP (l->data);
+ if (as_app_get_state (app) != AS_APP_STATE_UPDATABLE)
continue;
if (gs_plugin_refine_requires_update_details (app, flags))
updatedetails_all = g_list_prepend (updatedetails_all, app);
diff --git a/src/plugins/gs-plugin-packagekit-refresh.c b/src/plugins/gs-plugin-packagekit-refresh.c
index 18a2e0b..7130602 100644
--- a/src/plugins/gs-plugin-packagekit-refresh.c
+++ b/src/plugins/gs-plugin-packagekit-refresh.c
@@ -170,7 +170,7 @@ out:
* - Multiple line text, so first line to summary and the rest to description
*/
static void
-gs_plugin_packagekit_refresh_set_text (GsApp *app, const gchar *text)
+gs_plugin_packagekit_refresh_set_text (AsApp *app, const gchar *text)
{
gchar *nl;
gchar *tmp;
@@ -209,7 +209,7 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
gchar **files;
gchar **split = NULL;
GPtrArray *array = NULL;
- GsApp *app = NULL;
+ AsApp *app = NULL;
PkDetails *item;
PkResults *results = NULL;
@@ -270,15 +270,15 @@ gs_plugin_filename_to_app (GsPlugin *plugin,
#endif
gs_app_set_name (app, GS_APP_QUALITY_LOWEST, split[PK_PACKAGE_ID_NAME]);
gs_app_set_version (app, split[PK_PACKAGE_ID_VERSION]);
- gs_app_set_metadata (app, "PackageKit::local-filename", filename);
+ as_app_add_metadata (app, "PackageKit::local-filename", filename, -1);
gs_app_set_origin (app, basename);
gs_app_add_source (app, split[PK_PACKAGE_ID_NAME]);
gs_app_add_source_id (app, package_id);
gs_plugin_packagekit_refresh_set_text (app,
pk_details_get_description (item));
- gs_app_set_url (app, GS_APP_URL_KIND_HOMEPAGE, pk_details_get_url (item));
+ as_app_add_url (app, AS_URL_KIND_HOMEPAGE, pk_details_get_url (item), -1);
gs_app_set_size (app, pk_details_get_size (item));
- gs_app_set_licence (app, pk_details_get_license (item));
+ as_app_set_project_license (app, pk_details_get_license (item), -1);
gs_plugin_add_app (list, app);
out:
if (app != NULL)
diff --git a/src/plugins/gs-plugin-packagekit-updates.c b/src/plugins/gs-plugin-packagekit-updates.c
index 95e513d..94076e9 100644
--- a/src/plugins/gs-plugin-packagekit-updates.c
+++ b/src/plugins/gs-plugin-packagekit-updates.c
@@ -108,7 +108,7 @@ gs_plugin_add_updates (GsPlugin *plugin,
{
gboolean ret = TRUE;
GPtrArray *array = NULL;
- GsApp *app;
+ AsApp *app;
guint i;
PkBitfield filter;
PkPackage *pkg;
diff --git a/src/plugins/gs-plugin-packagekit.c b/src/plugins/gs-plugin-packagekit.c
index 379ef44..1f71dbf 100644
--- a/src/plugins/gs-plugin-packagekit.c
+++ b/src/plugins/gs-plugin-packagekit.c
@@ -151,8 +151,8 @@ gs_plugin_add_sources_related (GsPlugin *plugin,
{
GList *installed = NULL;
GList *l;
- GsApp *app;
- GsApp *app_tmp;
+ AsApp *app;
+ AsApp *app_tmp;
PkBitfield filter;
PkResults *results = NULL;
const gchar *id;
@@ -181,7 +181,7 @@ gs_plugin_add_sources_related (GsPlugin *plugin,
if (!ret)
goto out;
for (l = installed; l != NULL; l = l->next) {
- app = GS_APP (l->data);
+ app = AS_APP (l->data);
split = pk_package_id_split (gs_app_get_source_id_default (app));
if (g_str_has_prefix (split[PK_PACKAGE_ID_DATA], "installed:")) {
id = split[PK_PACKAGE_ID_DATA] + 10;
@@ -212,7 +212,7 @@ gs_plugin_add_sources (GsPlugin *plugin,
GError **error)
{
GPtrArray *array = NULL;
- GsApp *app;
+ AsApp *app;
PkBitfield filter;
PkRepoDetail *rd;
PkResults *results;
@@ -279,7 +279,7 @@ out:
*/
gboolean
gs_plugin_app_install (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -298,7 +298,7 @@ gs_plugin_app_install (GsPlugin *plugin,
goto out;
/* get the list of available package ids to install */
- switch (gs_app_get_state (app)) {
+ switch (as_app_get_state (app)) {
case AS_APP_STATE_AVAILABLE:
case AS_APP_STATE_UPDATABLE:
source_ids = gs_app_get_source_ids (app);
@@ -320,7 +320,7 @@ gs_plugin_app_install (GsPlugin *plugin,
addons = gs_app_get_addons (app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon = g_ptr_array_index (addons, i);
+ AsApp *addon = g_ptr_array_index (addons, i);
if (!gs_app_get_to_be_installed (addon))
continue;
@@ -346,7 +346,7 @@ gs_plugin_app_install (GsPlugin *plugin,
gs_app_set_state (app, AS_APP_STATE_INSTALLING);
addons = gs_app_get_addons (app);
for (i = 0; i < addons->len; i++) {
- GsApp *addon = g_ptr_array_index (addons, i);
+ AsApp *addon = g_ptr_array_index (addons, i);
if (gs_app_get_to_be_installed (addon))
gs_app_set_state (addon, AS_APP_STATE_INSTALLING);
}
@@ -361,7 +361,7 @@ gs_plugin_app_install (GsPlugin *plugin,
}
break;
case AS_APP_STATE_AVAILABLE_LOCAL:
- package_id = gs_app_get_metadata_item (app, "PackageKit::local-filename");
+ package_id = as_app_get_metadata_item (app, "PackageKit::local-filename");
if (package_id == NULL) {
ret = FALSE;
g_set_error_literal (error,
@@ -388,7 +388,7 @@ gs_plugin_app_install (GsPlugin *plugin,
GS_PLUGIN_ERROR,
GS_PLUGIN_ERROR_FAILED,
"do not know how to install app in state %s",
- as_app_state_to_string (gs_app_get_state (app)));
+ as_app_state_to_string (as_app_get_state (app)));
goto out;
}
@@ -420,7 +420,7 @@ out:
*/
static gboolean
gs_plugin_app_source_disable (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -430,7 +430,7 @@ gs_plugin_app_source_disable (GsPlugin *plugin,
/* do sync call */
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING);
results = pk_client_repo_enable (PK_CLIENT (plugin->priv->task),
- gs_app_get_id (app),
+ as_app_get_id (app),
FALSE,
cancellable,
gs_plugin_packagekit_progress_cb, plugin,
@@ -450,7 +450,7 @@ out:
*/
static gboolean
gs_plugin_app_source_remove (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
@@ -463,7 +463,7 @@ gs_plugin_app_source_remove (GsPlugin *plugin,
gs_plugin_status_update (plugin, NULL, GS_PLUGIN_STATUS_WAITING);
results = pk_client_repo_remove (PK_CLIENT (plugin->priv->task),
pk_bitfield_from_enums (PK_TRANSACTION_FLAG_ENUM_NONE, -1),
- gs_app_get_id (app),
+ as_app_get_id (app),
TRUE,
cancellable,
gs_plugin_packagekit_progress_cb, plugin,
@@ -493,7 +493,7 @@ out:
*/
gboolean
gs_plugin_app_remove (GsPlugin *plugin,
- GsApp *app,
+ AsApp *app,
GCancellable *cancellable,
GError **error)
{
diff --git a/src/plugins/gs-plugin-self-test.c b/src/plugins/gs-plugin-self-test.c
index e010134..39fb73b 100644
--- a/src/plugins/gs-plugin-self-test.c
+++ b/src/plugins/gs-plugin-self-test.c
@@ -54,12 +54,12 @@ gs_plugin_refine (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
GList *l;
for (l = *list; l != NULL; l = l->next) {
- app = GS_APP (l->data);
- if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
+ app = AS_APP (l->data);
+ if (as_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
gs_app_set_state (app, AS_APP_STATE_INSTALLED);
gs_app_set_kind (app, GS_APP_KIND_NORMAL);
}
diff --git a/src/plugins/gs-plugin-systemd-updates.c b/src/plugins/gs-plugin-systemd-updates.c
index 31dd1a8..24e3fe5 100644
--- a/src/plugins/gs-plugin-systemd-updates.c
+++ b/src/plugins/gs-plugin-systemd-updates.c
@@ -110,7 +110,7 @@ gs_plugin_add_updates (GsPlugin *plugin,
GCancellable *cancellable,
GError **error)
{
- GsApp *app;
+ AsApp *app;
gboolean ret;
gchar **package_ids = NULL;
gchar **split;
diff --git a/src/plugins/packagekit-common.c b/src/plugins/packagekit-common.c
index 38692bf..b51fd54 100644
--- a/src/plugins/packagekit-common.c
+++ b/src/plugins/packagekit-common.c
@@ -95,7 +95,7 @@ gs_plugin_packagekit_add_results (GsPlugin *plugin,
GHashTable *installed = NULL;
GPtrArray *array = NULL;
GPtrArray *array_filtered = NULL;
- GsApp *app;
+ AsApp *app;
guint i;
PkError *error_code = NULL;
PkPackage *package;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]