X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/2907a34bb54beea207f0a2b816521c75ba571684..bb67def173f31819bb9a696627f9af71c7037dcd:/src/settings/viewpropertiesdialog.cpp diff --git a/src/settings/viewpropertiesdialog.cpp b/src/settings/viewpropertiesdialog.cpp index a1f9718fe..82d182d1d 100644 --- a/src/settings/viewpropertiesdialog.cpp +++ b/src/settings/viewpropertiesdialog.cpp @@ -1,22 +1,9 @@ -/*************************************************************************** - * Copyright (C) 2006 by Peter Penz * - * Copyright (C) 2018 by Elvis Angelaccio * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ +/* + * SPDX-FileCopyrightText: 2006 Peter Penz + * SPDX-FileCopyrightText: 2018 Elvis Angelaccio + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "viewpropertiesdialog.h" @@ -68,7 +55,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : Q_ASSERT(dolphinView); const bool useGlobalViewProps = GeneralSettings::globalViewProps(); - setWindowTitle(i18nc("@title:window", "View Properties")); + setWindowTitle(i18nc("@title:window", "View Display Style")); const QUrl& url = dolphinView->url(); m_viewProps = new ViewProperties(url); @@ -77,7 +64,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : auto layout = new QFormLayout(this); // Otherwise the dialog won't resize when we collapse the KCollapsibleGroupBox. layout->setSizeConstraint(QLayout::SetFixedSize); - setLayout(layout); // create 'Properties' group containing view mode, sorting, sort order and show hidden files m_viewMode = new QComboBox(); @@ -91,7 +77,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : m_sorting = new QComboBox(); const QList rolesInfo = KFileItemModel::rolesInformation(); - foreach (const KFileItemModel::RoleInfo& info, rolesInfo) { + for (const KFileItemModel::RoleInfo& info : rolesInfo) { m_sorting->addItem(info.translation, info.role); } @@ -102,7 +88,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : auto additionalInfoBox = new KCollapsibleGroupBox(); additionalInfoBox->setTitle(i18nc("@title:group", "Additional Information")); - auto innerLayout = new QVBoxLayout(); + auto innerLayout = new QVBoxLayout(additionalInfoBox); { QList visibleRoles = m_viewProps->visibleRoles(); @@ -129,7 +115,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : connect(m_listWidget, &QListWidget::itemChanged, this, &ViewPropertiesDialog::slotItemChanged); m_listWidget->setSelectionMode(QAbstractItemView::NoSelection); const QList rolesInfo = KFileItemModel::rolesInformation(); - foreach (const KFileItemModel::RoleInfo& info, rolesInfo) { + for (const KFileItemModel::RoleInfo& info : rolesInfo) { QListWidgetItem* item = new QListWidgetItem(info.translation, m_listWidget); item->setCheckState(visibleRoles.contains(info.role) ? Qt::Checked : Qt::Unchecked); @@ -146,8 +132,6 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : innerLayout->addWidget(m_listWidget); } - additionalInfoBox->setLayout(innerLayout); - QHBoxLayout* sortingLayout = new QHBoxLayout(); sortingLayout->setContentsMargins(0, 0, 0, 0); sortingLayout->addWidget(m_sortOrder); @@ -225,7 +209,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) : layout->addWidget(buttonBox); auto okButton = buttonBox->button(QDialogButtonBox::Ok); - okButton->setShortcut(Qt::CTRL + Qt::Key_Return); + okButton->setShortcut(Qt::CTRL | Qt::Key_Return); okButton->setDefault(true); auto applyButton = buttonBox->button(QDialogButtonBox::Apply); @@ -322,7 +306,7 @@ void ViewPropertiesDialog::markAsDirty(bool isDirty) { if (m_isDirty != isDirty) { m_isDirty = isDirty; - emit isDirtyChanged(isDirty); + Q_EMIT isDirtyChanged(isDirty); } } @@ -338,7 +322,7 @@ void ViewPropertiesDialog::applyViewProperties() QList visibleRoles; int index = 0; const QList rolesInfo = KFileItemModel::rolesInformation(); - foreach (const KFileItemModel::RoleInfo& info, rolesInfo) { + for (const KFileItemModel::RoleInfo& info : rolesInfo) { const QListWidgetItem* item = m_listWidget->item(index); if (item->checkState() == Qt::Checked) { visibleRoles.append(info.role);