Hello community, here is the log from the commit of package gnome-software for openSUSE:Factory checked in at 2015-06-15 17:49:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gnome-software (Old) and /work/SRC/openSUSE:Factory/.gnome-software.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnome-software" Changes: -------- --- /work/SRC/openSUSE:Factory/gnome-software/gnome-software.changes 2015-06-08 08:31:35.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.gnome-software.new/gnome-software.changes 2015-06-15 17:49:58.000000000 +0200 @@ -1,0 +2,13 @@ +Sun Jun 14 21:42:33 UTC 2015 - [email protected] + +- Update to version 3.16.4: + + Fix a frequent crash in appstream plugin. + + Fix a critical warning when opening the app folder dialog. + + Fix a possible crash when changing the download-updates option + in gsettings. + + Hide updates UI on managed systems. + + Improve the error dialog for failed offline updates. + + Workaround text coming up as selected in the updates dialog. +- Add pkgconfig(polkit-gobject-1) BuildRequires: New dependency. + +------------------------------------------------------------------- Old: ---- gnome-software-3.16.3.tar.xz New: ---- gnome-software-3.16.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gnome-software.spec ++++++ --- /var/tmp/diff_new_pack.QqtijA/_old 2015-06-15 17:49:59.000000000 +0200 +++ /var/tmp/diff_new_pack.QqtijA/_new 2015-06-15 17:49:59.000000000 +0200 @@ -17,7 +17,7 @@ Name: gnome-software -Version: 3.16.3 +Version: 3.16.4 Release: 0 %define gs_plugin_api 7 Summary: GNOME Software Store @@ -42,6 +42,7 @@ BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(packagekit-glib2) >= 1.0.0 +BuildRequires: pkgconfig(polkit-gobject-1) BuildRequires: pkgconfig(sqlite3) BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: iso-codes ++++++ gnome-software-3.16.3.tar.xz -> gnome-software-3.16.4.tar.xz ++++++ ++++ 1775 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/NEWS new/gnome-software-3.16.4/NEWS --- old/gnome-software-3.16.3/NEWS 2015-06-05 21:25:11.000000000 +0200 +++ new/gnome-software-3.16.4/NEWS 2015-06-14 17:51:29.000000000 +0200 @@ -1,3 +1,15 @@ +Version 3.16.4 +~~~~~~~~~~~~~~ +Released: 2015-06-14 + +This release fixes the following bugs: + * Fix a frequent crash in appstream plugin + * Fix a critical warning when opening the app folder dialog + * Fix a possible crash when changing the download-updates option in gsettings + * Hide updates UI on managed systems + * Improve the error dialog for failed offline updates + * Workaround text coming up as selected in the updates dialog + Version 3.16.3 ~~~~~~~~~~~~~~ Released: 2015-06-05 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/config.h new/gnome-software-3.16.4/config.h --- old/gnome-software-3.16.3/config.h 2015-06-05 21:24:49.000000000 +0200 +++ new/gnome-software-3.16.4/config.h 2015-06-14 17:51:04.000000000 +0200 @@ -69,7 +69,7 @@ #define PACKAGE_NAME "gnome-software" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "gnome-software 3.16.3" +#define PACKAGE_STRING "gnome-software 3.16.4" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gnome-software" @@ -78,10 +78,10 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "3.16.3" +#define PACKAGE_VERSION "3.16.4" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "3.16.3" +#define VERSION "3.16.4" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/configure.ac new/gnome-software-3.16.4/configure.ac --- old/gnome-software-3.16.3/configure.ac 2015-06-05 21:23:02.000000000 +0200 +++ new/gnome-software-3.16.4/configure.ac 2015-06-14 16:11:21.000000000 +0200 @@ -1,7 +1,7 @@ # Copyright (C) 2010-2015 Richard Hughes <[email protected]> AC_PREREQ(2.63) -AC_INIT([gnome-software],[3.16.3],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-software]) +AC_INIT([gnome-software],[3.16.4],[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-software]) AC_CONFIG_SRCDIR(src) AM_INIT_AUTOMAKE([1.11 no-dist-gzip dist-xz tar-ustar serial-tests foreign]) AC_CONFIG_HEADERS([config.h]) @@ -66,6 +66,7 @@ PKG_CHECK_MODULES(SOUP, libsoup-2.4) PKG_CHECK_MODULES(GSETTINGS_DESKTOP_SCHEMAS, gsettings-desktop-schemas >= 3.11.5) PKG_CHECK_MODULES(GNOME_DESKTOP, gnome-desktop-3.0) +PKG_CHECK_MODULES(POLKIT, polkit-gobject-1) AC_PATH_PROG(APPSTREAM_UTIL, [appstream-util], [unfound]) AC_ARG_ENABLE(man, [AS_HELP_STRING([--enable-man], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/data/appdata/org.gnome.Software.appdata.xml.in new/gnome-software-3.16.4/data/appdata/org.gnome.Software.appdata.xml.in --- old/gnome-software-3.16.3/data/appdata/org.gnome.Software.appdata.xml.in 2015-06-05 21:23:02.000000000 +0200 +++ new/gnome-software-3.16.4/data/appdata/org.gnome.Software.appdata.xml.in 2015-06-14 17:49:04.000000000 +0200 @@ -30,6 +30,19 @@ Validate with `appstream-util validate *.appdata.xml` --> <releases> + <release version="3.16.4" timestamp="1434296758"> + <description> + <p>This release fixes the following bugs:</p> + <ul> + <li>Fix a frequent crash in appstream plugin</li> + <li>Fix a critical warning when opening the app folder dialog</li> + <li>Fix a possible crash when changing the download-updates option in gsettings</li> + <li>Hide updates UI on managed systems</li> + <li>Improve the error dialog for failed offline updates</li> + <li>Workaround text coming up as selected in the updates dialog</li> + </ul> + </description> + </release> <release version="3.16.3" timestamp="1433531946"> <description> <p>This release fixes the following bugs:</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/Makefile.am new/gnome-software-3.16.4/src/Makefile.am --- old/gnome-software-3.16.3/src/Makefile.am 2015-06-05 21:15:51.000000000 +0200 +++ new/gnome-software-3.16.4/src/Makefile.am 2015-06-14 16:11:21.000000000 +0200 @@ -8,6 +8,7 @@ $(SOUP_CFLAGS) \ $(PACKAGEKIT_CFLAGS) \ $(GNOME_DESKTOP_CFLAGS) \ + $(POLKIT_CFLAGS) \ -DG_LOG_DOMAIN=\"Gs\" \ -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ -DGS_MODULESETDIR=\"$(datadir)/gnome-software/modulesets.d\" \ @@ -188,6 +189,7 @@ $(SOUP_LIBS) \ $(PACKAGEKIT_LIBS) \ $(GNOME_DESKTOP_LIBS) \ + $(POLKIT_LIBS) \ -lm gnome_software_CFLAGS = \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-app-folder-dialog.c new/gnome-software-3.16.4/src/gs-app-folder-dialog.c --- old/gnome-software-3.16.3/src/gs-app-folder-dialog.c 2015-06-05 16:38:43.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-app-folder-dialog.c 2015-06-11 11:58:25.000000000 +0200 @@ -33,7 +33,6 @@ { GList *apps; GsFolders *folders; - GtkWidget *header; GtkWidget *cancel_button; GtkWidget *done_button; GtkWidget *app_folder_list; @@ -160,7 +159,6 @@ gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/app-folder-dialog.ui"); - gtk_widget_class_bind_template_child_private (widget_class, GsAppFolderDialog, header); gtk_widget_class_bind_template_child_private (widget_class, GsAppFolderDialog, cancel_button); gtk_widget_class_bind_template_child_private (widget_class, GsAppFolderDialog, done_button); gtk_widget_class_bind_template_child_private (widget_class, GsAppFolderDialog, app_folder_list); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-application.c new/gnome-software-3.16.4/src/gs-application.c --- old/gnome-software-3.16.3/src/gs-application.c 2015-06-05 16:38:43.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-application.c 2015-06-14 16:11:21.000000000 +0200 @@ -27,6 +27,7 @@ #include <stdlib.h> #include <glib/gi18n.h> #include <gtk/gtk.h> +#include <gio/gio.h> #include <gio/gdesktopappinfo.h> #include <packagekit-glib2/packagekit.h> @@ -46,6 +47,7 @@ #include "gs-shell-search-provider.h" #include "gs-offline-updates.h" #include "gs-folders.h" +#include "gs-utils.h" struct _GsApplication { @@ -96,7 +98,8 @@ const gchar *key, GsApplication *app) { - if (g_settings_get_boolean (settings, key)) { + if (!gs_updates_are_managed () && + g_settings_get_boolean (settings, key)) { g_debug ("Enabling update monitor"); app->update_monitor = gs_update_monitor_new (app); } else { @@ -106,6 +109,27 @@ } static void +on_permission_changed (GPermission *permission, + GParamSpec *pspec, + gpointer data) +{ + GsApplication *app = data; + + if (app->settings) + download_updates_setting_changed (app->settings, "download-updates", app); +} + +static void +gs_application_monitor_permission (GsApplication *app) +{ + GPermission *permission; + + permission = gs_offline_updates_permission_get (); + g_signal_connect (permission, "notify", + G_CALLBACK (on_permission_changed), app); +} + +static void gs_application_monitor_updates (GsApplication *app) { g_signal_connect (app->settings, "changed::download-updates", @@ -235,6 +259,20 @@ } static void +initialize_ui_and_present_window (GsApplication *app) +{ + GList *windows; + GtkWindow *window; + + gs_application_initialize_ui (app); + windows = gtk_application_get_windows (GTK_APPLICATION (app)); + if (windows) { + window = windows->data; + gtk_window_present (window); + } +} + +static void sources_activated (GSimpleAction *action, GVariant *parameter, gpointer app) @@ -326,15 +364,8 @@ { GsApplication *app = GS_APPLICATION (data); const gchar *mode; - GList *windows; - GtkWindow *window = NULL; - gs_application_initialize_ui (app); - windows = gtk_application_get_windows (GTK_APPLICATION (app)); - if (windows) { - window = windows->data; - gtk_window_present (window); - } + initialize_ui_and_present_window (app); mode = g_variant_get_string (parameter, NULL); if (g_strcmp0 (mode, "updates") == 0) { @@ -358,15 +389,8 @@ { GsApplication *app = GS_APPLICATION (data); const gchar *search; - GList *windows; - GtkWindow *window = NULL; - gs_application_initialize_ui (app); - windows = gtk_application_get_windows (GTK_APPLICATION (app)); - if (windows) { - window = windows->data; - gtk_window_present (window); - } + initialize_ui_and_present_window (app); search = g_variant_get_string (parameter, NULL); gs_shell_show_search (app->shell, search); @@ -378,17 +402,10 @@ gpointer data) { GsApplication *app = GS_APPLICATION (data); - GList *windows; - GtkWindow *window = NULL; const gchar *id; const gchar *search; - windows = gtk_application_get_windows (GTK_APPLICATION (app)); - if (windows) { - window = windows->data; - gtk_window_present (window); - } - gs_application_initialize_ui (app); + initialize_ui_and_present_window (app); g_variant_get (parameter, "(&s&s)", &id, &search); if (search != NULL && search[0] != '\0') @@ -441,7 +458,12 @@ GVariant *parameter, gpointer data) { - gs_offline_updates_show_error (); + GsApplication *app = GS_APPLICATION (data); + + initialize_ui_and_present_window (app); + + gs_shell_set_mode (app->shell, GS_SHELL_MODE_UPDATES); + gs_offline_updates_show_error (app->shell); } static void @@ -453,8 +475,6 @@ #ifdef GDK_WINDOWING_X11 GdkDisplay *display; #endif - GList *windows; - GtkWindow *window = NULL; const gchar *mode; const gchar *startup_id; gchar **resources; @@ -471,12 +491,7 @@ } #endif - windows = gtk_application_get_windows (GTK_APPLICATION (app)); - if (windows) { - window = windows->data; - gtk_window_present (window); - } - gs_application_initialize_ui (app); + initialize_ui_and_present_window (app); gs_shell_show_extras_search (app->shell, mode, resources); } @@ -510,6 +525,7 @@ GS_APPLICATION (application)->proxy_settings = gs_proxy_settings_new (); GS_APPLICATION (application)->dbus_helper = gs_dbus_helper_new (); GS_APPLICATION (application)->settings = g_settings_new ("org.gnome.software"); + gs_application_monitor_permission (GS_APPLICATION (application)); gs_application_monitor_updates (GS_APPLICATION (application)); gs_application_provide_search (GS_APPLICATION (application)); gs_application_monitor_network (GS_APPLICATION (application)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-offline-updates.c new/gnome-software-3.16.4/src/gs-offline-updates.c --- old/gnome-software-3.16.3/src/gs-offline-updates.c 2015-06-05 16:38:43.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-offline-updates.c 2015-06-14 16:11:21.000000000 +0200 @@ -23,19 +23,13 @@ #include <glib/gi18n.h> #include <packagekit-glib2/packagekit.h> -#include <pango/pango-font.h> +#include <polkit/polkit.h> #include "gs-cleanup.h" #include "gs-offline-updates.h" #include "gs-utils.h" static void -expander_cb (GtkExpander *expander, GParamSpec *pspec, GtkWindow *dialog) -{ - gtk_window_set_resizable (dialog, gtk_expander_get_expanded (expander)); -} - -static void do_not_expand (GtkWidget *child, gpointer data) { gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (child)), @@ -174,6 +168,67 @@ return NULL; } +static gboolean +unset_focus (GtkWidget *widget, GdkEvent *event, gpointer data) +{ + if (GTK_IS_WINDOW (widget)) + gtk_window_set_focus(GTK_WINDOW (widget), NULL); + return FALSE; +} + +/** + * A temporary workaround for https://bugzilla.gnome.org/show_bug.cgi?id=406159 + * Creates and applies some tags which make the text smaller and add some + * margins at each side of the text. Eventually this should be achieved + * with some API or CSS attributes which are not yet implemented. + * Thanks Matthias Clasen for hints and inspiration. + */ +static void +tmp_apply_tags (GtkTextBuffer *buffer) +{ + GtkTextIter start, end, line; + gint line_count; + + gtk_text_buffer_create_tag (buffer, "big_gap_before_line", + "pixels_above_lines", 16, NULL); + + gtk_text_buffer_create_tag (buffer, "big_gap_after_line", + "pixels_below_lines", 16, NULL); + + gtk_text_buffer_create_tag (buffer, "wide_margins", + "left_margin", 16, "right_margin", 16, + NULL); + + gtk_text_buffer_create_tag (buffer, "small", + "scale", PANGO_SCALE_SMALL, NULL); + + /* Apply to whole text */ + gtk_text_buffer_get_bounds (buffer, &start, &end); + gtk_text_buffer_apply_tag_by_name (buffer, "small", &start, &end); + gtk_text_buffer_apply_tag_by_name (buffer, "wide_margins", &start, &end); + + line_count = gtk_text_buffer_get_line_count (buffer); + if (line_count <= 1) { + /* Apply to the one and only paragraph */ + gtk_text_buffer_apply_tag_by_name (buffer, + "big_gap_before_line", &start, &end); + gtk_text_buffer_apply_tag_by_name (buffer, + "big_gap_after_line", &start, &end); + } else { + /* Apply to the first paragraph */ + gtk_text_buffer_get_iter_at_line (buffer, &line, 1); + gtk_text_buffer_apply_tag_by_name (buffer, + "big_gap_before_line", &start, &line); + /* Is second paragraph the last paragraph? */ + if (line_count > 2) + gtk_text_buffer_get_iter_at_line (buffer, + &line, line_count - 1); + /* Apply to the last paragraph */ + gtk_text_buffer_apply_tag_by_name (buffer, + "big_gap_after_line", &line, &end); + } +} + /** * insert_details_widget: * @dialog: the message dialog where the widget will be inserted @@ -187,14 +242,15 @@ insert_details_widget (GtkMessageDialog *dialog, const gchar *details) { GtkWidget *message_area, *sw, *label; - GtkWidget *box, *expander; - PangoFontMetrics *metrics; - int lineheight; + GtkWidget *box, *tv; + GtkTextBuffer *buffer; + GList *children; _cleanup_string_free_ GString *msg = NULL; if (!details) return; g_return_if_fail (dialog != NULL); + gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); msg = g_string_new (""); g_string_append_printf (msg, "%s\n\n%s", @@ -213,46 +269,44 @@ /* make the labels not expand */ gtk_container_foreach (GTK_CONTAINER (message_area), do_not_expand, NULL); - /* TODO: In 3.18 the label will be "Details:" (":" appended) */ - expander = gtk_expander_new (_("Details")); - gtk_widget_set_visible (expander, TRUE); + /* Find the secondary label and set its width_chars. */ + /* Otherwise the label will tend to expand vertically. */ + children = gtk_container_get_children (GTK_CONTAINER (message_area)); + if (children && children->next && GTK_IS_LABEL (children->next->data)) { + gtk_label_set_width_chars (GTK_LABEL (children->next->data), 40); + } + + label = gtk_label_new (_("Details")); + gtk_widget_set_halign (label, GTK_ALIGN_START); + gtk_widget_set_visible (label, TRUE); + gtk_box_pack_start (GTK_BOX (message_area), label, FALSE, FALSE, 0); + sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (sw), 150); gtk_widget_set_visible (sw, TRUE); - label = gtk_label_new (msg->str); - gtk_label_set_selectable (GTK_LABEL (label), TRUE); - gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); - gtk_label_set_line_wrap_mode (GTK_LABEL (label), GTK_WRAP_WORD); - gtk_widget_set_halign (label, GTK_ALIGN_START); - gtk_widget_set_valign (label, GTK_ALIGN_START); - gtk_label_set_xalign (GTK_LABEL (label), 0.0); - gtk_widget_set_visible (label, TRUE); + tv = gtk_text_view_new (); + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (tv)); + gtk_text_view_set_editable (GTK_TEXT_VIEW (tv), FALSE); + gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (tv), GTK_WRAP_WORD); + gtk_text_view_set_monospace (GTK_TEXT_VIEW (tv), TRUE); + gtk_text_buffer_set_text (buffer, msg->str, -1); + tmp_apply_tags (buffer); + gtk_widget_set_visible (tv, TRUE); + + gtk_container_add (GTK_CONTAINER (sw), tv); + gtk_box_pack_end (GTK_BOX (message_area), sw, TRUE, TRUE, 0); - /* Setup the minimum size of the text label */ - gtk_label_set_width_chars (GTK_LABEL (label), 50); - metrics = pango_context_get_metrics ( - gtk_widget_get_pango_context (label), NULL, NULL); - lineheight = PANGO_PIXELS_CEIL ( - pango_font_metrics_get_ascent (metrics) - + pango_font_metrics_get_descent (metrics)); - pango_font_metrics_unref (metrics); - gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW (sw), - 5 * lineheight); - - gtk_container_add (GTK_CONTAINER (sw), label); - gtk_container_add (GTK_CONTAINER (expander), sw); - gtk_box_pack_end (GTK_BOX (message_area), expander, TRUE, TRUE, 0); - g_signal_connect (expander, "notify::expanded", - G_CALLBACK (expander_cb), dialog); + g_signal_connect (dialog, "map-event", G_CALLBACK (unset_focus), NULL); } void -gs_offline_updates_show_error (void) +gs_offline_updates_show_error (GsShell *shell) { const gchar *title; const gchar *secondary; @@ -278,7 +332,7 @@ secondary = prepare_secondary_text (pk_error); geeky = prepare_details (pk_error); - dialog = gtk_message_dialog_new_with_markup (NULL, + dialog = gtk_message_dialog_new_with_markup (gs_shell_get_window (shell), 0, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, @@ -300,4 +354,30 @@ } } +GPermission * +gs_offline_updates_permission_get (void) +{ + static GPermission *permission; + + if (!permission) + permission = polkit_permission_new_sync ("org.freedesktop.packagekit.trigger-offline-update", + NULL, NULL, NULL); + + return permission; +} + +gboolean +gs_updates_are_managed (void) +{ + GPermission *permission; + gboolean managed; + + permission = gs_offline_updates_permission_get (); + managed = !g_permission_get_allowed (permission) && + !g_permission_get_can_acquire (permission); + + return managed; +} + + /* vim: set noexpandtab: */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-offline-updates.h new/gnome-software-3.16.4/src/gs-offline-updates.h --- old/gnome-software-3.16.3/src/gs-offline-updates.h 2015-06-04 02:39:49.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-offline-updates.h 2015-06-11 11:58:47.000000000 +0200 @@ -24,9 +24,14 @@ #include <gtk/gtk.h> +#include "gs-shell.h" + G_BEGIN_DECLS -void gs_offline_updates_show_error (void); +void gs_offline_updates_show_error (GsShell *shell); + +GPermission *gs_offline_updates_permission_get (void); +gboolean gs_updates_are_managed (void); G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-resources.c new/gnome-software-3.16.4/src/gs-resources.c --- old/gnome-software-3.16.3/src/gs-resources.c 2015-06-05 21:24:56.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-resources.c 2015-06-14 17:51:09.000000000 +0200 @@ -6,7 +6,7 @@ # define SECTION #endif -static const SECTION union { const guint8 data[147975]; const double alignment; void * const ptr;} gs_resource_data = { { +static const SECTION union { const guint8 data[149007]; const double alignment; void * const ptr;} gs_resource_data = { { 0x47, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x68, 0x03, 0x00, 0x00, @@ -55,67 +55,67 @@ 0x70, 0x7f, 0x00, 0x00, 0xab, 0x86, 0x00, 0x00, 0x18, 0xb1, 0xad, 0x9f, 0x0e, 0x00, 0x00, 0x00, 0xab, 0x86, 0x00, 0x00, 0x13, 0x00, 0x76, 0x00, - 0xc0, 0x86, 0x00, 0x00, 0x38, 0xa8, 0x00, 0x00, + 0xc0, 0x86, 0x00, 0x00, 0x43, 0xac, 0x00, 0x00, 0x2c, 0x27, 0x30, 0xfc, 0x0e, 0x00, 0x00, 0x00, - 0x38, 0xa8, 0x00, 0x00, 0x14, 0x00, 0x76, 0x00, - 0x50, 0xa8, 0x00, 0x00, 0x94, 0xaf, 0x00, 0x00, + 0x43, 0xac, 0x00, 0x00, 0x14, 0x00, 0x76, 0x00, + 0x58, 0xac, 0x00, 0x00, 0x9c, 0xb3, 0x00, 0x00, 0xa4, 0x68, 0x60, 0x4f, 0x0e, 0x00, 0x00, 0x00, - 0x94, 0xaf, 0x00, 0x00, 0x16, 0x00, 0x76, 0x00, - 0xb0, 0xaf, 0x00, 0x00, 0x65, 0xbd, 0x00, 0x00, + 0x9c, 0xb3, 0x00, 0x00, 0x16, 0x00, 0x76, 0x00, + 0xb8, 0xb3, 0x00, 0x00, 0x6d, 0xc1, 0x00, 0x00, 0xb0, 0xb7, 0x24, 0x30, 0x1c, 0x00, 0x00, 0x00, - 0x65, 0xbd, 0x00, 0x00, 0x06, 0x00, 0x4c, 0x00, - 0x6c, 0xbd, 0x00, 0x00, 0x70, 0xbd, 0x00, 0x00, + 0x6d, 0xc1, 0x00, 0x00, 0x06, 0x00, 0x4c, 0x00, + 0x74, 0xc1, 0x00, 0x00, 0x78, 0xc1, 0x00, 0x00, 0x93, 0xf4, 0xc0, 0x92, 0x11, 0x00, 0x00, 0x00, - 0x70, 0xbd, 0x00, 0x00, 0x08, 0x00, 0x76, 0x00, - 0x78, 0xbd, 0x00, 0x00, 0xc5, 0xbf, 0x00, 0x00, + 0x78, 0xc1, 0x00, 0x00, 0x08, 0x00, 0x76, 0x00, + 0x80, 0xc1, 0x00, 0x00, 0xcd, 0xc3, 0x00, 0x00, 0x4a, 0x73, 0x75, 0xe5, 0x0c, 0x00, 0x00, 0x00, - 0xc5, 0xbf, 0x00, 0x00, 0x09, 0x00, 0x4c, 0x00, - 0xd0, 0xbf, 0x00, 0x00, 0x34, 0xc0, 0x00, 0x00, + 0xcd, 0xc3, 0x00, 0x00, 0x09, 0x00, 0x4c, 0x00, + 0xd8, 0xc3, 0x00, 0x00, 0x3c, 0xc4, 0x00, 0x00, 0x28, 0xc1, 0x6c, 0x77, 0x0e, 0x00, 0x00, 0x00, - 0x34, 0xc0, 0x00, 0x00, 0x11, 0x00, 0x76, 0x00, - 0x48, 0xc0, 0x00, 0x00, 0xe6, 0xcd, 0x00, 0x00, + 0x3c, 0xc4, 0x00, 0x00, 0x11, 0x00, 0x76, 0x00, + 0x50, 0xc4, 0x00, 0x00, 0xee, 0xd1, 0x00, 0x00, 0x72, 0x56, 0x90, 0x94, 0x0e, 0x00, 0x00, 0x00, - 0xe6, 0xcd, 0x00, 0x00, 0x0b, 0x00, 0x76, 0x00, - 0xf8, 0xcd, 0x00, 0x00, 0xd3, 0xdc, 0x00, 0x00, + 0xee, 0xd1, 0x00, 0x00, 0x0b, 0x00, 0x76, 0x00, + 0x00, 0xd2, 0x00, 0x00, 0xdb, 0xe0, 0x00, 0x00, 0xbf, 0x7e, 0x6c, 0xbe, 0x0e, 0x00, 0x00, 0x00, - 0xd3, 0xdc, 0x00, 0x00, 0x04, 0x00, 0x4c, 0x00, - 0xd8, 0xdc, 0x00, 0x00, 0xdc, 0xdc, 0x00, 0x00, + 0xdb, 0xe0, 0x00, 0x00, 0x04, 0x00, 0x4c, 0x00, + 0xe0, 0xe0, 0x00, 0x00, 0xe4, 0xe0, 0x00, 0x00, 0x3e, 0xb9, 0xdd, 0x0f, 0x0e, 0x00, 0x00, 0x00, - 0xdc, 0xdc, 0x00, 0x00, 0x14, 0x00, 0x76, 0x00, - 0xf0, 0xdc, 0x00, 0x00, 0xe3, 0x13, 0x01, 0x00, + 0xe4, 0xe0, 0x00, 0x00, 0x14, 0x00, 0x76, 0x00, + 0xf8, 0xe0, 0x00, 0x00, 0xeb, 0x17, 0x01, 0x00, 0x80, 0x54, 0xc3, 0x1f, 0x0e, 0x00, 0x00, 0x00, - 0xe3, 0x13, 0x01, 0x00, 0x14, 0x00, 0x76, 0x00, - 0xf8, 0x13, 0x01, 0x00, 0x68, 0x1d, 0x01, 0x00, + 0xeb, 0x17, 0x01, 0x00, 0x14, 0x00, 0x76, 0x00, + 0x00, 0x18, 0x01, 0x00, 0x70, 0x21, 0x01, 0x00, 0xd4, 0xb5, 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, - 0x68, 0x1d, 0x01, 0x00, 0x01, 0x00, 0x4c, 0x00, - 0x6c, 0x1d, 0x01, 0x00, 0x70, 0x1d, 0x01, 0x00, + 0x70, 0x21, 0x01, 0x00, 0x01, 0x00, 0x4c, 0x00, + 0x74, 0x21, 0x01, 0x00, 0x78, 0x21, 0x01, 0x00, 0x7d, 0x80, 0x60, 0xd4, 0x0e, 0x00, 0x00, 0x00, - 0x70, 0x1d, 0x01, 0x00, 0x13, 0x00, 0x76, 0x00, - 0x88, 0x1d, 0x01, 0x00, 0x2a, 0x3b, 0x01, 0x00, + 0x78, 0x21, 0x01, 0x00, 0x13, 0x00, 0x76, 0x00, + 0x90, 0x21, 0x01, 0x00, 0x32, 0x3f, 0x01, 0x00, 0x1d, 0x6f, 0xbf, 0x50, 0x0e, 0x00, 0x00, 0x00, - 0x2a, 0x3b, 0x01, 0x00, 0x10, 0x00, 0x76, 0x00, - 0x40, 0x3b, 0x01, 0x00, 0x7b, 0x47, 0x01, 0x00, + 0x32, 0x3f, 0x01, 0x00, 0x10, 0x00, 0x76, 0x00, + 0x48, 0x3f, 0x01, 0x00, 0x83, 0x4b, 0x01, 0x00, 0x44, 0xc7, 0x68, 0xfb, 0x0e, 0x00, 0x00, 0x00, - 0x7b, 0x47, 0x01, 0x00, 0x11, 0x00, 0x76, 0x00, - 0x90, 0x47, 0x01, 0x00, 0xbe, 0x78, 0x01, 0x00, + 0x83, 0x4b, 0x01, 0x00, 0x11, 0x00, 0x76, 0x00, + 0x98, 0x4b, 0x01, 0x00, 0xc6, 0x7c, 0x01, 0x00, 0x88, 0x6d, 0x94, 0x04, 0x0e, 0x00, 0x00, 0x00, - 0xbe, 0x78, 0x01, 0x00, 0x13, 0x00, 0x76, 0x00, - 0xd8, 0x78, 0x01, 0x00, 0x8b, 0xf6, 0x01, 0x00, + 0xc6, 0x7c, 0x01, 0x00, 0x13, 0x00, 0x76, 0x00, + 0xe0, 0x7c, 0x01, 0x00, 0x93, 0xfa, 0x01, 0x00, 0x3d, 0x3a, 0x3a, 0x47, 0x0e, 0x00, 0x00, 0x00, - 0x8b, 0xf6, 0x01, 0x00, 0x1e, 0x00, 0x76, 0x00, - 0xb0, 0xf6, 0x01, 0x00, 0x31, 0x2e, 0x02, 0x00, + 0x93, 0xfa, 0x01, 0x00, 0x1e, 0x00, 0x76, 0x00, + 0xb8, 0xfa, 0x01, 0x00, 0x39, 0x32, 0x02, 0x00, 0x9d, 0xa5, 0x90, 0x81, 0x0e, 0x00, 0x00, 0x00, - 0x31, 0x2e, 0x02, 0x00, 0x14, 0x00, 0x76, 0x00, - 0x48, 0x2e, 0x02, 0x00, 0x4b, 0x37, 0x02, 0x00, + 0x39, 0x32, 0x02, 0x00, 0x14, 0x00, 0x76, 0x00, + 0x50, 0x32, 0x02, 0x00, 0x53, 0x3b, 0x02, 0x00, 0x8f, 0x3c, 0x8f, 0x09, 0x0e, 0x00, 0x00, 0x00, - 0x4b, 0x37, 0x02, 0x00, 0x10, 0x00, 0x76, 0x00, - 0x60, 0x37, 0x02, 0x00, 0xa3, 0x39, 0x02, 0x00, + 0x53, 0x3b, 0x02, 0x00, 0x10, 0x00, 0x76, 0x00, + 0x68, 0x3b, 0x02, 0x00, 0xab, 0x3d, 0x02, 0x00, 0x4b, 0x50, 0x90, 0x0b, 0x14, 0x00, 0x00, 0x00, - 0xa3, 0x39, 0x02, 0x00, 0x04, 0x00, 0x4c, 0x00, - 0xa8, 0x39, 0x02, 0x00, 0xac, 0x39, 0x02, 0x00, + 0xab, 0x3d, 0x02, 0x00, 0x04, 0x00, 0x4c, 0x00, + 0xb0, 0x3d, 0x02, 0x00, 0xb4, 0x3d, 0x02, 0x00, 0xf6, 0x40, 0x9c, 0x48, 0x0e, 0x00, 0x00, 0x00, - 0xac, 0x39, 0x02, 0x00, 0x13, 0x00, 0x76, 0x00, - 0xc0, 0x39, 0x02, 0x00, 0x07, 0x42, 0x02, 0x00, + 0xb4, 0x3d, 0x02, 0x00, 0x13, 0x00, 0x76, 0x00, + 0xc8, 0x3d, 0x02, 0x00, 0x0f, 0x46, 0x02, 0x00, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2d, 0x74, 0x69, 0x6c, 0x65, 0x2e, 0x75, 0x69, 0x00, 0xdb, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4319,7 +4319,7 @@ 0x61, 0x79, 0x29, 0x67, 0x73, 0x2d, 0x73, 0x68, 0x65, 0x6c, 0x6c, 0x2d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x75, 0x69, 0x00, 0x00, - 0x68, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, @@ -5384,15 +5384,144 @@ 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x3e, 0x3c, 0x2f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x3e, 0x3c, - 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3e, - 0x3c, 0x2f, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x3e, - 0x3c, 0x2f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x3e, 0x3c, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x3e, 0x0a, - 0x00, 0x00, 0x28, 0x75, 0x75, 0x61, 0x79, 0x29, - 0x67, 0x73, 0x2d, 0x68, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x79, 0x2d, 0x64, 0x69, 0x61, 0x6c, 0x6f, - 0x67, 0x2e, 0x75, 0x69, 0x00, 0x00, 0x00, 0x00, + 0x63, 0x68, 0x69, 0x6c, 0x64, 0x3e, 0x3c, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x3d, 0x22, 0x47, 0x74, 0x6b, + 0x42, 0x6f, 0x78, 0x22, 0x3e, 0x3c, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x76, 0x69, 0x73, + 0x69, 0x62, 0x6c, 0x65, 0x22, 0x3e, 0x54, 0x72, + 0x75, 0x65, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6f, 0x72, 0x69, + 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x3e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, + 0x61, 0x6c, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x70, 0x61, + 0x63, 0x69, 0x6e, 0x67, 0x22, 0x3e, 0x31, 0x32, + 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x22, 0x68, 0x61, 0x6c, 0x69, 0x67, + 0x6e, 0x22, 0x3e, 0x63, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x22, 0x76, 0x61, 0x6c, 0x69, + 0x67, 0x6e, 0x22, 0x3e, 0x63, 0x65, 0x6e, 0x74, + 0x65, 0x72, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x68, 0x65, 0x78, + 0x70, 0x61, 0x6e, 0x64, 0x22, 0x3e, 0x54, 0x72, + 0x75, 0x65, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x76, 0x65, 0x78, + 0x70, 0x61, 0x6e, 0x64, 0x22, 0x3e, 0x54, 0x72, + 0x75, 0x65, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x73, 0x74, + 0x79, 0x6c, 0x65, 0x3e, 0x3c, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x22, 0x64, 0x69, 0x6d, 0x2d, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x22, 0x2f, 0x3e, 0x3c, 0x2f, 0x73, + 0x74, 0x79, 0x6c, 0x65, 0x3e, 0x3c, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x3e, 0x3c, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x20, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x3d, 0x22, 0x47, 0x74, 0x6b, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x22, 0x3e, 0x3c, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x76, 0x69, 0x73, + 0x69, 0x62, 0x6c, 0x65, 0x22, 0x3e, 0x54, 0x72, + 0x75, 0x65, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, + 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x61, 0x6e, + 0x5f, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x22, 0x3e, + 0x46, 0x61, 0x6c, 0x73, 0x65, 0x3c, 0x2f, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x3e, + 0x3c, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, + 0x70, 0x69, 0x78, 0x65, 0x6c, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x22, 0x3e, 0x31, 0x32, 0x38, 0x3c, + 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x3e, 0x3c, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x20, 0x6e, 0x61, 0x6d, 0x65, + 0x3d, 0x22, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x3e, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2d, 0x75, 0x6e, 0x61, 0x76, + 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2d, + 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x69, 0x63, + 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, + 0x74, 0x79, 0x3e, 0x3c, 0x2f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3e, 0x3c, 0x2f, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x3e, 0x3c, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x3e, 0x3c, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, + 0x3d, 0x22, 0x47, 0x74, 0x6b, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x22, 0x3e, 0x3c, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x22, 0x76, 0x69, 0x73, 0x69, + 0x62, 0x6c, 0x65, 0x22, 0x3e, 0x54, 0x72, 0x75, + 0x65, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x22, 0x63, 0x61, 0x6e, 0x5f, + 0x66, 0x6f, 0x63, 0x75, 0x73, 0x22, 0x3e, 0x46, + 0x61, 0x6c, 0x73, 0x65, 0x3c, 0x2f, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, + 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x77, + 0x72, 0x61, 0x70, 0x22, 0x3e, 0x54, 0x72, 0x75, + 0x65, 0x3c, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x3e, 0x3c, 0x70, 0x72, 0x6f, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x22, 0x6d, 0x61, 0x78, 0x2d, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x2d, 0x63, 0x68, + 0x61, 0x72, 0x73, 0x22, 0x3e, 0x36, 0x30, 0x3c, + 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x3e, 0x3c, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x20, 0x6e, 0x61, 0x6d, 0x65, + 0x3d, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, + 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3d, 0x22, 0x4e, + 0x6f, 0x22, 0x3e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, + 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x64, 0x3c, 0x2f, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x3e, 0x3c, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x3e, 0x3c, 0x61, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x63, 0x61, 0x6c, + 0x65, 0x22, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3d, 0x22, 0x31, 0x2e, 0x34, 0x22, 0x2f, 0x3e, + 0x3c, 0x2f, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x73, 0x3e, 0x3c, 0x2f, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3e, 0x3c, 0x2f, + 0x63, 0x68, 0x69, 0x6c, 0x64, 0x3e, 0x3c, 0x2f, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3e, 0x3c, + 0x70, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x3e, + 0x3c, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x22, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3e, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x64, 0x3c, 0x2f, 0x70, + 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x3e, + 0x3c, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x69, 0x6e, + 0x67, 0x3e, 0x3c, 0x2f, 0x63, 0x68, 0x69, 0x6c, + 0x64, 0x3e, 0x3c, 0x2f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3e, 0x3c, 0x2f, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x65, 0x6d, + 0x70, 0x6c, 0x61, 0x74, 0x65, 0x3e, 0x3c, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, + 0x65, 0x3e, 0x0a, 0x00, 0x00, 0x28, 0x75, 0x75, + 0x61, 0x79, 0x29, 0x67, 0x73, 0x2d, 0x68, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2d, 0x64, 0x69, + 0x61, 0x6c, 0x6f, 0x67, 0x2e, 0x75, 0x69, 0x00, 0x34, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-shell-updates.c new/gnome-software-3.16.4/src/gs-shell-updates.c --- old/gnome-software-3.16.3/src/gs-shell-updates.c 2015-06-05 21:15:51.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-shell-updates.c 2015-06-14 16:11:21.000000000 +0200 @@ -34,6 +34,7 @@ #include "gs-markdown.h" #include "gs-update-dialog.h" #include "gs-update-list.h" +#include "gs-application.h" #include <gdesktop-enums.h> #include <langinfo.h> @@ -46,6 +47,7 @@ GS_SHELL_UPDATES_STATE_ACTION_REFRESH_HAS_UPDATES, GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES, GS_SHELL_UPDATES_STATE_NO_UPDATES, + GS_SHELL_UPDATES_STATE_MANAGED, GS_SHELL_UPDATES_STATE_HAS_UPDATES, GS_SHELL_UPDATES_STATE_FAILED, GS_SHELL_UPDATES_STATE_LAST, @@ -234,6 +236,7 @@ break; case GS_SHELL_UPDATES_STATE_ACTION_REFRESH_HAS_UPDATES: case GS_SHELL_UPDATES_STATE_NO_UPDATES: + case GS_SHELL_UPDATES_STATE_MANAGED: case GS_SHELL_UPDATES_STATE_HAS_UPDATES: case GS_SHELL_UPDATES_STATE_FAILED: gs_stop_spinner (GTK_SPINNER (priv->spinner_updates)); @@ -265,6 +268,7 @@ break; case GS_SHELL_UPDATES_STATE_ACTION_REFRESH_HAS_UPDATES: case GS_SHELL_UPDATES_STATE_NO_UPDATES: + case GS_SHELL_UPDATES_STATE_MANAGED: case GS_SHELL_UPDATES_STATE_HAS_UPDATES: case GS_SHELL_UPDATES_STATE_FAILED: break; @@ -283,6 +287,7 @@ case GS_SHELL_UPDATES_STATE_ACTION_REFRESH_NO_UPDATES: case GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES: case GS_SHELL_UPDATES_STATE_NO_UPDATES: + case GS_SHELL_UPDATES_STATE_MANAGED: case GS_SHELL_UPDATES_STATE_HAS_UPDATES: case GS_SHELL_UPDATES_STATE_STARTUP: case GS_SHELL_UPDATES_STATE_FAILED: @@ -306,6 +311,7 @@ break; case GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES: case GS_SHELL_UPDATES_STATE_STARTUP: + case GS_SHELL_UPDATES_STATE_MANAGED: widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_refresh")); gtk_widget_hide (widget); break; @@ -339,6 +345,7 @@ case GS_SHELL_UPDATES_STATE_ACTION_REFRESH_NO_UPDATES: case GS_SHELL_UPDATES_STATE_ACTION_GET_UPDATES: case GS_SHELL_UPDATES_STATE_NO_UPDATES: + case GS_SHELL_UPDATES_STATE_MANAGED: case GS_SHELL_UPDATES_STATE_FAILED: gtk_widget_hide (widget); break; @@ -380,6 +387,9 @@ case GS_SHELL_UPDATES_STATE_ACTION_REFRESH_HAS_UPDATES: gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_updates), "view"); break; + case GS_SHELL_UPDATES_STATE_MANAGED: + gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_updates), "managed"); + break; case GS_SHELL_UPDATES_STATE_FAILED: gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_updates), "failed"); break; @@ -411,6 +421,8 @@ GsShellUpdatesState state) { shell_updates->priv->state = state; + if (gs_updates_are_managed ()) + shell_updates->priv->state = GS_SHELL_UPDATES_STATE_MANAGED; gs_shell_updates_update_ui_state (shell_updates); } @@ -449,7 +461,7 @@ } widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates_counter")); - if (list != NULL) { + if (list != NULL && !gs_updates_are_managed ()) { _cleanup_free_ gchar *text = NULL; text = g_strdup_printf ("%d", g_list_length (list)); gtk_label_set_label (GTK_LABEL (widget), text); @@ -879,6 +891,32 @@ gs_shell_updates_update_ui_state (shell_updates); } +static void +on_permission_changed (GPermission *permission, + GParamSpec *pspec, + gpointer data) +{ + GsShellUpdates *shell_updates = data; + GsShellUpdatesPrivate *priv = shell_updates->priv; + + if (gs_updates_are_managed()) { + gs_shell_updates_set_state (shell_updates, GS_SHELL_UPDATES_STATE_MANAGED); + } + else if (priv->state == GS_SHELL_UPDATES_STATE_MANAGED) { + gs_shell_updates_set_state (shell_updates, GS_SHELL_UPDATES_STATE_NO_UPDATES); + } +} + +static void +gs_shell_updates_monitor_permission (GsShellUpdates *shell_updates) +{ + GPermission *permission; + + permission = gs_offline_updates_permission_get (); + g_signal_connect (permission, "notify", + G_CALLBACK (on_permission_changed), shell_updates); +} + void gs_shell_updates_setup (GsShellUpdates *shell_updates, GsShell *shell, @@ -922,6 +960,8 @@ G_CALLBACK (gs_shell_updates_button_network_settings_cb), shell_updates); + gs_shell_updates_monitor_permission (shell_updates); + g_signal_connect (priv->control, "notify::network-state", G_CALLBACK (gs_shell_updates_notify_network_state_cb), shell_updates); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-shell-updates.ui new/gnome-software-3.16.4/src/gs-shell-updates.ui --- old/gnome-software-3.16.3/src/gs-shell-updates.ui 2015-06-05 16:38:43.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-shell-updates.ui 2015-06-14 16:11:21.000000000 +0200 @@ -280,6 +280,43 @@ <property name="name">failed</property> </packing> </child> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <style> + <class name="dim-label"/> + </style> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixel_size">128</property> + <property name="icon_name">action-unavailable-symbolic</property> + </object> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="wrap">True</property> + <property name="max-width-chars">60</property> + <property name="label" translatable="No">Updates are automatically managed</property> + <attributes> + <attribute name="scale" value="1.4"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="name">managed</property> + </packing> + </child> </object> </child> </template> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-shell.c new/gnome-software-3.16.4/src/gs-shell.c --- old/gnome-software-3.16.3/src/gs-shell.c 2015-06-05 21:15:51.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-shell.c 2015-06-14 16:11:21.000000000 +0200 @@ -37,6 +37,7 @@ #include "gs-shell-extras.h" #include "gs-sources-dialog.h" #include "gs-update-dialog.h" +#include "gs-offline-updates.h" static const gchar *page_name[] = { "overview", @@ -174,6 +175,8 @@ widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), mode == GS_SHELL_MODE_UPDATES); + gtk_widget_set_visible (widget, !gs_updates_are_managed() || mode == GS_SHELL_MODE_UPDATES); + priv->ignore_primary_buttons = FALSE; /* switch page */ @@ -519,6 +522,29 @@ gtk_widget_get_scale_factor (widget)); } +static void +on_permission_changed (GPermission *permission, + GParamSpec *pspec, + gpointer data) +{ + GsShell *shell = data; + GsShellPrivate *priv = shell->priv; + GtkWidget *widget; + + widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_updates")); + gtk_widget_set_visible (widget, !gs_updates_are_managed() || priv->mode == GS_SHELL_MODE_UPDATES); +} + +static void +gs_shell_monitor_permission (GsShell *shell) +{ + GPermission *permission; + + permission = gs_offline_updates_permission_get (); + g_signal_connect (permission, "notify", + G_CALLBACK (on_permission_changed), shell); +} + /** * gs_shell_setup: */ @@ -535,6 +561,8 @@ G_CALLBACK (gs_shell_updates_changed_cb), shell); priv->cancellable = g_object_ref (cancellable); + gs_shell_monitor_permission (shell); + /* get UI */ priv->builder = gtk_builder_new_from_resource ("/org/gnome/Software/gnome-software.ui"); priv->main_window = GTK_WINDOW (gtk_builder_get_object (priv->builder, "window_software")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-update-dialog.c new/gnome-software-3.16.4/src/gs-update-dialog.c --- old/gnome-software-3.16.3/src/gs-update-dialog.c 2015-06-05 21:15:51.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-update-dialog.c 2015-06-14 16:11:21.000000000 +0200 @@ -202,6 +202,17 @@ } } +static void +unset_focus (GtkWidget *widget) +{ + GtkWidget *focus; + + focus = gtk_window_get_focus (GTK_WINDOW (widget)); + if (GTK_IS_LABEL (focus)) + gtk_label_select_region (GTK_LABEL (focus), 0, 0); + gtk_window_set_focus (GTK_WINDOW (widget), NULL); +} + void gs_update_dialog_show_update_details (GsUpdateDialog *dialog, GsApp *app) { @@ -215,6 +226,10 @@ /* set update header */ set_updates_description_ui (dialog, app); + /* workaround a gtk+ issue where the dialog comes up with a label selected, + * https://bugzilla.gnome.org/show_bug.cgi?id=734033 */ + unset_focus (GTK_WIDGET (dialog)); + /* set update description */ if (kind == GS_APP_KIND_OS_UPDATE) { GPtrArray *related; @@ -325,17 +340,6 @@ } static void -unset_focus (GtkWidget *widget) -{ - GtkWidget *focus; - - focus = gtk_window_get_focus (GTK_WINDOW (widget)); - if (GTK_IS_LABEL (focus)) - gtk_label_select_region (GTK_LABEL (focus), 0, 0); - gtk_window_set_focus (GTK_WINDOW (widget), NULL); -} - -static void gs_update_dialog_finalize (GObject *object) { GsUpdateDialog *dialog = GS_UPDATE_DIALOG (object); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/gs-update-monitor.c new/gnome-software-3.16.4/src/gs-update-monitor.c --- old/gnome-software-3.16.3/src/gs-update-monitor.c 2015-06-05 16:38:43.000000000 +0200 +++ new/gnome-software-3.16.4/src/gs-update-monitor.c 2015-06-14 16:11:21.000000000 +0200 @@ -554,12 +554,18 @@ g_source_remove (monitor->reenable_offline_update_id); monitor->reenable_offline_update_id = 0; } + if (monitor->control != NULL) { + g_signal_handlers_disconnect_by_func (monitor->control, notify_network_state_cb, monitor); + g_clear_object (&monitor->control); + } + if (monitor->offline_update_monitor != NULL) { + g_signal_handlers_disconnect_by_func (monitor->offline_update_monitor, offline_update_monitor_cb, monitor); + g_clear_object (&monitor->offline_update_monitor); + } g_clear_pointer (&monitor->pending_downloads, g_strfreev); g_clear_pointer (&monitor->check_timestamp, g_date_time_unref); g_clear_object (&monitor->task); - g_clear_object (&monitor->control); g_clear_object (&monitor->offline_update_file); - g_clear_object (&monitor->offline_update_monitor); g_clear_object (&monitor->settings); g_application_release (monitor->application); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/gnome-software-3.16.3/src/plugins/gs-plugin-appstream.c new/gnome-software-3.16.4/src/plugins/gs-plugin-appstream.c --- old/gnome-software-3.16.3/src/plugins/gs-plugin-appstream.c 2015-06-05 21:15:51.000000000 +0200 +++ new/gnome-software-3.16.4/src/plugins/gs-plugin-appstream.c 2015-06-14 16:11:21.000000000 +0200 @@ -32,6 +32,7 @@ struct GsPluginPrivate { AsStore *store; + GMutex store_mutex; gchar *locale; gsize done_init; gboolean has_hi_dpi_support; @@ -88,6 +89,7 @@ gs_plugin_initialize (GsPlugin *plugin) { plugin->priv = GS_PLUGIN_GET_PRIVATE (GsPluginPrivate); + g_mutex_init (&plugin->priv->store_mutex); plugin->priv->store = as_store_new (); g_signal_connect (plugin->priv->store, "changed", G_CALLBACK (gs_plugin_appstream_store_changed_cb), @@ -120,6 +122,7 @@ { g_free (plugin->priv->locale); g_object_unref (plugin->priv->store); + g_mutex_clear (&plugin->priv->store_mutex); } /** @@ -184,6 +187,8 @@ guint i; _cleanup_hashtable_unref_ GHashTable *origins = NULL; + g_mutex_lock (&plugin->priv->store_mutex); + /* clear all existing applications if the store was invalidated */ as_store_remove_all (plugin->priv->store); @@ -244,6 +249,7 @@ } } out: + g_mutex_unlock (&plugin->priv->store_mutex); gs_profile_stop (plugin->profile, "appstream::startup"); return ret; } @@ -666,6 +672,8 @@ gboolean ret = TRUE; AsApp *item = NULL; + g_mutex_lock (&plugin->priv->store_mutex); + /* find anything that matches the ID */ id = gs_app_get_id (app); if (id == NULL) @@ -679,6 +687,7 @@ if (!ret) goto out; out: + g_mutex_unlock (&plugin->priv->store_mutex); *found = (item != NULL); return ret; } @@ -693,9 +702,12 @@ { AsApp *item = NULL; GPtrArray *sources; + gboolean ret = TRUE; const gchar *pkgname; guint i; + g_mutex_lock (&plugin->priv->store_mutex); + /* find anything that matches the ID */ sources = gs_app_get_sources (app); for (i = 0; i < sources->len && item == NULL; i++) { @@ -708,10 +720,13 @@ /* nothing found */ if (item == NULL) - return TRUE; + goto out; /* set new properties */ - return gs_plugin_refine_item (plugin, app, item, error); + ret = gs_plugin_refine_item (plugin, app, item, error); +out: + g_mutex_unlock (&plugin->priv->store_mutex); + return ret; } /** @@ -734,7 +749,7 @@ ret = gs_plugin_startup (plugin, error); g_once_init_leave (&plugin->priv->done_init, TRUE); if (!ret) - goto out; + return FALSE; } gs_profile_start (plugin->profile, "appstream::refine"); @@ -780,11 +795,12 @@ ret = gs_plugin_startup (plugin, error); g_once_init_leave (&plugin->priv->done_init, TRUE); if (!ret) - goto out; + return FALSE; } /* get the two search terms */ gs_profile_start (plugin->profile, "appstream::add-category-apps"); + g_mutex_lock (&plugin->priv->store_mutex); search_id1 = gs_category_get_id (category); parent = gs_category_get_parent (category); if (parent != NULL) @@ -816,6 +832,7 @@ gs_plugin_add_app (list, app); } out: + g_mutex_unlock (&plugin->priv->store_mutex); gs_profile_stop (plugin->profile, "appstream::add-category-apps"); return ret; } @@ -914,11 +931,12 @@ ret = gs_plugin_startup (plugin, error); g_once_init_leave (&plugin->priv->done_init, TRUE); if (!ret) - goto out; + return FALSE; } /* search categories for the search term */ gs_profile_start (plugin->profile, "appstream::search"); + g_mutex_lock (&plugin->priv->store_mutex); array = as_store_get_apps (plugin->priv->store); for (i = 0; i < array->len; i++) { if (g_cancellable_set_error_if_cancelled (cancellable, error)) @@ -930,6 +948,7 @@ goto out; } out: + g_mutex_unlock (&plugin->priv->store_mutex); gs_profile_stop (plugin->profile, "appstream::search"); return ret; } @@ -953,11 +972,12 @@ ret = gs_plugin_startup (plugin, error); g_once_init_leave (&plugin->priv->done_init, TRUE); if (!ret) - goto out; + return FALSE; } /* search categories for the search term */ gs_profile_start (plugin->profile, "appstream::add_installed"); + g_mutex_lock (&plugin->priv->store_mutex); array = as_store_get_apps (plugin->priv->store); for (i = 0; i < array->len; i++) { item = g_ptr_array_index (array, i); @@ -971,6 +991,7 @@ } } out: + g_mutex_unlock (&plugin->priv->store_mutex); gs_profile_stop (plugin->profile, "appstream::add_installed"); return ret; } @@ -1039,11 +1060,12 @@ ret = gs_plugin_startup (plugin, error); g_once_init_leave (&plugin->priv->done_init, TRUE); if (!ret) - goto out; + return FALSE; } /* find out how many packages are in each category */ gs_profile_start (plugin->profile, "appstream::add-categories"); + g_mutex_lock (&plugin->priv->store_mutex); array = as_store_get_apps (plugin->priv->store); for (i = 0; i < array->len; i++) { app = g_ptr_array_index (array, i); @@ -1053,7 +1075,7 @@ continue; gs_plugin_add_categories_for_app (*list, app); } -out: + g_mutex_unlock (&plugin->priv->store_mutex); gs_profile_stop (plugin->profile, "appstream::add-categories"); return ret; } @@ -1305,9 +1327,10 @@ ret = gs_plugin_startup (plugin, error); g_once_init_leave (&plugin->priv->done_init, TRUE); if (!ret) - goto out; + return FALSE; } gs_profile_start (plugin->profile, "appstream::add_popular"); + g_mutex_lock (&plugin->priv->store_mutex); /* get already installed applications */ ignore_apps = g_hash_table_new (g_str_hash, g_str_equal); @@ -1348,6 +1371,7 @@ } out: + g_mutex_unlock (&plugin->priv->store_mutex); gs_profile_stop (plugin->profile, "appstream::add_popular"); return ret; }
