[gnome-software: 3/4] gs-plugin-job: Drop unused age property




commit e4845d217e5f86281a920b37928aef8e73d50aad
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue May 24 18:35:15 2022 +0100

    gs-plugin-job: Drop unused age property
    
    It’s no longer used since moving refresh jobs to
    `GsPluginJobRefreshMetadata`.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1472

 lib/gs-plugin-job-private.h |  1 -
 lib/gs-plugin-job.c         | 37 -------------------------------------
 lib/gs-plugin-job.h         |  2 --
 3 files changed, 40 deletions(-)
---
diff --git a/lib/gs-plugin-job-private.h b/lib/gs-plugin-job-private.h
index 0d0e0af50..895f70ab2 100644
--- a/lib/gs-plugin-job-private.h
+++ b/lib/gs-plugin-job-private.h
@@ -27,7 +27,6 @@ gboolean               gs_plugin_job_get_interactive          (GsPluginJob    *self);
 gboolean                gs_plugin_job_get_propagate_error      (GsPluginJob    *self);
 guint                   gs_plugin_job_get_max_results          (GsPluginJob    *self);
 guint                   gs_plugin_job_get_timeout              (GsPluginJob    *self);
-guint64                         gs_plugin_job_get_age                  (GsPluginJob    *self);
 GsAppListSortFunc       gs_plugin_job_get_sort_func            (GsPluginJob    *self,
                                                                 gpointer       *user_data_out);
 const gchar            *gs_plugin_job_get_search               (GsPluginJob    *self);
diff --git a/lib/gs-plugin-job.c b/lib/gs-plugin-job.c
index 6bcf56697..ae7b44e6f 100644
--- a/lib/gs-plugin-job.c
+++ b/lib/gs-plugin-job.c
@@ -23,7 +23,6 @@ typedef struct
        gboolean                 propagate_error;
        guint                    max_results;
        guint                    timeout;
-       guint64                  age;
        GsPlugin                *plugin;
        GsPluginAction           action;
        GsAppListSortFunc        sort_func;
@@ -38,7 +37,6 @@ typedef struct
 enum {
        PROP_0,
        PROP_ACTION,
-       PROP_AGE,
        PROP_SEARCH,
        PROP_REFINE_FLAGS,
        PROP_DEDUPE_FLAGS,
@@ -80,14 +78,6 @@ gs_plugin_job_to_string (GsPluginJob *self)
                g_string_append_printf (str, " with timeout=%u", priv->timeout);
        if (priv->max_results > 0)
                g_string_append_printf (str, " with max-results=%u", priv->max_results);
-       if (priv->age != 0) {
-               if (priv->age == G_MAXUINT) {
-                       g_string_append (str, " with cache age=any");
-               } else {
-                       g_string_append_printf (str, " with cache age=%" G_GUINT64_FORMAT,
-                                               priv->age);
-               }
-       }
        if (priv->search != NULL) {
                g_string_append_printf (str, " with search=%s",
                                        priv->search);
@@ -234,22 +224,6 @@ gs_plugin_job_get_timeout (GsPluginJob *self)
        return priv->timeout;
 }
 
-void
-gs_plugin_job_set_age (GsPluginJob *self, guint64 age)
-{
-       GsPluginJobPrivate *priv = gs_plugin_job_get_instance_private (self);
-       g_return_if_fail (GS_IS_PLUGIN_JOB (self));
-       priv->age = age;
-}
-
-guint64
-gs_plugin_job_get_age (GsPluginJob *self)
-{
-       GsPluginJobPrivate *priv = gs_plugin_job_get_instance_private (self);
-       g_return_val_if_fail (GS_IS_PLUGIN_JOB (self), 0);
-       return priv->age;
-}
-
 void
 gs_plugin_job_set_action (GsPluginJob *self, GsPluginAction action)
 {
@@ -382,9 +356,6 @@ gs_plugin_job_get_property (GObject *obj, guint prop_id, GValue *value, GParamSp
        case PROP_ACTION:
                g_value_set_enum (value, priv->action);
                break;
-       case PROP_AGE:
-               g_value_set_uint64 (value, priv->age);
-               break;
        case PROP_REFINE_FLAGS:
                g_value_set_flags (value, priv->refine_flags);
                break;
@@ -430,9 +401,6 @@ gs_plugin_job_set_property (GObject *obj, guint prop_id, const GValue *value, GP
        case PROP_ACTION:
                gs_plugin_job_set_action (self, g_value_get_enum (value));
                break;
-       case PROP_AGE:
-               gs_plugin_job_set_age (self, g_value_get_uint64 (value));
-               break;
        case PROP_REFINE_FLAGS:
                gs_plugin_job_set_refine_flags (self, g_value_get_flags (value));
                break;
@@ -498,11 +466,6 @@ gs_plugin_job_class_init (GsPluginJobClass *klass)
                                   G_PARAM_READWRITE);
        g_object_class_install_property (object_class, PROP_ACTION, pspec);
 
-       pspec = g_param_spec_uint64 ("age", NULL, NULL,
-                                    0, G_MAXUINT64, 0,
-                                    G_PARAM_READWRITE);
-       g_object_class_install_property (object_class, PROP_AGE, pspec);
-
        pspec = g_param_spec_flags ("refine-flags", NULL, NULL,
                                    GS_TYPE_PLUGIN_REFINE_FLAGS, GS_PLUGIN_REFINE_FLAGS_NONE,
                                    G_PARAM_READWRITE);
diff --git a/lib/gs-plugin-job.h b/lib/gs-plugin-job.h
index e7ebd1374..bec7e8d89 100644
--- a/lib/gs-plugin-job.h
+++ b/lib/gs-plugin-job.h
@@ -47,8 +47,6 @@ void           gs_plugin_job_set_max_results          (GsPluginJob    *self,
                                                         guint           max_results);
 void            gs_plugin_job_set_timeout              (GsPluginJob    *self,
                                                         guint           timeout);
-void            gs_plugin_job_set_age                  (GsPluginJob    *self,
-                                                        guint64         age);
 void            gs_plugin_job_set_sort_func            (GsPluginJob    *self,
                                                         GsAppListSortFunc sort_func,
                                                         gpointer        user_data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]