Skip to content

Commit

Permalink
[nemo-storage] Mount an external storage with fs type that block devi…
Browse files Browse the repository at this point in the history
…ce has. Contributes to JB#44456
  • Loading branch information
rainemak committed Feb 25, 2019
1 parent 79d80ec commit f482d47
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/udisks2monitor.cpp
Expand Up @@ -174,9 +174,25 @@ void UDisks2::Monitor::mount(const QString &devicePath)
{
QVariantList arguments;
QVariantMap options;
options.insert(QStringLiteral("fstype"), QString());
arguments << options;
startMountOperation(devicePath, UDISKS2_FILESYSTEM_MOUNT, m_blockDevices->objectPath(devicePath), arguments);

if (Block *block = m_blockDevices->find(devicePath)) {
QString objectPath;
if (block->device() == devicePath) {
objectPath = block->path();
} else if (block->cryptoBackingDevicePath() == devicePath) {
objectPath = block->cryptoBackingDeviceObjectPath();
}

// Find has the same condition.
Q_ASSERT(!objectPath.isEmpty());

options.insert(QStringLiteral("fstype"), block->idType());
arguments << options;
startMountOperation(devicePath, UDISKS2_FILESYSTEM_MOUNT, objectPath, arguments);
} else {
emit mountError(Partition::ErrorOptionNotPermitted);
emit status(devicePath, Partition::Unmounted);
}
}

void UDisks2::Monitor::unmount(const QString &devicePath)
Expand Down

0 comments on commit f482d47

Please sign in to comment.