Commit a0754ba8 authored by Raine Makelainen's avatar Raine Makelainen

Merge branch 'jb44456' into 'master'

Mount an external storage with fs type that block device has

See merge request mer-core/nemo-qml-plugin-systemsettings!98
parents ba972827 ed7d2e8d
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment