Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/udisks2/udisksdevice.cpp
Show First 20 Lines • Show All 364 Lines • ▼ Show 20 Line(s) | 359 | if (drive_type == Solid::StorageDrive::Floppy) { | |||
---|---|---|---|---|---|
365 | 365 | | |||
366 | return description; | 366 | return description; | ||
367 | } | 367 | } | ||
368 | 368 | | |||
369 | const bool drive_is_removable = storageDrive.isRemovable(); | 369 | const bool drive_is_removable = storageDrive.isRemovable(); | ||
370 | 370 | | |||
371 | if (drive_type == Solid::StorageDrive::HardDisk && !drive_is_removable) { | 371 | if (drive_type == Solid::StorageDrive::HardDisk && !drive_is_removable) { | ||
372 | QString size_str = formatByteSize(storageDrive.size()); | 372 | QString size_str = formatByteSize(storageDrive.size()); | ||
373 | if (!size_str.isEmpty()) { | 373 | if (storageDrive.size() > 0) { | ||
374 | if (drive_is_hotpluggable) { | 374 | if (drive_is_hotpluggable) { | ||
375 | description = tr("%1 External Hard Drive", "%1 is the size").arg(size_str); | 375 | description = tr("%1 External Hard Drive", "%1 is the size").arg(size_str); | ||
376 | } else { | 376 | } else { | ||
377 | description = tr("%1 Hard Drive", "%1 is the size").arg(size_str); | 377 | description = tr("%1 Hard Drive", "%1 is the size").arg(size_str); | ||
378 | } | 378 | } | ||
379 | } else { | 379 | } else { | ||
380 | if (drive_is_hotpluggable) { | 380 | if (drive_is_hotpluggable) { | ||
381 | description = tr("External Hard Drive"); | 381 | description = tr("External Hard Drive"); | ||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Line(s) | 437 | if (drive_type == Solid::StorageDrive::CdromDrive) { | |||
567 | return description; | 567 | return description; | ||
568 | } | 568 | } | ||
569 | 569 | | |||
570 | const bool drive_is_removable = storageDrive.isRemovable(); | 570 | const bool drive_is_removable = storageDrive.isRemovable(); | ||
571 | const bool drive_is_hotpluggable = storageDrive.isHotpluggable(); | 571 | const bool drive_is_hotpluggable = storageDrive.isHotpluggable(); | ||
572 | 572 | | |||
573 | QString size_str = formatByteSize(storageVolume.size()); | 573 | QString size_str = formatByteSize(storageVolume.size()); | ||
574 | if (isEncryptedContainer()) { | 574 | if (isEncryptedContainer()) { | ||
575 | if (!size_str.isEmpty()) { | 575 | if (storageVolume.size() > 0) { | ||
576 | description = tr("%1 Encrypted Drive", "%1 is the size").arg(size_str); | 576 | description = tr("%1 Encrypted Drive", "%1 is the size").arg(size_str); | ||
577 | } else { | 577 | } else { | ||
578 | description = tr("Encrypted Drive"); | 578 | description = tr("Encrypted Drive"); | ||
579 | } | 579 | } | ||
580 | } else if (drive_type == Solid::StorageDrive::HardDisk && !drive_is_removable) { | 580 | } else if (drive_type == Solid::StorageDrive::HardDisk && !drive_is_removable) { | ||
581 | if (!size_str.isEmpty()) { | 581 | if (storageVolume.size() > 0) { | ||
582 | if (drive_is_hotpluggable) { | 582 | if (drive_is_hotpluggable) { | ||
583 | description = tr("%1 External Hard Drive", "%1 is the size").arg(size_str); | 583 | description = tr("%1 External Hard Drive", "%1 is the size").arg(size_str); | ||
584 | } else { | 584 | } else { | ||
585 | description = tr("%1 Hard Drive", "%1 is the size").arg(size_str); | 585 | description = tr("%1 Hard Drive", "%1 is the size").arg(size_str); | ||
586 | } | 586 | } | ||
587 | } else { | 587 | } else { | ||
588 | if (drive_is_hotpluggable) { | 588 | if (drive_is_hotpluggable) { | ||
589 | description = tr("External Hard Drive"); | 589 | description = tr("External Hard Drive"); | ||
▲ Show 20 Lines • Show All 290 Lines • Show Last 20 Lines |