1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2
* vim: set et sw=8 ts=8:
4
* Copyright (c) 2008, Novell, Inc.
5
* Copyright (c) 2012, Red Hat, Inc.
7
* Authors: Vincent Untz <vuntz@gnome.org>
8
* Bastien Nocera <hadess@hadess.net>
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31
#include "gsd-disk-space-helper.h"
34
gsd_should_ignore_unix_mount (GUnixMountEntry *mount)
36
const char *fs, *device;
39
/* This is borrowed from GLib and used as a way to determine
40
* which mounts we should ignore by default. GLib doesn't
41
* expose this in a way that allows it to be used for this
45
/* We also ignore network filesystems */
47
const gchar *ignore_fs[] = {
83
const gchar *ignore_devices[] = {
93
fs = g_unix_mount_get_fs_type (mount);
94
device = g_unix_mount_get_device_path (mount);
96
for (i = 0; ignore_fs[i] != NULL; i++)
97
if (g_str_equal (ignore_fs[i], fs))
100
for (i = 0; ignore_devices[i] != NULL; i++)
101
if (g_str_equal (ignore_devices[i], device))
108
gsd_is_removable_mount (GUnixMountEntry *mount)
110
const char *mount_path;
113
mount_path = g_unix_mount_get_mount_path (mount);
114
if (mount_path == NULL)
117
path = g_strdup_printf ("/run/media/%s", g_get_user_name ());
118
if (g_str_has_prefix (mount_path, path)) {