[gnome-software/wip/hughsie/no-perfect-screenshots] Remove the perfect-screenshots kudo



commit cdd011d3fa18eb179c181633a779e5f09781a4e0
Author: Richard Hughes <richard hughsie com>
Date:   Tue Oct 9 07:52:32 2018 +0100

    Remove the perfect-screenshots kudo
    
    The GsScreenshotImage widget is not exactly 16:9 anymore, so it seems slightly
    crazy rewarding apps for something we don't actually use ourselves.
    
    Perfect really is sometimes the enemy of good.

 lib/gs-app.c                |  4 ----
 lib/gs-app.h                |  2 --
 plugins/core/gs-appstream.c | 42 ------------------------------------------
 3 files changed, 48 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index 3e616d4c..b3faa35c 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -373,8 +373,6 @@ gs_app_kudos_to_string (guint64 kudos)
                g_ptr_array_add (array, "has-screenshots");
        if ((kudos & GS_APP_KUDO_POPULAR) > 0)
                g_ptr_array_add (array, "popular");
-       if ((kudos & GS_APP_KUDO_PERFECT_SCREENSHOTS) > 0)
-               g_ptr_array_add (array, "perfect-screenshots");
        if ((kudos & GS_APP_KUDO_HIGH_CONTRAST) > 0)
                g_ptr_array_add (array, "high-contrast");
        if ((kudos & GS_APP_KUDO_HI_DPI_ICON) > 0)
@@ -3774,8 +3772,6 @@ gs_app_get_kudos_percentage (GsApp *app)
                percentage += 10;
        if ((priv->kudos & GS_APP_KUDO_HAS_SCREENSHOTS) > 0)
                percentage += 20;
-       if ((priv->kudos & GS_APP_KUDO_PERFECT_SCREENSHOTS) > 0)
-               percentage += 20;
        if ((priv->kudos & GS_APP_KUDO_HIGH_CONTRAST) > 0)
                percentage += 20;
        if ((priv->kudos & GS_APP_KUDO_HI_DPI_ICON) > 0)
diff --git a/lib/gs-app.h b/lib/gs-app.h
index 69745b41..d4dd23d2 100644
--- a/lib/gs-app.h
+++ b/lib/gs-app.h
@@ -57,7 +57,6 @@ struct _GsAppClass
  * @GS_APP_KUDO_USES_APP_MENU:         Uses an AppMenu for navigation
  * @GS_APP_KUDO_HAS_SCREENSHOTS:       Supplies screenshots
  * @GS_APP_KUDO_POPULAR:               Is popular
- * @GS_APP_KUDO_PERFECT_SCREENSHOTS:   Supplies perfect screenshots
  * @GS_APP_KUDO_HIGH_CONTRAST:         Installs a high contrast icon
  * @GS_APP_KUDO_HI_DPI_ICON:           Installs a HiDPI icon
  * @GS_APP_KUDO_SANDBOXED:             Application is sandboxed
@@ -77,7 +76,6 @@ typedef enum {
        GS_APP_KUDO_USES_APP_MENU               = 1 << 8,
        GS_APP_KUDO_HAS_SCREENSHOTS             = 1 << 9,
        GS_APP_KUDO_POPULAR                     = 1 << 10,
-       GS_APP_KUDO_PERFECT_SCREENSHOTS         = 1 << 12,
        GS_APP_KUDO_HIGH_CONTRAST               = 1 << 13,
        GS_APP_KUDO_HI_DPI_ICON                 = 1 << 14,
        GS_APP_KUDO_SANDBOXED                   = 1 << 15,
diff --git a/plugins/core/gs-appstream.c b/plugins/core/gs-appstream.c
index 06f8288a..28cfcaff 100644
--- a/plugins/core/gs-appstream.c
+++ b/plugins/core/gs-appstream.c
@@ -243,44 +243,6 @@ gs_appstream_is_recent_release (AsApp *app)
        return secs / (60 * 60 * 24) < 365;
 }
 
-static gboolean
-gs_appstream_are_screenshots_perfect (AsApp *app)
-{
-       AsImage *image;
-       AsScreenshot *screenshot;
-       GPtrArray *screenshots;
-       guint height;
-       guint width;
-
-       screenshots = as_app_get_screenshots (app);
-       if (screenshots->len == 0)
-               return FALSE;
-       for (guint i = 0; i < screenshots->len; i++) {
-
-               /* get the source image as the thumbs will be resized & padded */
-               screenshot = g_ptr_array_index (screenshots, i);
-               image = as_screenshot_get_source (screenshot);
-               if (image == NULL)
-                       return FALSE;
-
-               width = as_image_get_width (image);
-               height = as_image_get_height (image);
-
-               /* too small */
-               if (width < AS_IMAGE_LARGE_WIDTH || height < AS_IMAGE_LARGE_HEIGHT)
-                       return FALSE;
-
-               /* too large */
-               if (width > AS_IMAGE_LARGE_WIDTH * 2 || height > AS_IMAGE_LARGE_HEIGHT * 2)
-                       return FALSE;
-
-               /* not 16:9 */
-               if ((width / 16) * 9 != height)
-                       return FALSE;
-       }
-       return TRUE;
-}
-
 static void
 gs_appstream_copy_metadata (GsApp *app, AsApp *item)
 {
@@ -708,10 +670,6 @@ gs_appstream_refine_app (GsPlugin *plugin,
        /* set provides */
        gs_appstream_refine_add_provides (app, item);
 
-       /* are the screenshots perfect */
-       if (gs_appstream_are_screenshots_perfect (item))
-               gs_app_add_kudo (app, GS_APP_KUDO_PERFECT_SCREENSHOTS);
-
        /* was this application released recently */
        if (gs_appstream_is_recent_release (item))
                gs_app_add_kudo (app, GS_APP_KUDO_RECENT_RELEASE);


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