From 8fbf90db8029de5a7a73b553dbf3ab9d17ddacd6 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Mon, 4 Jul 2022 19:30:10 -0500 Subject: Qt UI: Refactor mount dialog partition display *once again*, do things the more complex way instead of the simple way. (Sensing a pattern yet?!) --- ui/qt5/mountdialog.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ui/qt5/mountdialog.cc b/ui/qt5/mountdialog.cc index dcded49..c0a38cc 100644 --- a/ui/qt5/mountdialog.cc +++ b/ui/qt5/mountdialog.cc @@ -3,7 +3,7 @@ * horizon-qt5, the Qt 5 user interface for * Project Horizon * - * Copyright (c) 2020 Adélie Linux and contributors. All rights reserved. + * Copyright (c) 2020-2022 Adélie Linux and contributors. All rights reserved. * This code is licensed under the AGPL 3.0 license, as noted in the * LICENSE-code file in the root directory of this repository. * @@ -40,16 +40,20 @@ MountDialog::MountDialog(QStringList skipParts, QStringList skipMounts, for(const auto &disk : wizard->disks) { if(disk.has_fs()) { - partitions << QString::fromStdString(disk.node()); + QString node(QString::fromStdString(disk.node())); + if(!skipParts.contains(node)) { + partitions << node; + } } else if(disk.has_label()) { for(const auto &part : disk.partitions()) { - partitions << QString::fromStdString(part.node()); + QString node(QString::fromStdString(part.node())); + if(!skipParts.contains(node)) { + partitions << node; + } } } } - QSet parts = partitions.toSet().subtract(skipParts.toSet()); - partitions = parts.toList(); partitions.sort(); partList = new QListWidget; -- cgit v1.2.3-70-g09d2