Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded

FileSystemOperator Class Reference

The FileSystemOperator class transfers files to and from the PDA using ftp and manages the file hierachy on the desktop and the PDA. More...

#include <common/filesystemoperator.h>

List of all member functions.

Public Members

Public Slots

Signals

Static Public Members


Detailed Description

The FileSystemOperator class transfers files to and from the PDA using ftp and manages the file hierachy on the desktop and the PDA.

The FileMananger class is the main communication class to talk to the remote PDA. The FileSystemOperator class allows for transfering settings files, application files, and user files.

Settings files are probably stored in an rc file. One settings file may be shared by many applications. For example, there may be one settings file that contains PDA specific information such as the local time zone, language, and display options.

To do: Docs about app files...

To do: Docs about user data files...

The FileSystemOperator class provides send, retrieve, remove and list methods for settings, application data, and user data. The send methods send data from the local computer to the remote computer (eg. from desktop to PDA). The retrieve methods retrieve a file from the PDA and place it in the appropriate local directory. The remove methods removes the files on both the local and remote file systems. The list methods provide a listing on the remote file systems.

The FileSystemOperator class verifies the locally directory exists before retrieving files from the remote machine and that remote directories exist beforing sending files. Since remote directory trees may need to be created on the remote machine, there may need to be several mkdir operations before actually copying the local file to the remote directory. To know when the send copy commands are actually started and to connect with the associated QNetworkOperation, connect to the startSend signal.

The FileSystemOperator class uses the QUrlOperator to actually perform the ftp copy, remove, and file listing commands. The caller of the class can connect to the QUrlOperator signals for feedback of each call.

The FileSystemOperator class places the files in their appropriate directories on both the PDA and the local side. If the directories don't exist on either side, then the directories are created.

See also Qtopia Desktop Classes.


Member Function Documentation

FileSystemOperator::FileSystemOperator ( PalmtopConnection * con )

Constructs a FileSystemOperator object using PalmtopConnection con

bool FileSystemOperator::copyLocalFile ( const QString & source, const QStringList & destFilenames ) [static]

Copy local file source to destination files destFilenames.

QString FileSystemOperator::dirPath ( const QString & filePath ) [static]

Returns the directory path of the absolute file path filePath.

void FileSystemOperator::done ( int totalNumBytes ) [signal]

This signal is emitted when the transfer currently processed by the FileSystemOperator is completed. totalNumBytes is the total number of bytes transfered.

bool FileSystemOperator::ensureLocalPath ( const QString & localPath ) [static]

Ensures that localPath exists. If doesn't exist, tries to create it. Returns true if path exists.

void FileSystemOperator::errorExecuting ( TransferReceipt * r ) [signal]

This signal is emitted when an error occurred while processing a transfer operation. r is a pointer to the TransferReceipt associated with this transfer.

void FileSystemOperator::executing ( TransferReceipt * r ) [signal]

This signal is emitted when the FileSystemOperator starts to process a scheduled transfer. r is a pointer to the TransferReceipt associated with this transfer.

QString FileSystemOperator::fileBase ( const QString & filePath ) [static]

Returns the base file name (no extension) of the absolut file path filePath.

void FileSystemOperator::handshakeDone ( bool locked ) [signal]

This signal is emitted when the FileSystemOperator was successfull doing a handshake operation with the Qtopia device. locked is TRUE if the device is locked by another connection.

bool FileSystemOperator::isExecuting () const

Returns TRUE if the FileSystemOperator is currently processing a send/retrieve or list command.

QGuardedPtr<TransferReceipt> FileSystemOperator::list ( const QString & path )

Retrieve a directory listing of directory path.

QGuardedPtr<TransferReceipt> FileSystemOperator::listAppData ( const QString & app )

Retrieve a directory listing of the application app data directory on the Qtopia device.

QGuardedPtr<TransferReceipt> FileSystemOperator::listDocuments ( const QString & docRoot, const QString & mime )

Retrieve a directory listing of the directory holding documents of mimetype mime in the document base directory docRoot from the Qtopia device.

QGuardedPtr<TransferReceipt> FileSystemOperator::listSettings ()

Retrieve a directory listing of the settings directory on the Qtopia device.

QString FileSystemOperator::localBackupPath () [static]

Returns the Qtopia Desktop "Backup" path (usually a subdirectory of localCenterPath())

const QString & FileSystemOperator::localCenterPath () [static]

Returns the Qtopia Desktop data path (usually in the users home directory).

QString FileSystemOperator::localDocsPath ( const QString & mimetype ) const

Returns a the Qtopia Desktop path for documents of Mimetype mimetype.

QString FileSystemOperator::localDocsRoot () const

