-rw-r--r-- | library/storage.cpp | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/library/storage.cpp b/library/storage.cpp index 4e07ec6..1ce43bc 100644 --- a/library/storage.cpp +++ b/library/storage.cpp | |||
@@ -67,4 +67,19 @@ static bool isCF(const QString& m) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | /*! \class StorageInfo storage.h | ||
70 | \brief The StorageInfo class describes the disks mounted on the file system. | ||
71 | |||
72 | This class provides access to the mount information for the Linux | ||
73 | filesystem. Each mount point is represented by the FileSystem class. | ||
74 | To ensure this class has the most up to date size information, call | ||
75 | the update() method. Note that this will automatically be signaled | ||
76 | by the operating system when a disk has been mounted or unmounted. | ||
77 | |||
78 | \ingroup qtopiaemb | ||
79 | */ | ||
80 | |||
81 | /*! Constructor that determines the current mount points of the filesystem. | ||
82 | The standard \a parent parameters is passed on to QObject. | ||
83 | */ | ||
69 | StorageInfo::StorageInfo( QObject *parent ) | 84 | StorageInfo::StorageInfo( QObject *parent ) |
70 | : QObject( parent ) | 85 | : QObject( parent ) |
@@ -77,4 +92,7 @@ StorageInfo::StorageInfo( QObject *parent ) | |||
77 | } | 92 | } |
78 | 93 | ||
94 | /*! Returns the longest matching FileSystem that starts with the | ||
95 | same prefix as \a filename as its mount point. | ||
96 | */ | ||
79 | const FileSystem *StorageInfo::fileSystemOf( const QString &filename ) | 97 | const FileSystem *StorageInfo::fileSystemOf( const QString &filename ) |
80 | { | 98 | { |
@@ -92,4 +110,10 @@ void StorageInfo::cardMessage( const QCString& msg, const QByteArray& ) | |||
92 | update(); | 110 | update(); |
93 | } | 111 | } |
112 | |||
113 | |||
114 | /*! Updates the mount and free space available information for each mount | ||
115 | point. This method is automatically called when a disk is mounted or | ||
116 | unmounted. | ||
117 | */ | ||
94 | // cause of the lack of a d pointer we need | 118 | // cause of the lack of a d pointer we need |
95 | // to store informations in a config file :( | 119 | // to store informations in a config file :( |
@@ -235,5 +259,14 @@ bool StorageInfo::hasMmc() | |||
235 | } | 259 | } |
236 | 260 | ||
261 | /*! \fn const QList<FileSystem> &StorageInfo::fileSystems() const | ||
262 | Returns a list of all available mounted file systems. | ||
237 | 263 | ||
264 | \warning This may change in Qtopia 3.x to return only relevant Qtopia file systems (and ignore mount points such as /tmp) | ||
265 | */ | ||
266 | |||
267 | /*! \fn void StorageInfo::disksChanged() | ||
268 | Gets emitted when a disk has been mounted or unmounted, such as when | ||
269 | a CF c | ||
270 | */ | ||
238 | //--------------------------------------------------------------------------- | 271 | //--------------------------------------------------------------------------- |
239 | 272 | ||
@@ -260,2 +293,54 @@ void FileSystem::update() | |||
260 | } | 293 | } |
261 | 294 | ||
295 | /*! \class FileSystem storage.h | ||
296 | \brief The FileSystem class describes a single mount point. | ||
297 | |||
298 | This class simply returns information about a mount point, including | ||
299 | file system name, mount point, human readable name, size information | ||
300 | and mount options information. | ||
301 | \ingroup qtopiaemb | ||
302 | |||
303 | \sa StorageInfo | ||
304 | */ | ||
305 | |||
306 | /*! \fn const QString &FileSystem::disk() const | ||
307 | Returns the file system name, such as /dev/hda3 | ||
308 | */ | ||
309 | |||
310 | /*! \fn const QString &FileSystem::path() const | ||
311 | Returns the mount path, such as /home | ||
312 | */ | ||
313 | |||
314 | /*! \fn const QString &FileSystem::name() const | ||
315 | Returns the translated, human readable name for the mount directory. | ||
316 | */ | ||
317 | |||
318 | /*! \fn const QString &FileSystem::options() const | ||
319 | Returns the mount options | ||
320 | */ | ||
321 | |||
322 | /*! \fn long FileSystem::blockSize() const | ||
323 | Returns the size of each block on the file system. | ||
324 | */ | ||
325 | |||
326 | /*! \fn long FileSystem::totalBlocks() const | ||
327 | Returns the total number of blocks on the file system | ||
328 | */ | ||
329 | |||
330 | /*! \fn long FileSystem::availBlocks() const | ||
331 | Returns the number of available blocks on the file system | ||
332 | */ | ||
333 | |||
334 | /*! \fn bool FileSystem::isRemovable() const | ||
335 | Returns flag whether the file system can be removed, such as a CF card | ||
336 | would be removable, but the internal memory wouldn't | ||
337 | */ | ||
338 | |||
339 | /*! \fn bool FileSystem::isWritable() const | ||
340 | Returns flag whether the file system is mounted as writable or read-only. | ||
341 | Returns FALSE if read-only, TRUE if read and write. | ||
342 | */ | ||
343 | |||
344 | /*! \fn QStringList StorageInfo::fileSystemNames() const | ||
345 | Returns a list of filesystem names. | ||
346 | */ | ||