Lines Matching +full:- +full:- +full:volume
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
3 /* GIO - GLib Input, Output and Streaming Library
5 * Copyright (C) 2006-2007 Red Hat, Inc.
53 GUnixVolume *volume; /* owned by volume monitor */ member
79 if (mount->volume_monitor != NULL) in G_DEFINE_TYPE_WITH_CODE()
80 g_object_unref (mount->volume_monitor); in G_DEFINE_TYPE_WITH_CODE()
82 if (mount->volume) in G_DEFINE_TYPE_WITH_CODE()
83 _g_unix_volume_unset_mount (mount->volume, mount); in G_DEFINE_TYPE_WITH_CODE()
85 /* TODO: g_warn_if_fail (volume->volume == NULL); */ in G_DEFINE_TYPE_WITH_CODE()
86 g_object_unref (mount->icon); in G_DEFINE_TYPE_WITH_CODE()
87 g_object_unref (mount->symbolic_icon); in G_DEFINE_TYPE_WITH_CODE()
88 g_free (mount->name); in G_DEFINE_TYPE_WITH_CODE()
89 g_free (mount->device_path); in G_DEFINE_TYPE_WITH_CODE()
90 g_free (mount->mount_path); in G_DEFINE_TYPE_WITH_CODE()
92 G_OBJECT_CLASS (g_unix_mount_parent_class)->finalize (object); in G_DEFINE_TYPE_WITH_CODE()
100 gobject_class->finalize = g_unix_mount_finalize; in g_unix_mount_class_init()
111 GUnixVolume *volume) in _g_unix_mount_new() argument
115 /* No volume for mount: Ignore internal things */ in _g_unix_mount_new()
116 if (volume == NULL && !g_unix_mount_guess_should_display (mount_entry)) in _g_unix_mount_new()
120 mount->volume_monitor = volume_monitor != NULL ? g_object_ref (volume_monitor) : NULL; in _g_unix_mount_new()
121 mount->device_path = g_strdup (g_unix_mount_get_device_path (mount_entry)); in _g_unix_mount_new()
122 mount->mount_path = g_strdup (g_unix_mount_get_mount_path (mount_entry)); in _g_unix_mount_new()
123 mount->can_eject = g_unix_mount_guess_can_eject (mount_entry); in _g_unix_mount_new()
125 mount->name = g_unix_mount_guess_name (mount_entry); in _g_unix_mount_new()
126 mount->icon = g_unix_mount_guess_icon (mount_entry); in _g_unix_mount_new()
127 mount->symbolic_icon = g_unix_mount_guess_symbolic_icon (mount_entry); in _g_unix_mount_new()
130 mount->volume = volume; in _g_unix_mount_new()
131 if (volume != NULL) in _g_unix_mount_new()
132 _g_unix_volume_set_mount (volume, mount); in _g_unix_mount_new()
140 if (mount->volume != NULL) in _g_unix_mount_unmounted()
142 _g_unix_volume_unset_mount (mount->volume, mount); in _g_unix_mount_unmounted()
143 mount->volume = NULL; in _g_unix_mount_unmounted()
145 /* there's really no need to emit mount_changed on the volume monitor in _g_unix_mount_unmounted()
152 GUnixVolume *volume) in _g_unix_mount_unset_volume() argument
154 if (mount->volume == volume) in _g_unix_mount_unset_volume()
156 mount->volume = NULL; in _g_unix_mount_unset_volume()
159 if (mount->volume_monitor != NULL) in _g_unix_mount_unset_volume()
160 g_signal_emit_by_name (mount->volume_monitor, "mount-changed", mount); in _g_unix_mount_unset_volume()
169 return g_file_new_for_path (unix_mount->mount_path); in g_unix_mount_get_root()
177 return g_object_ref (unix_mount->icon); in g_unix_mount_get_icon()
185 return g_object_ref (unix_mount->symbolic_icon); in g_unix_mount_get_symbolic_icon()
199 return g_strdup (unix_mount->name); in g_unix_mount_get_name()
206 return strcmp (mount->mount_path, mount_path) == 0; in _g_unix_mount_has_mount_path()
214 if (unix_mount->volume != NULL) in g_unix_mount_get_drive()
215 return g_volume_get_drive (G_VOLUME (unix_mount->volume)); in g_unix_mount_get_drive()
225 if (unix_mount->volume) in g_unix_mount_get_volume()
226 return G_VOLUME (g_object_ref (unix_mount->volume)); in g_unix_mount_get_volume()
241 return unix_mount->can_eject; in g_unix_mount_can_eject()
317 if (unix_mount->volume_monitor != NULL) in eject_unmount_do()
318 g_signal_emit_by_name (unix_mount->volume_monitor, "mount-pre-unmount", mount); in eject_unmount_do()
320 g_signal_emit_by_name (mount, "pre-unmount", 0); in eject_unmount_do()
337 if (unix_mount->mount_path != NULL) in g_unix_mount_unmount()
338 argv[1] = unix_mount->mount_path; in g_unix_mount_unmount()
340 argv[1] = unix_mount->device_path; in g_unix_mount_unmount()
363 if (unix_mount->mount_path != NULL) in g_unix_mount_eject()
364 argv[1] = unix_mount->mount_path; in g_unix_mount_eject()
366 argv[1] = unix_mount->device_path; in g_unix_mount_eject()
382 iface->get_root = g_unix_mount_get_root; in g_unix_mount_mount_iface_init()
383 iface->get_name = g_unix_mount_get_name; in g_unix_mount_mount_iface_init()
384 iface->get_icon = g_unix_mount_get_icon; in g_unix_mount_mount_iface_init()
385 iface->get_symbolic_icon = g_unix_mount_get_symbolic_icon; in g_unix_mount_mount_iface_init()
386 iface->get_uuid = g_unix_mount_get_uuid; in g_unix_mount_mount_iface_init()
387 iface->get_drive = g_unix_mount_get_drive; in g_unix_mount_mount_iface_init()
388 iface->get_volume = g_unix_mount_get_volume; in g_unix_mount_mount_iface_init()
389 iface->can_unmount = g_unix_mount_can_unmount; in g_unix_mount_mount_iface_init()
390 iface->can_eject = g_unix_mount_can_eject; in g_unix_mount_mount_iface_init()
391 iface->unmount = g_unix_mount_unmount; in g_unix_mount_mount_iface_init()
392 iface->unmount_finish = g_unix_mount_unmount_finish; in g_unix_mount_mount_iface_init()
393 iface->eject = g_unix_mount_eject; in g_unix_mount_mount_iface_init()
394 iface->eject_finish = g_unix_mount_eject_finish; in g_unix_mount_mount_iface_init()