diff --git a/.gitignore b/.gitignore index e133fa7..3758ddd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -# SPDX-FileCopyrightText: 2020 Andrius Štikonas -# SPDX-License-Identifier: MIT +# SPDX-FileCopyrightText: none +# SPDX-License-Identifier: CC0-1.0 build .kdev4/ diff --git a/.reuse/dep5 b/.reuse/dep5 index 4a808dd..ef95010 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -22,11 +22,11 @@ Copyright: 2017 Andrius Štikonas ### Documentation Files: doc/*.docbook -License: GFDL-1.3-or-later +License: GFDL-1.2-or-later Copyright: 2008-2016 KDE Burkhard Lück Copyright: 2008 Volker Lanz ### Screenshots Files: doc/*.png -License: GFDL-1.3-or-later +License: CC-BY-4.0 or GFDL-1.2-or-later Copyright: 2016 KDE Burkhard Lück diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fbf6dd..4e95760 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,27 +3,27 @@ # SPDX-License-Identifier: GPL-3.0-or-later -project(partitionmanager) - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) +# KDE Application Version, managed by release script +set (RELEASE_SERVICE_VERSION_MAJOR "21") +set (RELEASE_SERVICE_VERSION_MINOR "03") +set (RELEASE_SERVICE_VERSION_MICRO "70") +set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}") +project(partitionmanager VERSION ${RELEASE_SERVICE_VERSION}) + # Dependencies -set(QT_MIN_VERSION "5.10.0") -set(KF5_MIN_VERSION "5.71") -set(KPMCORE_MIN_VERSION "4.2.0") +set(QT_MIN_VERSION "5.14.0") +set(KF5_MIN_VERSION "5.73") +set(KPMCORE_MIN_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}") set(CMAKE_USE_RELATIVE_PATHS OFF) set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) set(KDE_INSTALL_USE_QT_SYS_PATHS ON CACHE BOOL "Install mkspecs files, Plugins and Imports to the Qt 5 install dir" FORCE) -# Check KPMcore dependency when bumping -set(VERSION_MAJOR "4") -set(VERSION_MINOR "2") -set(VERSION_RELEASE "0") -set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}) -add_definitions(-D'VERSION="${VERSION}"') #" +add_definitions(-D'VERSION="${RELEASE_SERVICE_VERSION}"') -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) @@ -81,10 +81,11 @@ add_subdirectory(src) add_subdirectory(icons) if (KF5DocTools_FOUND) add_subdirectory(doc) + kdoctools_install(po) endif() ki18n_install(po) -message(STATUS "KDE Partition Manager ${VERSION} will be built for install into ${CMAKE_INSTALL_PREFIX}") +message(STATUS "KDE Partition Manager ${RELEASE_SERVICE_VERSION} will be built for install into ${CMAKE_INSTALL_PREFIX}") feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/INSTALL.md b/INSTALL.md index e695b90..93b82bb 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,3 +1,8 @@ + + Building and installing KDE Partition Manager from source ========================================================= diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt new file mode 100644 index 0000000..a343ccd --- /dev/null +++ b/LICENSES/CC0-1.0.txt @@ -0,0 +1,119 @@ +Creative Commons Legal Code + +CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES +NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE +AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION +ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE +OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS +LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION +OR WORKS PROVIDED HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer exclusive +Copyright and Related Rights (defined below) upon the creator and subsequent +owner(s) (each and all, an "owner") of an original work of authorship and/or +a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific +works ("Commons") that the public can reliably and without fear of later claims +of infringement build upon, modify, incorporate in other works, reuse and +redistribute as freely as possible in any form whatsoever and for any purposes, +including without limitation commercial purposes. These owners may contribute +to the Commons to promote the ideal of a free culture and the further production +of creative, cultural and scientific works, or to gain reputation or greater +distribution for their Work in part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any expectation +of additional consideration or compensation, the person associating CC0 with +a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright +and Related Rights in the Work, voluntarily elects to apply CC0 to the Work +and publicly distribute the Work under its terms, with knowledge of his or +her Copyright and Related Rights in the Work and the meaning and intended +legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be protected +by copyright and related or neighboring rights ("Copyright and Related Rights"). +Copyright and Related Rights include, but are not limited to, the following: + +i. the right to reproduce, adapt, distribute, perform, display, communicate, +and translate a Work; + + ii. moral rights retained by the original author(s) and/or performer(s); + +iii. publicity and privacy rights pertaining to a person's image or likeness +depicted in a Work; + +iv. rights protecting against unfair competition in regards to a Work, subject +to the limitations in paragraph 4(a), below; + +v. rights protecting the extraction, dissemination, use and reuse of data +in a Work; + +vi. database rights (such as those arising under Directive 96/9/EC of the +European Parliament and of the Council of 11 March 1996 on the legal protection +of databases, and under any national implementation thereof, including any +amended or successor version of such directive); and + +vii. other similar, equivalent or corresponding rights throughout the world +based on applicable law or treaty, and any national implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention of, +applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and +unconditionally waives, abandons, and surrenders all of Affirmer's Copyright +and Related Rights and associated claims and causes of action, whether now +known or unknown (including existing as well as future claims and causes of +action), in the Work (i) in all territories worldwide, (ii) for the maximum +duration provided by applicable law or treaty (including future time extensions), +(iii) in any current or future medium and for any number of copies, and (iv) +for any purpose whatsoever, including without limitation commercial, advertising +or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the +benefit of each member of the public at large and to the detriment of Affirmer's +heirs and successors, fully intending that such Waiver shall not be subject +to revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason be +judged legally invalid or ineffective under applicable law, then the Waiver +shall be preserved to the maximum extent permitted taking into account Affirmer's +express Statement of Purpose. In addition, to the extent the Waiver is so +judged Affirmer hereby grants to each affected person a royalty-free, non +transferable, non sublicensable, non exclusive, irrevocable and unconditional +license to exercise Affirmer's Copyright and Related Rights in the Work (i) +in all territories worldwide, (ii) for the maximum duration provided by applicable +law or treaty (including future time extensions), (iii) in any current or +future medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional purposes +(the "License"). The License shall be deemed effective as of the date CC0 +was applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder of +the License, and in such case Affirmer hereby affirms that he or she will +not (i) exercise any of his or her remaining Copyright and Related Rights +in the Work or (ii) assert any associated claims and causes of action with +respect to the Work, in either case contrary to Affirmer's express Statement +of Purpose. + + 4. Limitations and Disclaimers. + +a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, +licensed or otherwise affected by this document. + +b. Affirmer offers the Work as-is and makes no representations or warranties +of any kind concerning the Work, express, implied, statutory or otherwise, +including without limitation warranties of title, merchantability, fitness +for a particular purpose, non infringement, or the absence of latent or other +defects, accuracy, or the present or absence of errors, whether or not discoverable, +all to the greatest extent permissible under applicable law. + +c. Affirmer disclaims responsibility for clearing rights of other persons +that may apply to the Work or any use thereof, including without limitation +any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims +responsibility for obtaining any necessary consents, permissions or other +rights required for any use of the Work. + +d. Affirmer understands and acknowledges that Creative Commons is not a party +to this document and has no duty or obligation with respect to this CC0 or +use of the Work. diff --git a/LICENSES/GFDL-1.3-or-later.txt b/LICENSES/GFDL-1.2-or-later.txt similarity index 80% rename from LICENSES/GFDL-1.3-or-later.txt rename to LICENSES/GFDL-1.2-or-later.txt index bf128be..4a0fe1c 100644 --- a/LICENSES/GFDL-1.3-or-later.txt +++ b/LICENSES/GFDL-1.2-or-later.txt @@ -1,13 +1,13 @@ - - GNU Free Documentation License - Version 1.3, 3 November 2008 + GNU Free Documentation License + Version 1.2, November 2002 - Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. - + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other @@ -50,11 +50,11 @@ modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall -subject (or to related matters) and contains nothing that could fall -directly within that overall subject. (Thus, if the Document is in -part a textbook of mathematics, a Secondary Section may not explain -any mathematics.) The relationship could be a matter of historical +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (Thus, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. @@ -103,9 +103,6 @@ formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. -The "publisher" means any person or entity that distributes copies of -the Document to the public. - A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a @@ -121,13 +118,14 @@ License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. + 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no -other conditions whatsoever to those of this License. You may not use +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough @@ -171,9 +169,8 @@ Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to -give them a chance to provide you with an updated version of the -Document. +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS @@ -288,18 +285,16 @@ Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS -You may make a collection consisting of the Document and other -documents released under this License, and replace the individual -copies of this License in the various documents with a single copy -that is included in the collection, provided that you follow the rules -of this License for verbatim copying of each of the documents in all -other respects. +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. -You may extract a single document from such a collection, and -distribute it individually under this License, provided you insert a -copy of this License into the extracted document, and follow this -License in all other respects regarding verbatim copying of that -document. +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS @@ -345,39 +340,22 @@ title. 9. TERMINATION -You may not copy, modify, sublicense, or distribute the Document -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense, or distribute it is void, and -will automatically terminate your rights under this License. - -However, if you cease all violation of this License, then your license -from a particular copyright holder is reinstated (a) provisionally, -unless and until the copyright holder explicitly and finally -terminates your license, and (b) permanently, if the copyright holder -fails to notify you of the violation by some reasonable means prior to -60 days after the cessation. - -Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, receipt of a copy of some or all of the same material does -not give you any rights to use it. +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE -The Free Software Foundation may publish new, revised versions of the -GNU Free Documentation License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in -detail to address new problems or concerns. See -https://www.gnu.org/licenses/. +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this @@ -386,39 +364,7 @@ following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. If the Document -specifies that a proxy can decide which future versions of this -License can be used, that proxy's public statement of acceptance of a -version permanently authorizes you to choose that version for the -Document. - -11. RELICENSING - -"Massive Multiauthor Collaboration Site" (or "MMC Site") means any -World Wide Web server that publishes copyrightable works and also -provides prominent facilities for anybody to edit those works. A -public wiki that anybody can edit is an example of such a server. A -"Massive Multiauthor Collaboration" (or "MMC") contained in the site -means any set of copyrightable works thus published on the MMC site. - -"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 -license published by Creative Commons Corporation, a not-for-profit -corporation with a principal place of business in San Francisco, -California, as well as future copyleft versions of that license -published by that same organization. - -"Incorporate" means to publish or republish a Document, in whole or in -part, as part of another Document. - -An MMC is "eligible for relicensing" if it is licensed under this -License, and if all works that were first published under this License -somewhere other than this MMC, and subsequently incorporated in whole or -in part into the MMC, (1) had no cover texts or invariant sections, and -(2) were thus incorporated prior to November 1, 2008. - -The operator of an MMC Site may republish an MMC contained in the site -under CC-BY-SA on the same site at any time before August 1, 2009, -provided the MMC is eligible for relicensing. +as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents @@ -429,7 +375,7 @@ license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.3 + under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU diff --git a/TODO b/TODO deleted file mode 100644 index 6ec0648..0000000 --- a/TODO +++ /dev/null @@ -1,26 +0,0 @@ -=============================================================================== - -For releases after 3.3: - -* make Job::copyBlocks() work with LVM. E.g. copy real partition into LVM LV. - -* find an elegant solution for the brokenness in design that is - Partition::sectorSize()... Either a Partition has a reference/pointer to the - Device it's on or the method is removed completely. -- Maybe the - PartitionTable should reference the Device? - -* the file system support dialog is a usability nightmare - -* write a setup-kcm in the style of k3b's so that the user can set the r/w - permissions of the disks there. - -* Convert the fs implementations into plugins. Redesign the support-stuff, make - that more flexible (no statics in the FS classes, some helper class or at - least an array in FileSystem). - -* Add a SMART self test operation. - -* Information about file system on a separate tab in the properties, unique - to the file system in use. - -* parse progress information at least from e2fsck and ntfsclone... maybe others. diff --git a/src/Messages.sh b/src/Messages.sh index 6fddf48..6ffde6d 100644 --- a/src/Messages.sh +++ b/src/Messages.sh @@ -4,8 +4,8 @@ # SPDX-License-Identifier: MIT -$EXTRACTRC `find -name \*.rc` >> rc.cpp || exit 11 -$EXTRACTRC `find -name \*.ui` >> rc.cpp || exit 12 -$EXTRACTRC `find -name \*.kcfg` >> rc.cpp || exit 12 -$XGETTEXT `find -name \*.cc -o -name \*.cpp -o -name \*.h` rc.cpp -o $podir/partitionmanager.pot +$EXTRACTRC $(find -name \*.rc) >> rc.cpp || exit 11 +$EXTRACTRC $(find -name \*.ui) >> rc.cpp || exit 12 +$EXTRACTRC $(find -name \*.kcfg) >> rc.cpp || exit 12 +$XGETTEXT $(find -name \*.cc -o -name \*.cpp -o -name \*.h) rc.cpp -o $podir/partitionmanager.pot rm -f rc.cpp diff --git a/src/config/generalpagewidget.cpp b/src/config/generalpagewidget.cpp index d1beb2c..195b146 100644 --- a/src/config/generalpagewidget.cpp +++ b/src/config/generalpagewidget.cpp @@ -1,6 +1,6 @@ /* SPDX-FileCopyrightText: 2010 Volker Lanz - SPDX-FileCopyrightText: 2014-2018 Andrius Štikonas + SPDX-FileCopyrightText: 2014-2020 Andrius Štikonas SPDX-License-Identifier: GPL-3.0-or-later */ @@ -13,6 +13,8 @@ #include #include "util/guihelpers.h" +#include + #include GeneralPageWidget::GeneralPageWidget(QWidget* parent) : @@ -42,7 +44,7 @@ void GeneralPageWidget::setupDialog() std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan); - for (const auto &fsName : qAsConst(fsNames)) + for (const auto &fsName : std::as_const(fsNames)) comboDefaultFileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName); setDefaultFileSystem(GuiHelpers::defaultFileSystem()); diff --git a/src/gui/createvolumegroupdialog.cpp b/src/gui/createvolumegroupdialog.cpp index 1a43a50..2f09e58 100644 --- a/src/gui/createvolumegroupdialog.cpp +++ b/src/gui/createvolumegroupdialog.cpp @@ -1,6 +1,6 @@ /* SPDX-FileCopyrightText: 2016 Chantara Tith - SPDX-FileCopyrightText: 2016 Andrius Štikonas + SPDX-FileCopyrightText: 2016-2020 Andrius Štikonas SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho SPDX-FileCopyrightText: 2019 Yuri Chornoivan @@ -22,6 +22,8 @@ #include #include +#include + #include #include @@ -60,22 +62,16 @@ void CreateVolumeGroupDialog::setupConnections() connect(&dialogWidget().spinPESize(), qOverload(&QSpinBox::valueChanged), this, &CreateVolumeGroupDialog::onSpinPESizeChanged); } -<<<<<<< HEAD void CreateVolumeGroupDialog::updatePartitionList() { if (dialogWidget().volumeType().currentText() == QStringLiteral("LVM")) { dialogWidget().listPV().clear(); -======= - if (!p.isLuks() && p.vgName().isEmpty() && !LvmDevice::s_DirtyPVs.contains(p.partition())) - dialogWidget().listPV().addPartition(*p.partition(), false); - } ->>>>>>> master - for (const auto &p : qAsConst(LVM::pvList::list())) { + for (const auto &p : std::as_const(LVM::pvList::list())) { bool toBeDeleted = false; // Ignore partitions that are going to be deleted - for (const auto &o : qAsConst(m_PendingOps)) { + for (const auto &o : std::as_const(m_PendingOps)) { if (dynamic_cast(o) && o->targets(*p.partition())) { toBeDeleted = true; break; @@ -111,14 +107,14 @@ void CreateVolumeGroupDialog::updatePartitionList() } } - for (const Partition *p : qAsConst(LvmDevice::s_OrphanPVs)) + for (const Partition *p : std::as_const(LvmDevice::s_OrphanPVs)) if (!LvmDevice::s_DirtyPVs.contains(p)) dialogWidget().listPV().addPartition(*p, false); } else if (dialogWidget().volumeType().currentText() == QStringLiteral("RAID")) { - for (const Device *d : qAsConst(m_Devices)) { + for (const Device *d : std::as_const(m_Devices)) { if (d->type() != Device::Type::SoftwareRAID_Device && d->partitionTable() != nullptr) { - for (const Partition *p : qAsConst(d->partitionTable()->children())) { + for (const Partition *p : std::as_const(d->partitionTable()->children())) { if (((p->fileSystem().type() == FileSystem::Type::LinuxRaidMember && SoftwareRAID::getRaidArrayName(p->partitionPath()).isEmpty()) || p->fileSystem().type() == FileSystem::Type::Unformatted || diff --git a/src/gui/editmountpointdialogwidget.cpp b/src/gui/editmountpointdialogwidget.cpp index 9b5dd9b..e0d29cf 100644 --- a/src/gui/editmountpointdialogwidget.cpp +++ b/src/gui/editmountpointdialogwidget.cpp @@ -198,7 +198,7 @@ void EditMountPointDialogWidget::buttonMoreClicked(bool) QStringList EditMountPointDialogWidget::options() const { - QStringList optList = m_Options.split(QLatin1Char(','), QString::SkipEmptyParts); + QStringList optList = m_Options.split(QLatin1Char(','), Qt::SkipEmptyParts); const auto keys = boxOptions(); for (const auto &s : keys) diff --git a/src/gui/infopane.cpp b/src/gui/infopane.cpp index d4a46dc..8319ba1 100644 --- a/src/gui/infopane.cpp +++ b/src/gui/infopane.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -75,9 +76,9 @@ void InfoPane::createLabels(const QString& title, const QString& value, const in labelTitle->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); QPalette palette = labelTitle->palette(); - QColor f = palette.color(QPalette::Foreground); + QColor f = palette.color(QPalette::WindowText); f.setAlpha(128); - palette.setColor(QPalette::Foreground, f); + palette.setColor(QPalette::WindowText, f); labelTitle->setPalette(palette); gridLayout().addWidget(labelTitle, y, x, 1, 1); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 4685c90..70048e2 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -132,7 +133,6 @@ void MainWindow::init() loadConfig(); show(); - ExternalCommand::setParentWidget(this); pmWidget().init(&operationStack()); scanDevices(); @@ -160,7 +160,6 @@ void MainWindow::closeEvent(QCloseEvent* event) saveConfig(); KXmlGuiWindow::closeEvent(event); - ExternalCommand::stopHelper(); delete m_ApplyProgressDialog; } @@ -1012,7 +1011,7 @@ void MainWindow::onImportPartitionTable() return; } - if (tableType != PartitionTable::msdos && tableType != PartitionTable::gpt) { + if (tableType != PartitionTable::msdos && tableType != PartitionTable::gpt && tableType != PartitionTable::none) { KMessageBox::error(this, xi18nc("@info", "Partition table type \"%1\" is not supported for import (line %2).", reType.captured(1), lineNo), xi18nc("@title:window", "Error While Importing Partition Table")); return; } @@ -1084,9 +1083,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); } diff --git a/src/gui/newdialog.cpp b/src/gui/newdialog.cpp index e1205a9..0a3441b 100644 --- a/src/gui/newdialog.cpp +++ b/src/gui/newdialog.cpp @@ -1,6 +1,6 @@ /* SPDX-FileCopyrightText: 2008-2012 Volker Lanz - SPDX-FileCopyrightText: 2013-2018 Andrius Štikonas + SPDX-FileCopyrightText: 2013-2020 Andrius Štikonas SPDX-FileCopyrightText: 2015 Teo Mrnjavac SPDX-FileCopyrightText: 2016 Chantara Tith SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho @@ -22,8 +22,11 @@ #include #include "util/guihelpers.h" +#include + #include #include +#include #include #include @@ -72,7 +75,7 @@ void NewDialog::setupDialog() std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan); - for (const auto &fsName : qAsConst(fsNames)) + for (const auto &fsName : std::as_const(fsNames)) dialogWidget().comboFileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName); QString selected = FileSystem::nameForType(GuiHelpers::defaultFileSystem()); @@ -250,9 +253,9 @@ void NewDialog::updateHideAndShow() dialogWidget().noSetLabel().setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont)); QPalette palette = dialogWidget().noSetLabel().palette(); - QColor f = palette.color(QPalette::Foreground); + QColor f = palette.color(QPalette::WindowText); f.setAlpha(128); - palette.setColor(QPalette::Foreground, f); + palette.setColor(QPalette::WindowText, f); dialogWidget().noSetLabel().setPalette(palette); dialogWidget().checkBoxEncrypt().hide(); dialogWidget().editPassphrase().hide(); diff --git a/src/gui/partpropsdialog.cpp b/src/gui/partpropsdialog.cpp index ef199c6..f550348 100644 --- a/src/gui/partpropsdialog.cpp +++ b/src/gui/partpropsdialog.cpp @@ -1,6 +1,6 @@ /* SPDX-FileCopyrightText: 2008-2010 Volker Lanz - SPDX-FileCopyrightText: 2014-2017 Andrius Štikonas + SPDX-FileCopyrightText: 2014-2020 Andrius Štikonas SPDX-FileCopyrightText: 2014 Yuri Chornoivan SPDX-FileCopyrightText: 2018 Abhijeet Sharma @@ -19,11 +19,14 @@ #include #include "util/guihelpers.h" +#include + #include #include #include #include #include +#include #include #include @@ -200,9 +203,9 @@ void PartPropsDialog::updateHideAndShow() dialogWidget().noSetLabel().setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont)); QPalette palette = dialogWidget().noSetLabel().palette(); - QColor f = palette.color(QPalette::Foreground); + QColor f = palette.color(QPalette::WindowText); f.setAlpha(128); - palette.setColor(QPalette::Foreground, f); + palette.setColor(QPalette::WindowText, f); dialogWidget().noSetLabel().setPalette(palette); } else { dialogWidget().label().setReadOnly(isReadOnly() && !partition().fileSystem().supportSetLabelOnline()); @@ -319,7 +322,7 @@ void PartPropsDialog::setupFileSystemComboBox() std::sort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan); - for (const auto &fsName : qAsConst(fsNames)) + for (const auto &fsName : std::as_const(fsNames)) dialogWidget().fileSystem().addItem(createFileSystemColor(FileSystem::typeForName(fsName), 8), fsName); dialogWidget().fileSystem().setCurrentIndex(dialogWidget().fileSystem().findText(selected)); diff --git a/src/gui/parttablewidget.cpp b/src/gui/parttablewidget.cpp index 0b1e90f..069a71b 100644 --- a/src/gui/parttablewidget.cpp +++ b/src/gui/parttablewidget.cpp @@ -43,6 +43,9 @@ void PartTableWidget::setPartitionTable(const PartitionTable* ptable) PartWidget* w = new PartWidget(this, p); w->setVisible(true); w->setFileSystemColorCode(GuiHelpers::fileSystemColorCodesFromSettings()); + const auto children = w->childWidgets(); + for (const auto &child : children) + child->setFileSystemColorCode(GuiHelpers::fileSystemColorCodesFromSettings()); } } diff --git a/src/gui/resizevolumegroupdialog.cpp b/src/gui/resizevolumegroupdialog.cpp index 1ca4c09..01e7a71 100644 --- a/src/gui/resizevolumegroupdialog.cpp +++ b/src/gui/resizevolumegroupdialog.cpp @@ -1,6 +1,6 @@ /* SPDX-FileCopyrightText: 2016 Chantara Tith - SPDX-FileCopyrightText: 2016-2018 Andrius Štikonas + SPDX-FileCopyrightText: 2016-2020 Andrius Štikonas SPDX-FileCopyrightText: 2018 Caio Jordão Carvalho SPDX-FileCopyrightText: 2019 Yuri Chornoivan @@ -22,6 +22,8 @@ #include #include +#include + #include #include #include @@ -49,14 +51,19 @@ ResizeVolumeGroupDialog::ResizeVolumeGroupDialog(QWidget* parent, VolumeManagerD void ResizeVolumeGroupDialog::setupDialog() { +<<<<<<< HEAD if (device()->type() == Device::Type::LVM_Device) { dialogWidget().volumeType().setCurrentIndex(0); for (const auto &p : qAsConst(LVM::pvList::list())) { +======= + if (dialogWidget().volumeType().currentText() == QStringLiteral("LVM")) { + for (const auto &p : std::as_const(LVM::pvList::list())) { +>>>>>>> master bool toBeDeleted = false; // Ignore partitions that are going to be deleted - for (const auto &o : qAsConst(m_PendingOps)) { + for (const auto &o : std::as_const(m_PendingOps)) { if (dynamic_cast(o) && o->targets(*p.partition())) { toBeDeleted = true; break; @@ -72,9 +79,9 @@ void ResizeVolumeGroupDialog::setupDialog() dialogWidget().listPV().addPartition(*p.partition(), false); } - for (const Device *d : qAsConst(m_Devices)) { + for (const Device *d : std::as_const(m_Devices)) { if (d->partitionTable() != nullptr) { - for (const Partition *p : qAsConst(d->partitionTable()->children())) { + for (const Partition *p : std::as_const(d->partitionTable()->children())) { // Looking if there is another VG creation that contains this partition if (LvmDevice::s_DirtyPVs.contains(p)) continue; @@ -94,7 +101,7 @@ void ResizeVolumeGroupDialog::setupDialog() } } - for (const Partition *p : qAsConst(LvmDevice::s_OrphanPVs)) + for (const Partition *p : std::as_const(LvmDevice::s_OrphanPVs)) if (!LvmDevice::s_DirtyPVs.contains(p)) dialogWidget().listPV().addPartition(*p, false); diff --git a/src/org.kde.partitionmanager.appdata.xml b/src/org.kde.partitionmanager.appdata.xml index 23cf81d..40f78de 100644 --- a/src/org.kde.partitionmanager.appdata.xml +++ b/src/org.kde.partitionmanager.appdata.xml @@ -60,6 +60,7 @@ SPDX-License-Identifier: GPL-3.0-or-later Διαχειρίζεται συσκευές δίσκων, κατατμήσεις και συστήματα αρχείων στον υπολογιστή σας Manage disk devices, partitions and file systems on your computer Gestión de discos, particiones y sistema de archivos de su equipo + Arvuti kettaseadmete, partitsioonide ja failisüsteemide haldamine Kudeatu zure sistemako disko gailuak, partizioak eta fitxategi-sistemak Hallitse tietokoneen levyjä, osioita ja tiedostojärjestelmiä Gérez vos disques, partitions et systèmes de fichiers de votre ordinateur