KMountPoint::List Class

class KMountPoint::List

Public Functions

KMountPoint::Ptr findByDevice(const QString &device) const
(since 6.24) KMountPoint::Ptr findByMountId(quint64 mountId) const
KMountPoint::Ptr findByPath(const QString &path) const

Detailed Description

List of mount points.

Member Function Documentation

KMountPoint::Ptr List::findByDevice(const QString &device) const

Returns the mount point associated with device, i.e. the one where mountedFrom() == device (after symlink resolution).

Returns the mountpoint, or nullptr if this device doesn't exist or isn't mounted

[since 6.24] KMountPoint::Ptr List::findByMountId(quint64 mountId) const

Returns the mount point associated with mountId

Returns the mountpoint, or nullptr if there is no mount point associated with this ID.

This is prefered over looking up a path because it does not have to deal with symlinks.

Note: This is only supported on Linux and returns nullptr for all other platforms

Warning: mountId must not be zero

This function was introduced in 6.24.

KMountPoint::Ptr List::findByPath(const QString &path) const

Find the mountpoint on which resides path For instance if /home is a separate partition, findByPath("/home/user/blah") will return /home

path the path to check

Returns the mount point of the given file