Do not attempt to set partition flags that were not changed.

This commit is contained in:
Andrius Štikonas 2017-12-06 00:27:02 +00:00
parent 8afe33a4a4
commit e66fb4b95e
1 changed files with 3 additions and 0 deletions

View File

@ -73,7 +73,10 @@ bool SetPartFlagsJob::run(Report& parent)
for (const auto &f : PartitionTable::flagList()) {
emit progress(++count);
const bool oldState = (partition().activeFlags() & f) ? true : false;
const bool state = (flags() & f) ? true : false;
if (oldState == state)
continue;
if (!backendPartition->setFlag(*report, f, state)) {
report->line() << xi18nc("@info:progress", "There was an error setting flag %1 for partition <filename>%2</filename> to state %3.", PartitionTable::flagName(f), partition().deviceNode(), state ? xi18nc("@info:progress flag turned on, active", "on") : xi18nc("@info:progress flag turned off, inactive", "off"));