[glib/revert-205059b9] Revert "Merge branch 'wip/oholy/trashing-locations' into 'master'"



commit da3daf2803daa2ed1f8f7f660c4f3bdc3a35d7e2
Author: Philip Withnall <philip tecnocode co uk>
Date:   Thu Jun 7 16:42:57 2018 +0000

    Revert "Merge branch 'wip/oholy/trashing-locations' into 'master'"
    
    This reverts merge request !49

 gio/glocalfile.c      |  28 +-------------
 gio/tests/Makefile.am |   1 -
 gio/tests/meson.build |   1 -
 gio/tests/trash.c     | 104 --------------------------------------------------
 4 files changed, 1 insertion(+), 133 deletions(-)
---
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index aff15a982..3cd0137d6 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -1769,7 +1769,6 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
   char uid_str[32];
   GStatBuf global_stat, trash_stat;
   gboolean res;
-  GUnixMountEntry *mount;
 
   if (g_once_init_enter (&home_dev_set))
     {
@@ -1788,16 +1787,6 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
   if (topdir == NULL)
     return FALSE;
 
-  mount = g_unix_mount_at (topdir, NULL);
-  if (mount == NULL || g_unix_mount_is_system_internal (mount))
-    {
-      g_clear_pointer (&mount, g_unix_mount_free);
-
-      return FALSE;
-    }
-
-  g_clear_pointer (&mount, g_unix_mount_free);
-
   globaldir = g_build_filename (topdir, ".Trash", NULL);
   if (g_lstat (globaldir, &global_stat) == 0 &&
       S_ISDIR (global_stat.st_mode) &&
@@ -1941,7 +1930,6 @@ g_local_file_trash (GFile         *file,
     {
       uid_t uid;
       char uid_str[32];
-      GUnixMountEntry *mount;
 
       uid = geteuid ();
       g_snprintf (uid_str, sizeof (uid_str), "%lu", (unsigned long)uid);
@@ -1954,21 +1942,7 @@ g_local_file_trash (GFile         *file,
                           file, G_IO_ERROR_NOT_SUPPORTED);
          return FALSE;
        }
-
-      mount = g_unix_mount_at (topdir, NULL);
-      if (mount == NULL || g_unix_mount_is_system_internal (mount))
-        {
-          g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
-                       _("Trashing on system internal mounts is not supported"));
-
-          g_clear_pointer (&mount, g_unix_mount_free);
-          g_free (topdir);
-
-          return FALSE;
-        }
-
-      g_clear_pointer (&mount, g_unix_mount_free);
-
+      
       /* Try looking for global trash dir $topdir/.Trash/$uid */
       globaldir = g_build_filename (topdir, ".Trash", NULL);
       if (g_lstat (globaldir, &global_stat) == 0 &&
diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
index 599823893..410f11d95 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -273,7 +273,6 @@ test_programs += \
        unix-mounts                             \
        unix-streams                            \
        g-file-info-filesystem-readonly         \
-       trash                                   \
        $(NULL)
 
 test_extra_programs += \
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 83fadb6d7..96229bd8b 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -123,7 +123,6 @@ if host_machine.system() != 'windows'
     'unix-streams',
     'g-file-info-filesystem-readonly',
     'gschema-compile',
-    'trash',
   ]
 
   # Uninstalled because of the check-for-executable logic in DesktopAppInfo


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