summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2022-05-09 12:57:01 -0700
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2022-07-14 22:09:29 +0000
commitb17d6b290a6b663015f87de5e6b1e3c95e6efcd1 (patch)
tree92632cf0c20d1eebb1cb7e7b900e2a4f22fdc698
parent63f562117afe82b8c830ad538e43a3040b62f7f5 (diff)
downloadnautilus-b17d6b290a6b663015f87de5e6b1e3c95e6efcd1.tar.gz
places: Don't show available space for / when running in a flatpak
The available space is incorrect when running in a flatpak. Don't show available space for "/" when the /.flatpak-info file exists Related to: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1997
-rw-r--r--src/gtk/nautilusgtkplacesviewrow.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gtk/nautilusgtkplacesviewrow.c b/src/gtk/nautilusgtkplacesviewrow.c
index 0fe87ec10..64d889659 100644
--- a/src/gtk/nautilusgtkplacesviewrow.c
+++ b/src/gtk/nautilusgtkplacesviewrow.c
@@ -19,6 +19,7 @@
#include "config.h"
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include "nautilus-application.h"
#include "nautilus-enum-types.h"
#include <gio/gio.h>
@@ -141,9 +142,20 @@ out:
static void
measure_available_space (NautilusGtkPlacesViewRow *row)
{
+ gboolean skip_measure;
gboolean should_measure;
+ g_autoptr (GFile) root = NULL;
- should_measure = (!row->is_network && (row->volume || row->mount || row->file));
+ skip_measure = FALSE;
+ if (nautilus_application_is_sandboxed ())
+ {
+ root = g_file_new_for_uri ("file:///");
+ if (row->file != NULL)
+ skip_measure = g_file_equal (root, row->file);
+ }
+
+ should_measure = ((row->volume || row->mount || row->file) &&
+ !row->is_network && !skip_measure);
gtk_label_set_label (row->available_space_label, "");
gtk_widget_set_visible (GTK_WIDGET (row->available_space_label), should_measure);