Make sure file system is not mounted before deleting it.
Sometimes user might try to mount manually and then delete partition without refreshing state in KPM.
This commit is contained in:
parent
0c70c66aae
commit
8ae2ea3006
|
@ -26,6 +26,7 @@
|
||||||
#include "core/partition.h"
|
#include "core/partition.h"
|
||||||
#include "core/device.h"
|
#include "core/device.h"
|
||||||
|
|
||||||
|
#include "util/helpers.h"
|
||||||
#include "util/report.h"
|
#include "util/report.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@ -56,6 +57,12 @@ bool DeleteFileSystemJob::run(Report& parent)
|
||||||
|
|
||||||
Report* report = jobStarted(parent);
|
Report* report = jobStarted(parent);
|
||||||
|
|
||||||
|
if (isMounted(partition().partitionPath())) {
|
||||||
|
report->line() << xi18nc("@info/plain", "Could not delete file system: file system on <filename>%1</filename> is mounted.", partition().deviceNode());
|
||||||
|
jobFinished(*report, rval);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (partition().roles().has(PartitionRole::Extended))
|
if (partition().roles().has(PartitionRole::Extended))
|
||||||
rval = true;
|
rval = true;
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue