[gnome-software] GsApp: Add a new do-not-auto-update quirk



commit 86ea8277ec8ff175f082766ba06cb9d3b4b96172
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon Feb 10 12:35:03 2020 +1300

    GsApp: Add a new do-not-auto-update quirk
    
    Allow apps to explicitly stop themselves from being automatically updated.

 lib/gs-app.c            | 2 ++
 lib/gs-app.h            | 2 ++
 src/gs-update-monitor.c | 2 ++
 3 files changed, 6 insertions(+)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index eb6853ae..b7830009 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -252,6 +252,8 @@ _as_app_quirk_flag_to_string (GsAppQuirk quirk)
                return "hide-from-search";
        case GS_APP_QUIRK_HIDE_EVERYWHERE:
                return "hide-everywhere";
+       case GS_APP_QUIRK_DO_NOT_AUTO_UPDATE:
+               return "do-not-auto-update";
        default:
                return NULL;
        }
diff --git a/lib/gs-app.h b/lib/gs-app.h
index dc07cbf8..5cf1fa05 100644
--- a/lib/gs-app.h
+++ b/lib/gs-app.h
@@ -85,6 +85,7 @@ typedef enum {
  * @GS_APP_QUIRK_PARENTAL_NOT_LAUNCHABLE:      The app cannot be run by the current user due to parental 
controls, and should not be launchable
  * @GS_APP_QUIRK_HIDE_FROM_SEARCH:     The app should not be shown in search results
  * @GS_APP_QUIRK_HIDE_EVERYWHERE:      The app should not be shown anywhere (it’s blacklisted)
+ * @GS_APP_QUIRK_DO_NOT_AUTO_UPDATE:   The app should not be automatically updated
  *
  * The application attributes.
  **/
@@ -107,6 +108,7 @@ typedef enum {
        GS_APP_QUIRK_PARENTAL_NOT_LAUNCHABLE    = 1 << 14,      /* Since: 3.32 */
        GS_APP_QUIRK_HIDE_FROM_SEARCH   = 1 << 15,      /* Since: 3.32 */
        GS_APP_QUIRK_HIDE_EVERYWHERE    = 1 << 16,      /* Since: 3.36 */
+       GS_APP_QUIRK_DO_NOT_AUTO_UPDATE = 1 << 17,      /* Since: 3.36 */
        /*< private >*/
        GS_APP_QUIRK_LAST
 } GsAppQuirk;
diff --git a/src/gs-update-monitor.c b/src/gs-update-monitor.c
index c55b1536..4a9ee74c 100644
--- a/src/gs-update-monitor.c
+++ b/src/gs-update-monitor.c
@@ -329,6 +329,8 @@ _should_auto_update (GsApp *app)
                return FALSE;
        if (gs_app_has_quirk (app, GS_APP_QUIRK_NEW_PERMISSIONS))
                return FALSE;
+       if (gs_app_has_quirk (app, GS_APP_QUIRK_DO_NOT_AUTO_UPDATE))
+               return FALSE;
        return TRUE;
 }
 


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