[gnome-software/gnome-3-20] trivial: Remove an unused function
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-20] trivial: Remove an unused function
- Date: Tue, 19 Apr 2016 07:41:06 +0000 (UTC)
commit fbed9064bfc5b95f5eabcd34759c7975dc334065
Author: Richard Hughes <richard hughsie com>
Date: Mon Apr 18 10:56:07 2016 +0100
trivial: Remove an unused function
src/gs-app.c | 85 ----------------------------------------------------
src/gs-app.h | 3 --
src/gs-self-test.c | 14 --------
3 files changed, 0 insertions(+), 102 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 1593f1b..ee79ed4 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -2109,91 +2109,6 @@ gs_app_add_quirk (GsApp *app, AsAppQuirk quirk)
}
/**
- * gs_app_subsume:
- *
- * Imports all the useful data from @other into @app.
- *
- * IMPORTANT: This method can be called from a thread as the notify signals
- * are not sent.
- **/
-void
-gs_app_subsume (GsApp *app, GsApp *other)
-{
- const gchar *tmp;
- GList *keys;
- GList *l;
- GsApp *app_tmp;
- guint i;
-
- g_return_if_fail (GS_IS_APP (app));
- g_return_if_fail (GS_IS_APP (other));
- g_return_if_fail (app != other);
-
- /* an [updatable] installable package is more information than
- * just the fact that something is installed */
- if (other->state == AS_APP_STATE_UPDATABLE &&
- app->state == 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);
- gs_app_set_state_internal (app, AS_APP_STATE_UPDATABLE);
- }
-
- /* save any properties we already know */
- if (other->sources->len > 0)
- gs_app_set_sources (app, other->sources);
- if (other->project_group != NULL)
- gs_app_set_project_group (app, other->project_group);
- if (other->name != NULL)
- gs_app_set_name (app, other->name_quality, other->name);
- if (other->summary != NULL)
- gs_app_set_summary (app, other->summary_quality, other->summary);
- if (other->match_value != 0)
- gs_app_set_match_value (app, other->match_value);
- if (other->description != NULL)
- gs_app_set_description (app, other->description_quality, other->description);
- if (other->update_details != NULL)
- gs_app_set_update_details (app, other->update_details);
- if (other->management_plugin != NULL &&
- app->management_plugin != NULL &&
- g_strcmp0 (other->management_plugin, app->management_plugin) != 0) {
- g_warning ("%s changing management plugin %s->%s",
- app->id,
- app->management_plugin,
- other->management_plugin);
- }
- if (other->update_urgency != AS_URGENCY_KIND_UNKNOWN)
- gs_app_set_update_urgency (app, other->update_urgency);
- if (other->update_version != NULL)
- gs_app_set_update_version_internal (app, other->update_version);
- if (other->pixbuf != NULL)
- gs_app_set_pixbuf (app, other->pixbuf);
- if (app->categories != other->categories) {
- for (i = 0; i < other->categories->len; i++) {
- tmp = g_ptr_array_index (other->categories, i);
- gs_app_add_category (app, tmp);
- }
- }
- for (i = 0; i < other->related->len; i++) {
- app_tmp = g_ptr_array_index (other->related, i);
- gs_app_add_related (app, app_tmp);
- }
- app->kudos |= other->kudos;
-
- /* copy metadata from @other to @app unless the app already has a key
- * of that name */
- keys = g_hash_table_get_keys (other->metadata);
- for (l = keys; l != NULL; l = l->next) {
- tmp = g_hash_table_lookup (app->metadata, l->data);
- if (tmp != NULL)
- continue;
- tmp = g_hash_table_lookup (other->metadata, l->data);
- gs_app_set_metadata (app, l->data, tmp);
- }
- g_list_free (keys);
-}
-
-/**
* gs_app_set_match_value:
*/
void
diff --git a/src/gs-app.h b/src/gs-app.h
index 95c5fc0..6cb48c2 100644
--- a/src/gs-app.h
+++ b/src/gs-app.h
@@ -86,9 +86,6 @@ GQuark gs_app_error_quark (void);
GsApp *gs_app_new (const gchar *id);
gchar *gs_app_to_string (GsApp *app);
-void gs_app_subsume (GsApp *app,
- GsApp *other);
-
const gchar *gs_app_get_id (GsApp *app);
void gs_app_set_id (GsApp *app,
const gchar *id);
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index 878c040..7a0cb1b 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -106,19 +106,6 @@ gs_plugin_func (void)
}
static void
-gs_app_subsume_func (void)
-{
- g_autoptr(GsApp) new = NULL;
- g_autoptr(GsApp) old = NULL;
-
- new = gs_app_new ("xxx.desktop");
- old = gs_app_new ("yyy.desktop");
- gs_app_set_metadata (old, "foo", "bar");
- gs_app_subsume (new, old);
- g_assert_cmpstr (gs_app_get_metadata_item (new, "foo"), ==, "bar");
-}
-
-static void
gs_app_func (void)
{
g_autoptr(GsApp) app = NULL;
@@ -519,7 +506,6 @@ main (int argc, char **argv)
/* generic tests go here */
g_test_add_func ("/gnome-software/app", gs_app_func);
- g_test_add_func ("/gnome-software/app{subsume}", gs_app_subsume_func);
g_test_add_func ("/gnome-software/plugin", gs_plugin_func);
/* we can only load this once per process */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]