Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The Storage.conf configuration file defines the organization of storage devices in a Qt Extended installation. Storage.conf maps devices to human-readable names, and defines whether they are removable, read-only, and what type of data they may store and where. It also defines which devices packages and Qt Extended updates are installed to.
The information stored in the Storage.conf can be accessed at run-time using the QStorageMetaInfo and QFileSystem classes, and the QStorageDeviceSelector widget provides a user interface for selecting storage devices defined in the Storage.conf.
An example Storage.conf is available at: <qt-extended-root-dir>/devices/greenphone/Storage.conf.
The configuration for each storage device is defined in a separate settings group in the Storage.conf. Any group key may be used for a mount point provided it's not a reserved group names, but they typically take the form of MountPointX where X is an integer (MountPoint0,MountPoint1).
The parameters defined for a mount point group are:
Parameter | Purpose | Value Type | Example |
---|---|---|---|
Applications | Indicates if the mount can contain applications. See QFileSystem::applications(). | boolean | 1 |
ApplicationsPath | Specifies the sub-directory of the mount in which application data is stored. | string | /Applications |
ContentDatabase | Indicates whether the mount has its own content database. If a mount does not have its own database the system database will be used for content on the mount. See QFileSystem::contentDatabase(). | boolean | 1 |
Documents | Indicates if the mount can contain user documents. See QFileSystem::documents(). | boolean | 1 |
DocumentsPath | Specifies the sub-directory of the mount in which user documents are stored. See QFileSystem::documentsPath(). | string | /Documents |
Options | Specifies mount options to use instead of those in /proc/mounts. A device's Options may need to be overwritten if they don't include rw but are writable or if they are overly complex. For example, SMB mounts on a machine have Options of 0. See QFileSystem::options(). | string | rw |
Name[] | The translatable name shown to the user. See QFileSystem::name(). | string | MyDocuments |
Path | Specifies the device path of the mount. This may be any path that appears in the first column of /proc/mounts. See QFileSystem::disk(). | string | /dev/mmca1 |
Removable | Indicates if the mount is removable. See QFileSystem::isRemovable(). | boolean | 1 |
Thumbnails | Indicates that thumbnails of files on the mount should also be stored on the mount. If true a value for ThumbnailsPath should also be given. | boolean | 1 |
ThumbnailsPath | Specifies the sub-directory of the mount in which thumbnails should be stored. | string | /Thumbnails |
Example: Mount point group for an SD Card
[MountPoint1] Name[] = SD Card Path=/dev/mmca Removable = 1 Applications = 0 Documents = 1 ContentDatabase = 1
The HOME group is a special case mount path which holds the settings for the Qt Extended home directory. Unless specified otherwise the HOME mount is assumed to be a valid storage location which may contain both applications and documents. The HOME mount may be explicitly disabled by setting Path = HIDE, otherwise no value of Path is necessary.
Example: HOME mount that contains applications but not documents.
[HOME] Name[] = HOME Path = HOME Applications = 1 Documents = 0
The PREFIX is another special case mount path, which holds the settings for the directory Qt Extended is run from. It is normally not necessary to define anything for the PREFIX mount.
Note: Commercial customers please contact support before using this group.
In addition to the mount point settings groups there are also reserved groups, these either index the storage devices or identify which device should be used as the storage location for a particular set of data.
The MountTable group provides a list of all the device mount points defined in the Storage.conf and identifies which mount points are the default storage locations for application, and document data.
The parameters for the MountTable group are:
Parameter | Purpose | Value Type | Example |
---|---|---|---|
ApplicationsDefault | Specifies the group key of the mount point to which application data is saved by default. See QFileSystem::applicationsFileSystem(), and Qtopia::applicationFileName(). | string | HOME |
DocumentsDefault | Specifies the group key of the mount point to which documents are saved by default. | string | HOME |
ThumbnailsDefault | Specifies the group key of the mount point to which thumbnail data is saved by default. | string | HOME |
MountPoints | Lists the group keys of the mount points the Storage.conf has definitions for. The HOME and PREFIX groups are not included in this list. | string | MountPoint0, MountPont1 |
Example: MountTable group for device with two storage devices, one the default documents location.
[MountTable] MountPoints="MountPoint0,MountPoint1" DocumentsDefault=MountPoint0 ApplicationsDefault=HOME
The Updates group specifies where Qt Extended updates are installed to:
Parameter | Purpose | Value Type | Example |
---|---|---|---|
MountPoint | Specifies the group key of the mount point Qt Extended updates are installed to. | string | HOME |
Path | Indicates the path of the directory Qt Extended updates are installed to relative to the mount point. | string | Updates |
Example: Updates installed to the Updates sub-directory of the HOME mount.
[Updates] MountPoint=HOME Path=Updates
The Packages group specifies where downloaded packages are installed to:
Parameter | Purpose | Value Type | Example |
---|---|---|---|
MountPoint | Specifies the group key of the mount point Qt Extended packages are installed to. | string | HOME |
Path | Indicates the path of the directory Qt Extended packages are installed to relative to the mount point. | string | Packages |
Example: Packages installed to the Packages sub-directory of the HOME mount.
[Packages] MountPoint=HOME Path=Packages
The SxeDatabase group specifies the directory in which the SXE database is located.
Parameter | Purpose | Value Type | Example |
---|---|---|---|
Path | Indicates the absolute path of the directory in which the SXE database is located. | string | /home/Updates/etc/sxe |
Example: SXE database located in /home/Updates/etc/sxe
[SxeDatabase] Path = /home/Updates/etc/sxe
Application data is stored only in non-removable locations, however documents can be stored in any location. Removable locations are scanned on insertion and removal.
The scanning is triggered when the Qt Extended library receives one of the following messages via the QPE/Card QCop channel:
Note: Removable media with a content database must be Lazy unmounted to allow time for Qt Extended to release file resources; see also the umount man page.
If monitoring mtab/stab or lazy unmounting in unsuitable, Qt Extended can also be explicitly informed of a mount or pending unmount. This is done by sending messages to the QPE/QStorage QCop channel.
The mounting(QString) message notifies Qt Extended that a storage device has been mounted, the QString argument is the device path of the storage device mounted. In response to this Qt Extended will add the storage device to the list of connected devices, load it's content database if it has one, and start a document scan.
Example: Sending a notification that the storage device with the device path /dev/mmca has been mounted:
QtopiaChannel::send( "QPE/QStorage", "mounting(QString)", "/dev/mmca" );
The unmounting(QString) message notifies Qt Extended that a storage device is about to be unmounted, the QString argument is the device path of the storage device to be unmounted. In response to this Qt Extended will remove the storage device from the list of connected devices, and close the content database if it has one.
Example: Sending a notification that the storage device with the device path /dev/mmca is about to be unmounted:
QtopiaChannel::send( "QPE/QStorage", "unmounting(QString)", "/dev/mmca" );
Using read-only file systems have a number of benefits:
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |