QtMobility Reference Documentation

Contents

QSystemStorageInfo Class Reference

The QSystemStorageInfo class provides access to disk storage information from the system. More...

 #include <QSystemStorageInfo>

Inherits QObject.

This class was introduced in Qt Mobility 1.1.

Public Types

enum DriveType { NoDrive, InternalDrive, RemovableDrive, RemoteDrive, ..., RamDrive }
enum StorageState { UnknownStorageState, NormalStorageState, LowStorageState, VeryLowStorageState, CriticalStorageState }

Properties

Public Functions

QSystemStorageInfo ( QObject * parent = 0 )
~QSystemStorageInfo ()
qlonglong availableDiskSpace ( const QString & volumeDrive )
QSystemStorageInfo::StorageState getStorageState ( const QString & driveVolume )
qlonglong totalDiskSpace ( const QString & volumeDrive )
QSystemStorageInfo::DriveType typeForDrive ( const QString & driveVolume )
QString uriForDrive ( const QString & driveVolume )

Signals

void logicalDriveChanged ( bool added, const QString & vol )
void storageStateChanged ( const QString & vol, QSystemStorageInfo::StorageState state )

Static Public Members

QStringList logicalDrives ()

Additional Inherited Members

Detailed Description

The QSystemStorageInfo class provides access to disk storage information from the system.

Member Type Documentation

enum QSystemStorageInfo::DriveType

This enum describes the type of drive or volume

ConstantValueDescription
QSystemStorageInfo::NoDrive0Drive type undetermined.
QSystemStorageInfo::InternalDrive1Is internal mass storage drive like a hard drive.
QSystemStorageInfo::RemovableDrive2Is a removable disk like MMC.
QSystemStorageInfo::RemoteDrive3Is a network drive.
QSystemStorageInfo::CdromDrive4Is a cd rom drive.
QSystemStorageInfo::InternalFlashDrive5Is an internal flash disk, or Phone Memory.
QSystemStorageInfo::RamDrive6Is a virtual drive made in RAM memory.

enum QSystemStorageInfo::StorageState

This enum describes the state of the storage level of drive or volume.

ConstantValueDescription
QSystemStorageInfo::UnknownStorageState0Storage level indicates an error, offline or unknown.
QSystemStorageInfo::NormalStorageState1Storage level indicates normal.
QSystemStorageInfo::LowStorageState2Storage level indicates below 40%.
QSystemStorageInfo::VeryLowStorageState3Storage level indicates below 10%.
QSystemStorageInfo::CriticalStorageState4Storage level indicates below 2%.

Property Documentation

logicalDrives : const QStringList

This property holds the logical drives.

Returns a QStringList of volumes or partitions, or an empty list if no drives are found.

Access functions:

QStringList logicalDrives ()

Notifier signal:

void logicalDriveChanged ( bool added, const QString & vol )

Member Function Documentation

QSystemStorageInfo::QSystemStorageInfo ( QObject * parent = 0 )

Constructs a QSystemStorageInfo with the given parent.

QSystemStorageInfo::~QSystemStorageInfo ()

Destroys the QSystemStorageInfo object.

qlonglong QSystemStorageInfo::availableDiskSpace ( const QString & volumeDrive )

Returns the amount of available free space on the volumeDrive, in bytes.

QSystemStorageInfo::StorageState QSystemStorageInfo::getStorageState ( const QString & driveVolume )

Returns the storage state of volume driveVolume

void QSystemStorageInfo::logicalDriveChanged ( bool added, const QString & vol ) [signal]

This signal gets emitted when new storage has been added or removed from the system. added is true when a new drive is found, otherwise false when removed. vol is the volume's name.

void QSystemStorageInfo::storageStateChanged ( const QString & vol, QSystemStorageInfo::StorageState state ) [signal]

This signal gets emitted when a volume has changed from one StorageState to another, vol being the volume name, and state being the new state.

The polling time may be different for different platforms.

qlonglong QSystemStorageInfo::totalDiskSpace ( const QString & volumeDrive )

Returns the amount of total space on the volumeDrive, in bytes.

QSystemStorageInfo::DriveType QSystemStorageInfo::typeForDrive ( const QString & driveVolume )

Returns the type of volume driveVolume

QString QSystemStorageInfo::uriForDrive ( const QString & driveVolume )

Returns the uri, or unique identifier for driveVolume.