Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Document Storage

Storage.conf

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.

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
ThumbnailsIndicates that thumbnails of files on the mount should also be stored on the mount.

If true a value for ThumbnailsPath should also be given.

boolean1
ThumbnailsPathSpecifies 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

HOME

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

PREFIX

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.

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 key 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
ThumbnailsDefaultSpecifies the group key of the mount point to which thumbnail data is saved by default.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 Qt Extended updates are installed to:

ParameterPurposeValue TypeExample
MountPointSpecifies the group key of the mount point Qt Extended updates are installed to.stringHOME
PathIndicates the path of the directory Qt Extended 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 Qt Extended packages are installed to.stringHOME
PathIndicates the path of the directory Qt Extended 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 Qt Extended library receives one of the following messages via the QPE/Card QCop channel:

  • mtabChanged() - sent when /etc/mtab has changed
  • stabChanged() - sent when /var/run/stab, /var/state/pcmcia/stab, or /var/lib/pcmcia/stab have changed. The StabMonitor server task provides a default implementation.

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.

Explicit Mount/Unmount Notifications

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

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

  • compressed read-only file systems such as cramfs and squashfs have better compression than read-write file systems such as jffs2
  • read-only file systems provide a measure of protection for system files.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web