Permalink
Browse files

Fix flash drives without partition table is not shown.

Remove tricky logic, use IdUsage property instead.
  • Loading branch information...
Mike Limansky Mike Limansky
Mike Limansky authored and Mike Limansky committed May 17, 2012
1 parent c374a2e commit 01ecb02d83075247d671c0cb17bf2be894a71ba8
Showing with 26 additions and 24 deletions.
  1. +5 −0 ChangeLog
  2. +20 −23 src/diskmanager.cpp
  3. +1 −1 src/src.pro
View
@@ -1,4 +1,9 @@
+TinyMount-0.2.5
+---------------
+ - Fix flash drives without partition table is not shown.
+
TinyMount-0.2.4
+---------------
- Add setting to hide the tray icon if there are no connected devices.
TinyMount-0.2.2
View
@@ -120,7 +120,9 @@ DeviceInfoPtr DiskManager::deviceForPath(const QDBusObjectPath &path)
qDebug() << dev.nativePath();
qDebug() << "\tsize =" << dev.deviceSize();
qDebug() << "\tisDrive =" << dev.deviceIsDrive();
+ qDebug() << "\tcanDetach =" << dev.driveCanDetach();
qDebug() << "\tisVolume =" << dev.deviceIsPartition();
+ qDebug() << "\tpartType =" << dev.partitionType();
qDebug() << "\tisParttable =" << dev.deviceIsPartitionTable();
qDebug() << "\tisRemovable =" << dev.deviceIsRemovable();
qDebug() << "\tisMounted =" << dev.deviceIsMounted();
@@ -135,30 +137,25 @@ DeviceInfoPtr DiskManager::deviceForPath(const QDBusObjectPath &path)
DeviceInfoPtr d;
- if (dev.deviceIsPartition() || dev.deviceIsOpticalDisc())
+ if (dev.idUsage() == "filesystem")
{
- if (dev.partitionType() != "0x05" // extended partition
- && dev.partitionType() != "0x0f" // extended Win95 partition
- && dev.idType() != "swap" // skip swap
- )
- {
- d = DeviceInfoPtr(new DeviceInfo);
-
- d->udisksPath = path.path();
- const QString& label = dev.idLabel();
- const QString& fn = dev.deviceFile();
- d->name = label.isEmpty() ? fn.mid(fn.lastIndexOf('/') + 1) : label;
- d->size = dev.deviceSize();
- d->fileSystem = dev.idType();
- d->type = dev.deviceIsSystemInternal() ? DeviceInfo::HDD :
- dev.deviceIsOpticalDisc() ? DeviceInfo::CD :
- dev.driveMediaCompatibility().contains("floppy") ? DeviceInfo::Floppy :
- containsFlashTypes(dev.driveMediaCompatibility()) ? DeviceInfo::Flash :
- DeviceInfo::Other;
- d->isMounted = dev.deviceIsMounted();
- if (d->isMounted) d->mountPoint = dev.deviceMountPaths().first();
- d->isSystem = dev.deviceIsSystemInternal();
- }
+ qDebug() << "3333333333";
+ d = DeviceInfoPtr(new DeviceInfo);
+
+ d->udisksPath = path.path();
+ const QString& label = dev.idLabel();
+ const QString& fn = dev.deviceFile();
+ d->name = label.isEmpty() ? fn.mid(fn.lastIndexOf('/') + 1) : label;
+ d->size = dev.deviceSize();
+ d->fileSystem = dev.idType();
+ d->type = dev.deviceIsSystemInternal() ? DeviceInfo::HDD :
+ dev.deviceIsOpticalDisc() ? DeviceInfo::CD :
+ dev.driveMediaCompatibility().contains("floppy") ? DeviceInfo::Floppy :
+ containsFlashTypes(dev.driveMediaCompatibility()) ? DeviceInfo::Flash :
+ DeviceInfo::Other;
+ d->isMounted = dev.deviceIsMounted();
+ if (d->isMounted) d->mountPoint = dev.deviceMountPaths().first();
+ d->isSystem = dev.deviceIsSystemInternal();
}
return d;
View
@@ -19,7 +19,7 @@
TEMPLATE = app
TARGET = tinymount
-VERSION = 0.2.4
+VERSION = 0.2.5
DEPENDPATH += .
INCLUDEPATH += .

0 comments on commit 01ecb02

Please sign in to comment.