diff --git a/src/config/configureoptionsdialog.cpp b/src/config/configureoptionsdialog.cpp index f1a03e8..ddc4f6b 100644 --- a/src/config/configureoptionsdialog.cpp +++ b/src/config/configureoptionsdialog.cpp @@ -84,8 +84,8 @@ void ConfigureOptionsDialog::updateSettings() bool changed = false; - if (generalPageWidget().defaultFileSystem() != Config::defaultFileSystem()) { - Config::setDefaultFileSystem(generalPageWidget().defaultFileSystem()); + if (generalPageWidget().defaultFileSystem() != static_cast(Config::defaultFileSystem())) { + Config::setDefaultFileSystem(static_cast(generalPageWidget().defaultFileSystem())); changed = true; } @@ -109,7 +109,7 @@ bool ConfigureOptionsDialog::hasChanged() bool result = KConfigDialog::hasChanged(); KConfigSkeletonItem* kcItem = Config::self()->findItem(QStringLiteral("defaultFileSystem")); - result = result || !kcItem->isEqual(generalPageWidget().defaultFileSystem()); + result = result || !kcItem->isEqual(static_cast(generalPageWidget().defaultFileSystem())); result = result || (generalPageWidget().kcfg_shredSource->checkedId() != Config::shredSource()); if (advancedPageWidget().isVisible()) { diff --git a/src/config/generalpagewidget.cpp b/src/config/generalpagewidget.cpp index c4450dd..c596313 100644 --- a/src/config/generalpagewidget.cpp +++ b/src/config/generalpagewidget.cpp @@ -48,7 +48,7 @@ void GeneralPageWidget::setupDialog() { QStringList fsNames; for (const auto &fs : FileSystemFactory::map()) - if (fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended && fs->type() != FileSystem::Luks) + if (fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Type::Extended && fs->type() != FileSystem::Type::Luks) fsNames.append(fs->name()); std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan); diff --git a/src/gui/editmountpointdialogwidget.cpp b/src/gui/editmountpointdialogwidget.cpp index ee5f739..e4099bf 100644 --- a/src/gui/editmountpointdialogwidget.cpp +++ b/src/gui/editmountpointdialogwidget.cpp @@ -42,7 +42,7 @@ EditMountPointDialogWidget::EditMountPointDialogWidget(QWidget* parent, Partitio setupUi(this); m_deviceNode = partition().deviceNode(); - if (partition().roles().has(PartitionRole::Luks) && partition().fileSystem().type() != FileSystem::Luks) { + if (partition().roles().has(PartitionRole::Luks) && partition().fileSystem().type() != FileSystem::Type::Luks) { const FS::luks* luksFs = dynamic_cast(&partition().fileSystem()); m_deviceNode = luksFs->mapperName(); } @@ -54,7 +54,7 @@ EditMountPointDialogWidget::EditMountPointDialogWidget(QWidget* parent, Partitio for (auto &e : m_fstabEntries) { QString canonicalEntryPath = QFileInfo(e.deviceNode()).canonicalFilePath(); QString canonicalDevicePath = QFileInfo(m_deviceNode).canonicalFilePath(); - if (canonicalEntryPath == canonicalDevicePath) { // FIXME fix multiple mountpoints + if (canonicalEntryPath == canonicalDevicePath) { entryFound = true; entry.push_back(&e); mountPointList = possibleMountPoints(e.deviceNode()); @@ -65,11 +65,11 @@ EditMountPointDialogWidget::EditMountPointDialogWidget(QWidget* parent, Partitio FileSystem::Type type = partition().fileSystem().type(); QString fsName; switch (type) { - case FileSystem::LinuxSwap: + case FileSystem::Type::LinuxSwap: fsName = QStringLiteral("swap"); break; - case FileSystem::Fat16: - case FileSystem::Fat32: + case FileSystem::Type::Fat16: + case FileSystem::Type::Fat32: fsName = QStringLiteral("vfat"); break; default: diff --git a/src/gui/filesystemsupportdialog.cpp b/src/gui/filesystemsupportdialog.cpp index 1d61a1e..487b534 100644 --- a/src/gui/filesystemsupportdialog.cpp +++ b/src/gui/filesystemsupportdialog.cpp @@ -72,8 +72,8 @@ void FileSystemSupportDialog::setupDialog() dialogWidget().tree().clear(); for (const auto &fs : FileSystemFactory::map()) { - if (fs->type() == FileSystem::Unknown || fs->type() == FileSystem::Extended || - fs->type() == FileSystem::Luks || fs->type() == FileSystem::Luks2) { + if (fs->type() == FileSystem::Type::Unknown || fs->type() == FileSystem::Type::Extended || + fs->type() == FileSystem::Type::Luks || fs->type() == FileSystem::Type::Luks2) { continue; } diff --git a/src/gui/infopane.cpp b/src/gui/infopane.cpp index f3336e6..dce3c28 100644 --- a/src/gui/infopane.cpp +++ b/src/gui/infopane.cpp @@ -114,7 +114,7 @@ void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p) int x = 0; int y = createHeader(p.deviceNode(), cols(area)); - if (p.fileSystem().type() == FileSystem::Luks) { // inactive LUKS partition + if (p.fileSystem().type() == FileSystem::Type::Luks) { // inactive LUKS partition const FS::luks* luksFs = static_cast(&p.fileSystem()); QString deviceNode = p.partitionPath(); createLabels(i18nc("@label partition", "File system:"), p.fileSystem().name(), cols(area), x, y); @@ -127,7 +127,7 @@ void InfoPane::showPartition(Qt::DockWidgetArea area, const Partition& p) createLabels(i18nc("@label partition", "First sector:"), QLocale().toString(p.firstSector()), cols(area), x, y); createLabels(i18nc("@label partition", "Last sector:"), QLocale().toString(p.lastSector()), cols(area), x, y); createLabels(i18nc("@label partition", "Number of sectors:"), QLocale().toString(p.length()), cols(area), x, y); - } else if (p.fileSystem().type() == FileSystem::Lvm2_PV) { + } else if (p.fileSystem().type() == FileSystem::Type::Lvm2_PV) { FS::lvm2_pv *lvm2PVFs; innerFS(&p, lvm2PVFs); QString deviceNode = p.partitionPath(); diff --git a/src/gui/newdialog.cpp b/src/gui/newdialog.cpp index cebba96..4dc5003 100644 --- a/src/gui/newdialog.cpp +++ b/src/gui/newdialog.cpp @@ -73,9 +73,9 @@ void NewDialog::setupDialog() QStringList fsNames; for (const auto &fs : FileSystemFactory::map()) { if (fs->supportCreate() != FileSystem::cmdSupportNone && - fs->type() != FileSystem::Extended && - fs->type() != FileSystem::Luks && - fs->type() != FileSystem::Luks2) + fs->type() != FileSystem::Type::Extended && + fs->type() != FileSystem::Type::Luks && + fs->type() != FileSystem::Type::Luks2) fsNames.append(fs->name()); } @@ -144,7 +144,7 @@ void NewDialog::accept() { if (partition().roles().has(PartitionRole::Extended)) { partition().deleteFileSystem(); - partition().setFileSystem(FileSystemFactory::create(FileSystem::Extended, + partition().setFileSystem(FileSystemFactory::create(FileSystem::Type::Extended, partition().firstSector(), partition().lastSector(), partition().sectorSize())); @@ -153,7 +153,7 @@ void NewDialog::accept() FileSystem::Type innerFsType = partition().fileSystem().type(); partition().deleteFileSystem(); FS::luks* luksFs = dynamic_cast< FS::luks* >( - FileSystemFactory::create(FileSystem::Luks, + FileSystemFactory::create(FileSystem::Type::Luks, partition().firstSector(), partition().lastSector(), partition().sectorSize())); @@ -188,7 +188,7 @@ void NewDialog::onRoleChanged(bool) // Also make sure to set a primary's or logical's file system once the user goes back from // extended to any of those. if (r == PartitionRole::Extended) - updateFileSystem(FileSystem::Extended); + updateFileSystem(FileSystem::Type::Extended); else updateFileSystem(FileSystem::typeForName(dialogWidget().comboFileSystem().currentText())); diff --git a/src/gui/partitionmanagerwidget.cpp b/src/gui/partitionmanagerwidget.cpp index 806fea2..1f5b874 100644 --- a/src/gui/partitionmanagerwidget.cpp +++ b/src/gui/partitionmanagerwidget.cpp @@ -208,7 +208,7 @@ static QTreeWidgetItem* createTreeWidgetItem(const Partition& p) int i = 0; item->setText(i++, p.deviceNode()); - if (p.roles().has(PartitionRole::Luks) && (p.fileSystem().name() != p.fileSystem().nameForType(FileSystem::Luks) && p.fileSystem().name() != p.fileSystem().nameForType(FileSystem::Luks2))) + if (p.roles().has(PartitionRole::Luks) && (p.fileSystem().name() != p.fileSystem().nameForType(FileSystem::Type::Luks) && p.fileSystem().name() != p.fileSystem().nameForType(FileSystem::Type::Luks2))) item->setText(i, xi18nc("@item:intable Encrypted file systems, e.g. btrfs[Encrypted]", "%1 [Encrypted]", p.fileSystem().name())); else item->setText(i, p.fileSystem().name()); diff --git a/src/gui/partpropsdialog.cpp b/src/gui/partpropsdialog.cpp index 8221e4a..f8bb36e 100644 --- a/src/gui/partpropsdialog.cpp +++ b/src/gui/partpropsdialog.cpp @@ -232,7 +232,7 @@ void PartPropsDialog::updateHideAndShow() partition().state() != Partition::StateNew && // not for new partitions !partition().roles().has(PartitionRole::Extended) && // neither for extended !partition().roles().has(PartitionRole::Unallocated) && // or for unallocated - newFileSystemType() != FileSystem::Unformatted; // and not for unformatted file systems + newFileSystemType() != FileSystem::Type::Unformatted; // and not for unformatted file systems dialogWidget().showAvailable(showAvailableAndUsed); dialogWidget().showUsed(showAvailableAndUsed); @@ -242,14 +242,14 @@ void PartPropsDialog::updateHideAndShow() !partition().roles().has(PartitionRole::Extended) && // not for extended, they have no file system !partition().roles().has(PartitionRole::Unallocated) && // and not for unallocated: no choice there // do now show file system comboBox for open luks volumes. - !(partition().roles().has(PartitionRole::Luks) && partition().fileSystem().type() != FileSystem::Luks); + !(partition().roles().has(PartitionRole::Luks) && partition().fileSystem().type() != FileSystem::Type::Luks); dialogWidget().showFileSystem(showFileSystem); // when do we show the recreate file system check box? const bool showCheckRecreate = showFileSystem && // only if we also show the file system partition().fileSystem().supportCreate() != FileSystem::cmdSupportNone && // and support creating this file system - partition().fileSystem().type() != FileSystem::Unknown && // and not for unknown file systems + partition().fileSystem().type() != FileSystem::Type::Unknown && // and not for unknown file systems partition().state() != Partition::StateNew && // or new partitions !partition().roles().has(PartitionRole::Luks); // or encrypted filesystems @@ -297,7 +297,7 @@ void PartPropsDialog::setupFileSystemComboBox() for(const auto &fs : FileSystemFactory::map()) { // If the partition isn't encrypted, skip the luks FS - if (fs->type() == FileSystem::Luks && partition().fileSystem().type() != FileSystem::Luks) + if (fs->type() == FileSystem::Type::Luks && partition().fileSystem().type() != FileSystem::Type::Luks) continue; if (partition().fileSystem().type() == fs->type() || (fs->supportCreate() != FileSystem::cmdSupportNone && partition().capacity() >= fs->minCapacity() && partition().capacity() <= fs->maxCapacity())) { @@ -307,16 +307,16 @@ void PartPropsDialog::setupFileSystemComboBox() selected = name; // If the partition isn't extended, skip the extended FS - if (fs->type() == FileSystem::Extended && !partition().roles().has(PartitionRole::Extended)) + if (fs->type() == FileSystem::Type::Extended && !partition().roles().has(PartitionRole::Extended)) continue; // The user cannot change the filesystem back to "unformatted" once a filesystem has been created. - if (fs->type() == FileSystem::Unformatted) { + if (fs->type() == FileSystem::Type::Unformatted) { // .. but if the file system is unknown to us, show the unformatted option as the currently selected one - if (partition().fileSystem().type() == FileSystem::Unknown) { - name = FileSystem::nameForType(FileSystem::Unformatted); + if (partition().fileSystem().type() == FileSystem::Type::Unknown) { + name = FileSystem::nameForType(FileSystem::Type::Unformatted); selected = name; - } else if (partition().fileSystem().type() != FileSystem::Unformatted && partition().state() != Partition::StateNew) + } else if (partition().fileSystem().type() != FileSystem::Type::Unformatted && partition().state() != Partition::StateNew) continue; } diff --git a/src/partitionmanager.kcfg b/src/partitionmanager.kcfg index 6513c27..7d5992c 100644 --- a/src/partitionmanager.kcfg +++ b/src/partitionmanager.kcfg @@ -130,7 +130,7 @@ - FileSystem::Type::Ext4 + static_cast<int>(FileSystem::Type::Ext4) diff --git a/src/util/guihelpers.cpp b/src/util/guihelpers.cpp index 54048b5..464d85a 100644 --- a/src/util/guihelpers.cpp +++ b/src/util/guihelpers.cpp @@ -45,7 +45,7 @@ QIcon createFileSystemColor(FileSystem::Type type, quint32 size) QPixmap pixmap(size, size); QPainter painter(&pixmap); painter.setPen(QColor(0, 0, 0)); - painter.setBrush(Config::fileSystemColorCode(type)); + painter.setBrush(Config::fileSystemColorCode(static_cast(type))); painter.drawRect(QRect(0, 0, pixmap.width() - 1, pixmap.height() - 1)); painter.end();