-rw-r--r-- | library/storage.cpp | 60 | ||||
-rw-r--r-- | library/storage.h | 4 |
2 files changed, 0 insertions, 64 deletions
diff --git a/library/storage.cpp b/library/storage.cpp index 657fb71..d98139b 100644 --- a/library/storage.cpp +++ b/library/storage.cpp | |||
@@ -305,84 +305,24 @@ bool StorageInfo::hasSd() | |||
305 | * | 305 | * |
306 | */ | 306 | */ |
307 | bool StorageInfo::hasMmc() | 307 | bool StorageInfo::hasMmc() |
308 | { | 308 | { |
309 | bool hasMmc=false; | 309 | bool hasMmc=false; |
310 | if( deviceTab("/dev/mmc/part")) | 310 | if( deviceTab("/dev/mmc/part")) |
311 | hasMmc=true; | 311 | hasMmc=true; |
312 | if( deviceTab("/dev/mmcd")) | 312 | if( deviceTab("/dev/mmcd")) |
313 | hasMmc=true; | 313 | hasMmc=true; |
314 | return hasMmc; | 314 | return hasMmc; |
315 | } | 315 | } |
316 | 316 | ||
317 | /*! | ||
318 | * @fn QString StorageInfo::getCfPath() | ||
319 | * @brief returns the Mount-Path of Cf Card | ||
320 | * | ||
321 | */ | ||
322 | QString StorageInfo::getCfPath() | ||
323 | { | ||
324 | QString r = ""; | ||
325 | |||
326 | for (QListIterator<FileSystem> i(mFileSystems); i.current(); ++i) | ||
327 | { | ||
328 | if ( (*i)->disk().left( 8 ) == "/dev/hda" ) | ||
329 | { | ||
330 | r = (*i)->path(); | ||
331 | break; | ||
332 | } | ||
333 | } | ||
334 | return r; | ||
335 | } | ||
336 | |||
337 | /*! | ||
338 | * @fn QString StorageInfo::getSdPath() | ||
339 | * @brief returns the Mount-Path of Sd Card | ||
340 | * | ||
341 | */ | ||
342 | QString StorageInfo::getSdPath() | ||
343 | { | ||
344 | QString r = ""; | ||
345 | |||
346 | for (QListIterator<FileSystem> i(mFileSystems); i.current(); ++i) | ||
347 | { | ||
348 | if ( (*i)->disk().left( 9 ) == "/dev/mmcd" ) | ||
349 | { | ||
350 | r = (*i)->path(); | ||
351 | break; | ||
352 | } | ||
353 | } | ||
354 | return r; | ||
355 | } | ||
356 | |||
357 | /*! | ||
358 | * @fn QString StorageInfo::getMmcPath() | ||
359 | * @brief returns the Mount-Path of Mmc Card | ||
360 | * | ||
361 | */ | ||
362 | QString StorageInfo::getMmcPath() | ||
363 | { | ||
364 | QString r = ""; | ||
365 | |||
366 | for (QListIterator<FileSystem> i(mFileSystems); i.current(); ++i) | ||
367 | { | ||
368 | if ( (*i)->disk().left( 14 ) == "/dev/mmc/part1" ) | ||
369 | { | ||
370 | r = (*i)->path(); | ||
371 | break; | ||
372 | } | ||
373 | } | ||
374 | return r; | ||
375 | } | ||
376 | |||
377 | /*! \fn const QList<FileSystem> &StorageInfo::fileSystems() const | 317 | /*! \fn const QList<FileSystem> &StorageInfo::fileSystems() const |
378 | Returns a list of all available mounted file systems. | 318 | Returns a list of all available mounted file systems. |
379 | 319 | ||
380 | \warning This may change in Qtopia 3.x to return only relevant Qtopia file systems (and ignore mount points such as /tmp) | 320 | \warning This may change in Qtopia 3.x to return only relevant Qtopia file systems (and ignore mount points such as /tmp) |
381 | */ | 321 | */ |
382 | 322 | ||
383 | /*! \fn void StorageInfo::disksChanged() | 323 | /*! \fn void StorageInfo::disksChanged() |
384 | Gets emitted when a disk has been mounted or unmounted, such as when | 324 | Gets emitted when a disk has been mounted or unmounted, such as when |
385 | a CF c | 325 | a CF c |
386 | */ | 326 | */ |
387 | //--------------------------------------------------------------------------- | 327 | //--------------------------------------------------------------------------- |
388 | 328 | ||
diff --git a/library/storage.h b/library/storage.h index 35a1109..4c29288 100644 --- a/library/storage.h +++ b/library/storage.h | |||
@@ -28,28 +28,24 @@ class QCopChannel; | |||
28 | 28 | ||
29 | class StorageInfo : public QObject | 29 | class StorageInfo : public QObject |
30 | { | 30 | { |
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | public: | 32 | public: |
33 | StorageInfo( QObject *parent=0 ); | 33 | StorageInfo( QObject *parent=0 ); |
34 | 34 | ||
35 | const QList<FileSystem> &fileSystems() const { return mFileSystems; } | 35 | const QList<FileSystem> &fileSystems() const { return mFileSystems; } |
36 | const FileSystem *fileSystemOf( const QString &filename ); | 36 | const FileSystem *fileSystemOf( const QString &filename ); |
37 | static bool hasCf(); | 37 | static bool hasCf(); |
38 | static bool hasSd(); | 38 | static bool hasSd(); |
39 | static bool hasMmc(); | 39 | static bool hasMmc(); |
40 | |||
41 | QString getCfPath(); | ||
42 | QString getSdPath(); | ||
43 | QString getMmcPath(); | ||
44 | signals: | 40 | signals: |
45 | void disksChanged(); | 41 | void disksChanged(); |
46 | 42 | ||
47 | public slots: | 43 | public slots: |
48 | void update(); | 44 | void update(); |
49 | 45 | ||
50 | private slots: | 46 | private slots: |
51 | void cardMessage( const QCString& msg, const QByteArray& data ); | 47 | void cardMessage( const QCString& msg, const QByteArray& data ); |
52 | private: | 48 | private: |
53 | QList<FileSystem> mFileSystems; | 49 | QList<FileSystem> mFileSystems; |
54 | QCopChannel *channel; | 50 | QCopChannel *channel; |
55 | }; | 51 | }; |