Update to 3.31.92

This commit is contained in:
Kalev Lember 2019-03-04 22:58:24 +01:00
parent bdfa6da37e
commit 142176df2e
4 changed files with 7 additions and 245 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
/gnome-control-center-3.30.2.tar.xz
/gnome-control-center-3.31.4.tar.xz
/gnome-control-center-3.31.90.tar.xz
/gnome-control-center-3.31.92.tar.xz

239
387.patch
View File

@ -1,239 +0,0 @@
diff --git a/meson.build b/meson.build
index bc8e20855..91599d445 100644
--- a/meson.build
+++ b/meson.build
@@ -128,6 +128,7 @@ libxml_dep = dependency('libxml-2.0')
polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.103')
pulse_dep = dependency('libpulse', version: pulse_req_version)
pulse_mainloop_dep = dependency('libpulse-mainloop-glib', version: pulse_req_version)
+udisks2_dep = dependency('udisks2', version: '>= 2.1.8')
upower_glib_dep = dependency('upower-glib', version: '>= 0.99.8')
x11_dep = dependency('x11')
xi_dep = dependency('xi', version: '>= 1.2')
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
index e2276a295..6a8e91841 100644
--- a/panels/info/cc-info-overview-panel.c
+++ b/panels/info/cc-info-overview-panel.c
@@ -36,6 +36,7 @@
#include <glibtop/mountlist.h>
#include <glibtop/mem.h>
#include <glibtop/sysinfo.h>
+#include <udisks/udisks.h>
#include <gdk/gdk.h>
@@ -81,9 +82,7 @@ typedef struct
GCancellable *cancellable;
- /* Free space */
- GList *primary_mounts;
- guint64 total_bytes;
+ UDisksClient *client;
GraphicsData *graphics_data;
} CcInfoOverviewPanelPrivate;
@@ -96,8 +95,6 @@ struct _CcInfoOverviewPanel
CcInfoOverviewPanelPrivate *priv;
};
-static void get_primary_disc_info_start (CcInfoOverviewPanel *self);
-
typedef struct
{
char *major;
@@ -486,111 +483,56 @@ get_os_type (void)
}
static void
-query_done (GFile *file,
- GAsyncResult *res,
- CcInfoOverviewPanel *self)
+get_primary_disc_info (CcInfoOverviewPanel *self)
{
+ g_autoptr (GHashTable) added_drives = NULL;
CcInfoOverviewPanelPrivate *priv;
- g_autoptr(GFileInfo) info = NULL;
- g_autoptr(GError) error = NULL;
+ GDBusObjectManager *manager;
+ GList *objects, *l;
+ guint64 total_size;
- info = g_file_query_filesystem_info_finish (file, res, &error);
- if (info != NULL)
- {
- priv = cc_info_overview_panel_get_instance_private (self);
- priv->total_bytes += g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
- }
- else
- {
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- return;
- else
- {
- g_autofree char *path = NULL;
- path = g_file_get_path (file);
- g_warning ("Failed to get filesystem free space for '%s': %s", path, error->message);
- }
- }
+ priv = cc_info_overview_panel_get_instance_private (self);
+ total_size = 0;
- /* And onto the next element */
- get_primary_disc_info_start (self);
-}
-
-static void
-get_primary_disc_info_start (CcInfoOverviewPanel *self)
-{
- GUnixMountEntry *mount;
- g_autoptr(GFile) file = NULL;
- CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
-
- if (priv->primary_mounts == NULL)
+ if (!priv->client)
{
- g_autofree char *size = NULL;
-
- size = g_format_size (priv->total_bytes);
- gtk_label_set_text (GTK_LABEL (priv->disk_label), size);
-
+ gtk_label_set_text (GTK_LABEL (priv->disk_label), _("Unknown"));
return;
}
- mount = priv->primary_mounts->data;
- priv->primary_mounts = g_list_remove (priv->primary_mounts, mount);
- file = g_file_new_for_path (g_unix_mount_get_mount_path (mount));
- g_unix_mount_free (mount);
-
- g_file_query_filesystem_info_async (file,
- G_FILE_ATTRIBUTE_FILESYSTEM_SIZE,
- 0,
- priv->cancellable,
- (GAsyncReadyCallback) query_done,
- self);
-}
+ manager = udisks_client_get_object_manager (priv->client);
+ objects = g_dbus_object_manager_get_objects (manager);
+ added_drives = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
-static void
-get_primary_disc_info (CcInfoOverviewPanel *self)
-{
- GList *points;
- GList *p;
- GHashTable *hash;
- CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
-
- hash = g_hash_table_new (g_str_hash, g_str_equal);
- points = g_unix_mount_points_get (NULL);
-
- /* If we do not have /etc/fstab around, try /etc/mtab */
- if (points == NULL)
- points = g_unix_mounts_get (NULL);
-
- for (p = points; p != NULL; p = p->next)
+ for (l = objects; l != NULL; l = l->next)
{
- GUnixMountEntry *mount = p->data;
- const char *mount_path;
- const char *device_path;
-
- mount_path = g_unix_mount_get_mount_path (mount);
- device_path = g_unix_mount_get_device_path (mount);
-
- /* Do not count multiple mounts with same device_path, because it is
- * probably something like btrfs subvolume. Use only the first one in
- * order to count the real size. */
- if (gsd_should_ignore_unix_mount (mount) ||
- gsd_is_removable_mount (mount) ||
- g_str_has_prefix (mount_path, "/media/") ||
- g_str_has_prefix (mount_path, g_get_home_dir ()) ||
- g_hash_table_lookup (hash, device_path) != NULL)
+ UDisksDrive *drive;
+ drive = udisks_object_peek_drive (UDISKS_OBJECT (l->data));
+
+ /* Skip removable devices */
+ if (drive == NULL ||
+ udisks_drive_get_removable (drive) ||
+ udisks_drive_get_ejectable (drive) ||
+ g_hash_table_contains (added_drives, udisks_drive_get_id (drive)))
{
- g_unix_mount_free (mount);
continue;
}
- priv->primary_mounts = g_list_prepend (priv->primary_mounts, mount);
- g_hash_table_insert (hash, (gpointer) device_path, (gpointer) device_path);
+ total_size += udisks_drive_get_size (drive);
+ g_hash_table_add (added_drives, (gpointer) udisks_drive_get_id (drive));
+ }
+
+ if (total_size > 0)
+ {
+ g_autofree gchar *size = g_format_size (total_size);
+ gtk_label_set_text (GTK_LABEL (priv->disk_label), size);
+ }
+ else
+ {
+ gtk_label_set_text (GTK_LABEL (priv->disk_label), _("Unknown"));
}
- g_list_free (points);
- g_hash_table_destroy (hash);
- priv->cancellable = g_cancellable_new ();
- get_primary_disc_info_start (self);
+ g_list_free_full (objects, g_object_unref);
}
static char *
@@ -852,8 +794,7 @@ cc_info_overview_panel_finalize (GObject *object)
g_clear_object (&priv->cancellable);
}
- if (priv->primary_mounts)
- g_list_free_full (priv->primary_mounts, (GDestroyNotify) g_unix_mount_free);
+ g_clear_object (&priv->client);
g_free (priv->gnome_version);
g_free (priv->gnome_date);
@@ -895,6 +836,7 @@ static void
cc_info_overview_panel_init (CcInfoOverviewPanel *self)
{
CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
+ GError *error = NULL;
gtk_widget_init_template (GTK_WIDGET (self));
@@ -907,6 +849,15 @@ cc_info_overview_panel_init (CcInfoOverviewPanel *self)
else
gtk_widget_destroy (priv->updates_button);
+ priv->client = udisks_client_new_sync (NULL, &error);
+
+ if (error != NULL)
+ {
+ g_warning ("Unable to get UDisks client: %s. Disk information will not be available.",
+ error->message);
+ g_error_free (error);
+ }
+
info_overview_panel_setup_overview (self);
info_overview_panel_setup_virt (self);
}
diff --git a/panels/info/meson.build b/panels/info/meson.build
index 037425513..23abbda78 100644
--- a/panels/info/meson.build
+++ b/panels/info/meson.build
@@ -61,6 +61,7 @@ sources += gnome.compile_resources(
deps = common_deps + [
polkit_gobject_dep,
+ udisks2_dep,
dependency('libgtop-2.0')
]
--
2.18.1

View File

@ -9,8 +9,8 @@
%define gnome_bluetooth_version 3.18.2
Name: gnome-control-center
Version: 3.31.90
Release: 2%{?dist}
Version: 3.31.92
Release: 1%{?dist}
Summary: Utilities to configure the GNOME desktop
License: GPLv2+ and CC-BY-SA
@ -21,9 +21,6 @@ Source0: https://download.gnome.org/sources/gnome-control-center/3.31/gno
Patch0: distro-logo.patch
# https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/214
Patch2: 0002-background-Add-queue-to-load-4-pictures-at-a-time.patch
# https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/387
# Fix for udisks crasher, already merged should be in the next upstream release.
Patch3: https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/387.patch
BuildRequires: chrpath
BuildRequires: cups-devel
@ -195,6 +192,9 @@ chrpath --delete $RPM_BUILD_ROOT%{_bindir}/gnome-control-center
%dir %{_datadir}/gnome/wm-properties
%changelog
* Mon Mar 04 2019 Kalev Lember <klember@redhat.com> - 3.31.92-1
- Update to 3.31.92
* Sat Feb 23 2019 Kevin Fenzi <kevin@scrye.com> - 3.31.90-2
- Add https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/387.patch
to fix udisks crash

View File

@ -1 +1 @@
SHA512 (gnome-control-center-3.31.90.tar.xz) = 3e61eab8846fdcd961c0ba0171543a1726894a46f1c87126855ef0dae5f990040dfc0baa7fc6f2558ed47110bf6d31192eac2a000f6d7a5c39519f286a3eaa7c
SHA512 (gnome-control-center-3.31.92.tar.xz) = 166006dc7754919acbfc7a53f65b5708db4f5c99c5a73ab9cbcf9e7bbe62e594b813ae36039e9220df27d8a1854bf38b63e3fbc5ab61458d1e346dc2351e6644