mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 10:22:49 +00:00
soliduiserver: check if the device is removable before unmounting it
as a precaution for device invalidation after unmount Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
cb97fd9984
commit
99357e8a44
1 changed files with 5 additions and 5 deletions
|
@ -254,17 +254,17 @@ int SolidUiServer::unmountUdi(const QString &udi)
|
|||
return int(Solid::ErrorType::InvalidOption);
|
||||
}
|
||||
|
||||
const int unmountresult = unmountDevice(storageaccess->filePath());
|
||||
if (unmountresult != int(Solid::ErrorType::NoError)) {
|
||||
return unmountresult;
|
||||
}
|
||||
|
||||
bool isremovable = false;
|
||||
Solid::StorageDrive *storagedrive = device.as<Solid::StorageDrive>();
|
||||
if (storagedrive) {
|
||||
isremovable = (storagedrive->isHotpluggable() || storagedrive->isRemovable());
|
||||
}
|
||||
|
||||
const int unmountresult = unmountDevice(storageaccess->filePath());
|
||||
if (unmountresult != int(Solid::ErrorType::NoError)) {
|
||||
return unmountresult;
|
||||
}
|
||||
|
||||
if (storagevolume->usage() == Solid::StorageVolume::Encrypted) {
|
||||
QVariantMap cryptclosearguments;
|
||||
cryptclosearguments.insert("name", storagevolume->uuid());
|
||||
|
|
Loading…
Add table
Reference in a new issue