diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index c47e867..5f358f1 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -1056,9 +1057,13 @@ void MainWindow::onImportPartitionTable() if (fs->supportSetLabel() != FileSystem::cmdSupportNone && !volumeLabel.isEmpty()) fs->setLabel(volumeLabel); - Partition* p = new Partition(parent, device, role, fs, firstSector, lastSector, QString(), PartitionTable::flagsFromList(flags), QString(), false, PartitionTable::flagsFromList(flags), Partition::State::New); + Partition* p = new Partition(parent, device, role, fs, firstSector, lastSector, QString(), PartitionTable::Flag::None, QString(), false, PartitionTable::Flag::None, Partition::State::New); operationStack().push(new NewOperation(device, p)); + + auto newFlags = PartitionTable::flagsFromList(flags); + if (newFlags != PartitionTable::Flag::None) + operationStack().push(new SetPartFlagsOperation(device, *p, newFlags)); } else Log(Log::Level::warning) << xi18nc("@info:status", "Could not parse line %1 from import file. Ignoring it.", lineNo); }