Skip to content

Commit

Permalink
Merge branch 'jb44456' into 'master'
Browse files Browse the repository at this point in the history
Mount an external storage with fs type that block device has

See merge request mer-core/nemo-qml-plugin-systemsettings!98
  • Loading branch information
rainemak committed Feb 22, 2019
2 parents ba97282 + ed7d2e8 commit a0754ba
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 a0754ba

Please sign in to comment.