Home · All Classes · Grouped Classes · Annotated · Functions

Document Storage

Storage.conf

The Storage.conf configuration file defines the organization of storage devices in a Qtopia 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 Qtopia 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: <qtopia-root-dir>/devices/greenphone/Storage.conf.

Mount Point Groups

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:

ParameterPurposeValue TypeExample
ApplicationsIndicates if the mount can contain applications.

See QFileSystem::applications().

boolean1
ApplicationsPathSpecifies the sub-directory of the mount in which application data is stored.

See QFileSystem::applicationsPath().

string/Applications
ContentDatabaseIndicates 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().

boolean1
DocumentsIndicates if the mount can contain user documents.

See QFileSystem::documents().

boolean1
DocumentsPathSpecifies the sub-directory of the mount in which user documents are stored.

See QFileSystem::documentsPath().

string/Documents
OptionsSpecifies 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().

stringrw
Name[]The translatable name shown to the user.

See QFileSystem::name().

stringMyDocuments
PathSpecifies 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
RemovableIndicates if the mount is removable.

See QFileSystem::isRemovable().

boolean1

Example: Mount point group for an SD Card

    [MountPoint1]
    Name[] = SD Card
    Path=/dev/mmca
    Removable = 1
    Applications = 0
    Documents = 1
    ContentDatabase = 1

HOME

The HOME group is a special case mount path which holds the settings for the Qtopia 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

PREFIX

The PREFIX is another special case mount path, which holds the settings for the directory Qtopia 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.

Non Mount Point Groups

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.

MountTable

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:

ParameterPurposeValue TypeExample
ApplicationsDefaultSpecifies the group keys of the mount point to which application data is saved by default.

See QFileSystem::applicationsFileSystem(), and Qtopia::applicationFileName().

stringHOME
DocumentsDefaultSpecifies the group key of the mount point to which documents are saved by default.

See QFileSystem::documentsFileSystem().

stringHOME
MountPointsLists the group keys of the mount points the Storage.conf has definitions for. The HOME and PREFIX groups are not included in this list.stringMountPoint0, MountPont1

Example: MountTable group for device with two storage devices, one the default documents location.

    [MountTable]
    MountPoints="MountPoint0,MountPoint1"
    DocumentsDefault=MountPoint0
    ApplicationsDefault=HOME

Updates

The Updates group specifies where Qtopia updates are installed to:

ParameterPurposeValue TypeExample
MountPointSpecifies the group key of the mount point Qtopia updates are installed to.stringHOME
PathIndicates the path of the directory Qtopia updates are installed to relative to the mount point.stringUpdates

Example: Updates installed to the Updates sub-directory of the HOME mount.

    [Updates]
    MountPoint=HOME
    Path=Updates

Packages

The Packages group specifies where downloaded packages are installed to:

ParameterPurposeValue TypeExample
MountPointSpecifies the group key of the mount point Qtopia packages are installed to.stringHOME
PathIndicates the path of the directory Qtopia packages are installed to relative to the mount point.stringPackages

Example: Packages installed to the Packages sub-directory of the HOME mount.

    [Packages]
    MountPoint=HOME
    Path=Packages

SxeDatabase

The SxeDatabase group specifies the directory in which the SXE database is located.

ParameterPurposeValue TypeExample
PathIndicates 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

Non-removable vs Removable Storage

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 Qtopia 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 Qtopia to release file resources; see also the umount man page.

Explicit Mount/Unmount Notifications

If monitoring mtab/stab or lazy unmounting in unsuitable, Qtopia 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 Qtopia that a storage device has been mounted, the QString argument is the device path of the storage device mounted. In response to this Qtopia 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 Qtopia 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 Qtopia 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

Using read-only file systems have a number of benefits:


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3