[gnome-software/wip/rancell/paid: 22/22] Merge branch 'master' into wip/rancell/paid



commit ece462156008e188c309760fb3a351134e63e0c8
Merge: 41ef571 0779986
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Feb 24 11:34:21 2016 +1300

    Merge branch 'master' into wip/rancell/paid

 data/org.gnome.software.gschema.xml      |    4 +-
 po/POTFILES.in                           |   28 +-
 po/pl.po                                 |  988 ++++++++++++++++++------------
 po/pt_BR.po                              |   93 ++--
 po/sr.po                                 |   74 ++-
 po/sr latin po                           |   74 ++-
 po/zh_TW.po                              |  277 ++++++---
 src/Makefile.am                          |    2 +
 src/gs-app-row.c                         |   18 +-
 src/gs-app-row.ui                        |    3 +
 src/gs-category.c                        |   39 +-
 src/gs-page.c                            |   33 +-
 src/gs-page.h                            |    2 +
 src/gs-plugin-loader.c                   |   14 +
 src/gs-review-dialog.ui                  |    4 +-
 src/gs-review-row.c                      |   52 ++-
 src/gs-review-row.ui                     |   26 +-
 src/gs-shell-category.ui                 |   79 ++-
 src/gs-shell-details.c                   |   23 +-
 src/gs-shell-details.ui                  |   16 +-
 src/gs-shell-moderate.c                  |   14 +
 src/gs-update-monitor.c                  |   15 +-
 src/gs-utils.c                           |   26 +
 src/gs-utils.h                           |    1 +
 src/gtk-style.css                        |    4 +
 src/plugins/gs-plugin-appstream.c        |    3 +-
 src/plugins/gs-plugin-packagekit-proxy.c |   14 +
 src/plugins/gs-plugin-xdg-app-reviews.c  |   19 +-
 src/plugins/gs-plugin-xdg-app.c          |    6 +
 src/plugins/menu-spec-common.c           |    1 +
 30 files changed, 1268 insertions(+), 684 deletions(-)
---
diff --cc src/gs-utils.c
index a8bc56b,9597e7f..834185a
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@@ -506,30 -505,26 +510,52 @@@ gs_utils_get_user_hash (GError **error
        return g_compute_checksum_for_string (G_CHECKSUM_SHA1, salted, -1);
  }
  
+ /**
+  * gs_utils_get_permission:
+  **/
+ GPermission *
+ gs_utils_get_permission (const gchar *id)
+ {
+ #ifdef HAVE_POLKIT
+       g_autoptr(GPermission) permission = NULL;
+       g_autoptr(GError) error = NULL;
+ 
+       permission = polkit_permission_new_sync (id, NULL, NULL, &error);
+       if (permission == NULL) {
+               g_warning ("Failed to create permission %s: %s", id, error->message);
+               return NULL;
+       }
+       return g_steal_pointer (&permission);
+ #else
+       g_debug ("no PolicyKit, so can't return GPermission for %s", id);
+       return NULL;
+ #endif
+ }
+ 
 +gchar *
 +gs_format_price (const gchar *currency, guint price)
 +{
 +      if (strcmp (currency, "AUD") == 0) {
 +              return g_strdup_printf (_("A$%u"), price);
 +      } else if (strcmp (currency, "CAD") == 0) {
 +              return g_strdup_printf (_("C$%u"), price);
 +      } else if (strcmp (currency, "CNY") == 0) {
 +              return g_strdup_printf (_("CN¥%u"), price);
 +      } else if (strcmp (currency, "EUR") == 0) {
 +              return g_strdup_printf (_("€%u"), price);
 +      } else if (strcmp (currency, "GBP") == 0) {
 +              return g_strdup_printf (_("£%u"), price);
 +      } else if (strcmp (currency, "JPY") == 0) {
 +              return g_strdup_printf (_("¥%u"), price);
 +      } else if (strcmp (currency, "NZD") == 0) {
 +              return g_strdup_printf (_("NZ$%u"), price);
 +      } else if (strcmp (currency, "RUB") == 0) {
 +              return g_strdup_printf (_("₽%u"), price);
 +      } else if (strcmp (currency, "USD") == 0) {
 +              return g_strdup_printf (_("US$%u"), price);
 +      } else {
 +              return g_strdup_printf (_("%s %u"), currency, price);
 +      }
 +}
 +
  /* vim: set noexpandtab: */
diff --cc src/gs-utils.h
index 9d9bcef,2abdbf3..de25db1
--- a/src/gs-utils.h
+++ b/src/gs-utils.h
@@@ -63,10 -63,8 +63,11 @@@ const gchar  *gs_user_agent                 (void)
  gchar         *gs_utils_get_cachedir          (const gchar    *kind,
                                                 GError         **error);
  gchar         *gs_utils_get_user_hash         (GError         **error);
+ GPermission   *gs_utils_get_permission        (const gchar    *id);
  
 +gchar         *gs_format_price                (const gchar    *currency,
 +                                               guint           price);
 +
  G_END_DECLS
  
  #endif /* __GS_UTILS_H */


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