Next: , Previous: GnomeVFSVolume, Up: Top


11 GnomeVFSDrive

Container for GnomeVFSVolume (floppy drive, CD reader, ...)

11.1 Overview

11.2 Usage

— Class: <gnome-vfs-drive>

Derives from <gobject>.

This class defines no direct slots.

— Signal on <gnome-vfs-drive>: volume-mounted (arg0 <gnome-vfs-volume>)

This signal is emitted after the <gnome-vfs-volume>volume has been mounted.

When the volume is mounted, it is added to the drive's list of mounted volumes, which can be queried using gnome-vfs-drive-get-mounted-volumes.

It is also added to the list of the <gnome-vfs-volume-monitor>'s list of mounted volumes, which can be queried using gnome-vfs-volume-monitor-get-mounted-volumes.

— Signal on <gnome-vfs-drive>: volume-pre-unmount (arg0 <gnome-vfs-volume>)

This signal is emitted when the <gnome-vfs-volume>volume, which has been present in the <gnome-vfs-drive>drive, is about to be unmounted.

When the volume is unmounted, it is removed from the drive's list of mounted volumes, which can be queried using gnome-vfs-drive-get-mounted-volumes.

It is also removed from the <gnome-vfs-volume-monitor>'s list of mounted volumes, which can be queried using gnome-vfs-volume-monitor-get-mounted-volumes.

When a client application receives this signal, it must free all resources associated with the volume, for instance cancel all pending file operations on the volume, and cancel all pending file monitors using gnome-vfs-monitor-cancel.

— Signal on <gnome-vfs-drive>: volume-unmounted (arg0 <gnome-vfs-volume>)

This signal is emitted after the <gnome-vfs-volume>volume, which had been present in the <gnome-vfs-drive>drive, has been unmounted.

When the volume is unmounted, it is removed from the drive's list of mounted volumes, which can be queried using gnome-vfs-drive-get-mounted-volumes.

It is also removed from the <gnome-vfs-volume-monitor>'s list of mounted volumes, which can be queried using gnome-vfs-volume-monitor-get-mounted-volumes.

— Function: gnome-vfs-drive-compare (self <gnome-vfs-drive>) (<gnome-vfs-drive>) ⇒  (ret int)
— Method: compare

Compares two <gnome-vfs-drive> objects a and b. Two <gnome-vfs-drive> objects referring to different drives are guaranteed to not return 0 when comparing them, if they refer to the same drive 0 is returned.

The resulting <gint> should be used to determine the order in which a and b are displayed in graphical user interfces.

The comparison algorithm first of all peeks the device type of a and b, they will be sorted in the following order:

Magnetic and opto-magnetic drives (ZIP, floppy)

Optical drives (CD, DVD)

External drives (USB sticks, music players)

Mounted hard disks<

Other drives<

Afterwards, the display name of a and b is compared using a locale-sensitive sorting algorithm, which involves g-utf8-collate-key.

If two drives have the same display name, their unique ID is compared which can be queried using gnome-vfs-drive-get-id.

a
a <gnome-vfs-drive>.
b
a <gnome-vfs-drive>.
ret
0 if the drives refer to the same gnome-vfs-drive, a negative value if a should be displayed before b, or a positive value if a should be displayed after b.

Since 2.6

— Function: gnome-vfs-drive-get-activation-uri (self <gnome-vfs-drive>) ⇒  (ret mchars)
— Method: get-activation-uri

Returns the activation URI of a <gnome-vfs-drive>.

The returned URI usually refers to a valid location. You can check the validity of the location by calling gnome-vfs-uri-new with the URI, and checking whether the return value is not ‘#f’.

drive
a <gnome-vfs-drive>.
ret
a newly allocated string for the activation uri of the <drive>.

Since 2.6

— Function: gnome-vfs-drive-get-device-path (self <gnome-vfs-drive>) ⇒  (ret mchars)
— Method: get-device-path

Returns the device path of a <gnome-vfs-drive>.

For HAL drives, this returns the value of the drives's "block.device" key. For UNIX mounts, it returns the ‘mntent’'s ‘mnt_fsname’ entry.

Otherwise, it returns ‘#f’.

drive
a <gnome-vfs-drive>.
ret
a newly allocated string for the device path of the <drive>.

Since 2.6

— Function: gnome-vfs-drive-get-device-type (self <gnome-vfs-drive>) ⇒  (ret <gnome-vfs-device-type>)
— Method: get-device-type
drive
a <gnome-vfs-drive>.
ret
device type, a <gnome-vfs-device-type> value.

Since 2.6

— Function: gnome-vfs-drive-get-display-name (self <gnome-vfs-drive>) ⇒  (ret mchars)
— Method: get-display-name
drive
a <gnome-vfs-drive>.
ret
a newly allocated string for the display name of the drive.

Since 2.6

— Function: gnome-vfs-drive-get-hal-udi (self <gnome-vfs-drive>) ⇒  (ret mchars)
— Method: get-hal-udi

Returns the HAL UDI of a <gnome-vfs-drive>.

For HAL drives, this matches the value of the "info.udi" key, for other drives it is ‘#f’.

drive
a <gnome-vfs-drive>.
ret
a newly allocated string for the unique device id of the drive, or ‘#f’.

Since 2.6

— Function: gnome-vfs-drive-get-icon (self <gnome-vfs-drive>) ⇒  (ret mchars)
— Method: get-icon
drive
a <gnome-vfs-drive>.
ret
a newly allocated string for the icon filename of the drive.

Since 2.6

— Function: gnome-vfs-drive-get-id (self <gnome-vfs-drive>) ⇒  (ret unsigned-long)
— Method: get-id
drive
a <gnome-vfs-drive>.
ret
drive id, a <gulong> value.

Since 2.6

— Function: gnome-vfs-drive-get-mounted-volumes (self <gnome-vfs-drive>) ⇒  (ret glist-of)
— Method: get-mounted-volumes
drive
a <gnome-vfs-drive>.
ret
list of mounted volumes for the drive.

Since 2.8

— Function: gnome-vfs-drive-is-connected (self <gnome-vfs-drive>) ⇒  (ret bool)
— Method: is-connected
drive
a <gnome-vfs-drive>.
ret
#t’ if the drive is connected, ‘#f’ otherwise.

Since 2.6

— Function: gnome-vfs-drive-is-mounted (self <gnome-vfs-drive>) ⇒  (ret bool)
— Method: is-mounted
drive
a <gnome-vfs-drive>.
ret
#t’ if the drive is mounted, ‘#f’ otherwise.

Since 2.6

— Function: gnome-vfs-drive-is-user-visible (self <gnome-vfs-drive>) ⇒  (ret bool)
— Method: is-user-visible

Returns whether the drive is visible to the user. This should be used by applications to determine whether it is included in user interfaces listing available drives.

drive
a <gnome-vfs-drive>.
ret
#t’ if the drive is visible to the user, ‘#f’ otherwise.

Since 2.6