Returns the Qtopia Desktop "Documents" path (usually localCenterPath() + "/Documents". Documents that appear in the "document view" com ponent are stored here.

void FileSystemOperator::newTotalBytes ( int newTotal ) [signal]

This signal is emitted when the total bytes expected changes to newTotal.

void FileSystemOperator::pdaMessage ( const QString & call, const QByteArray & params ) [signal]

This signal is emitted when a QCop message from the Qtopia device arrives. call is the method called, params a QByteArray of argument data.

void FileSystemOperator::pdaVersionReceived ( int major, int minor, const QString & arch ) [signal]

This signal is emitted when the FileSystemOperator was successfull retrieving the Qtopia version of the Qtopia device. major is the major while minor is the minor Qtopia version number. arch is an identifier for the device.

void FileSystemOperator::progress ( int bytesDone ) [signal]

This signal is emitted when the progress of the transfer currently beeing processed by the FileSystemOperator changes. bytesDone is the number of bytes transfered.

void FileSystemOperator::progressUpdate ( int numBytesDone, int totalNumBytes, TransferReceipt * receipt ) [signal]

This signal is emitted when the progress of a transfer changes. numBytesDone is the number of bytes transfered, totalNumBytes the total number of bytes to transfer. receipt is a pointer to the TransferReceipt associated with this transfer.

QString FileSystemOperator::remoteAppPath ( const QString & app ) const

Returns the path on the Qtopia device used by Qtopia application app to store application data.

QString FileSystemOperator::remoteAppRoot () const

Returns the path on the Qtopia device used to store application data.

QString FileSystemOperator::remoteDocURI ( const QString & remoteFileName ) const

Returns a URI ("ftp://...") referring to remoteFileName on the device."

QString FileSystemOperator::remoteDocsPath ( const QString & mimeType ) const

Returns the path used by Qtopia to store documents of the Mimetype mimeType on the Qtopia device.

QString FileSystemOperator::remoteDocsRoot () const

Returns the path used to store documents on the Qtopia device.

QString FileSystemOperator::remoteSettingsPath () const

Returns the path used by Qtopia applications to store settings on Qtopia devices.

QGuardedPtr<TransferReceipt> FileSystemOperator::removeAppData ( const QString & app, const QString & filename )

Removes the application app data and the settings file filename on the PDA and the desktop.

QPtrList<TransferReceipt> FileSystemOperator::removeDocument ( QdDocLnk & lnk )

Remove both the .desktop file and document file for a given document link file lnk from the Qtopia device.

TransferReceipt * FileSystemOperator::removeDocument ( const QString & docsRoot, const QString & fname, const QString & mime )

Remove the document file fname form path docsRoot and of mimetype mime from the Qtopia device.

QGuardedPtr<TransferReceipt> FileSystemOperator::removeSetting ( const QString & filename )

Remove file filename from the settings directory on the Qtopia device.

QGuardedPtr<TransferReceipt> FileSystemOperator::retrieveAppData ( const QString & app, const QString & filename, uint size = 100, bool remoteChangesFile = TRUE )

Retrive application app file filename of size size from the Qtopia device.

size and remoteChangesFile are internal.

TransferReceipt * FileSystemOperator::retrieveDocument ( const QString & docRoot, const QString & filename, const QString & mimeType, uint size = 1024, QString destDir = QString::null )

Retrieve document file filename of mimetype mimeType of size size in document base directory docRoot from the Qtopia device and store it in local directory destDir.

QGuardedPtr<TransferReceipt> FileSystemOperator::retrieveOther ( const QString & remoteFile, const QString & localFile, uint size = 1024 )

Retrieve the file remoteFile (absolute file path) from the Qtopia device and store it in the local file localFile (absolute file path). The size argument is used to display progress information. You can retrieve size information a priori by doing a directory listing.

QGuardedPtr<TransferReceipt> FileSystemOperator::retrieveSetting ( const QString & filename, uint size = 100, bool remoteChangesFile = TRUE )

Retrieve settings file filename of size size from the Qtopia device.

size and remoteChangesFile are internal.

QGuardedPtr<TransferReceipt> FileSystemOperator::sendAppData ( const QString & app, const QString & filename )

Copy local application app data file filename to the appropriate application data folder on the Qtopia device.

QGuardedPtr<TransferReceipt> FileSystemOperator::sendAppData ( const QString & app, const QString & localFile, const QString & filename )

Copy local application app data file localFile (absolute file path) to file filename in the appropriate application data folder on the Qtopia device.

TransferReceipt * FileSystemOperator::sendDocument ( const QdDocLnk & lnk, bool link )

Copy the local file pointed to by lnk to the Qtopia device. If link is TRUE, then it only sends the QdDocLnk file itself. If FALSE then it copyies the file pointed to by the link

QGuardedPtr<TransferReceipt> FileSystemOperator::sendOther ( const QString & localFile, const QString & remoteFile )

Copy local file localFile (absolute file path) to file remoteFile (absolute file path) on the Qtopia device.

QGuardedPtr<TransferReceipt> FileSystemOperator::sendSetting ( const QString & filename )

Copy local settings file filename to the appropriate folder for settings files on the Qtopia device.

QGuardedPtr<TransferReceipt> FileSystemOperator::sendSetting ( const QString & localFile, const QString & filename )

Copy local file localFile (absolute path) to file \filename in the appropriate folder for settings files folder on the Qtopia device.

void FileSystemOperator::setConnectionEnabled ( bool v ) [slot]

Sets if a connection is possible to v. This should be set to TRUE once a physical PPP connection is established.

void FileSystemOperator::start ( int totalNumBytes ) [signal]

This signal is emitted when the FileSystemOperator starts to process a scheduled transfer of totalNumBytes bytes.

void FileSystemOperator::stop () [virtual]

Stop all pending file transfers and directory listings.

QString FileSystemOperator::stripPath ( const QString & filePath ) [static]

Returns the filename of the absolute file path filePath.

void FileSystemOperator::successExecuting ( TransferReceipt * r ) [signal]

This signal is emitted when a scheduled transfer has successfully been completed. r is a pointer to the TransferReceipt associated with this transfer.

QString FileSystemOperator::tempPath () [static]

Returns a path used to store temporary files.


This file is part of the Qtopia platform, copyright © 1995-2005 Trolltech, all rights reserved.


Copyright © 2005 Trolltech Trademarks
Qtopia version 2.1.2