X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4315e5c9380e22eed483f00adac3d075369eae49..2f5e4cb02933e3317098bdf090b3f6103061d4ae:/src/settings/kcm/kcmdolphinviewmodes.cpp diff --git a/src/settings/kcm/kcmdolphinviewmodes.cpp b/src/settings/kcm/kcmdolphinviewmodes.cpp index 584b7f64c..57698e0a9 100644 --- a/src/settings/kcm/kcmdolphinviewmodes.cpp +++ b/src/settings/kcm/kcmdolphinviewmodes.cpp @@ -1,21 +1,8 @@ -/*************************************************************************** - * Copyright (C) 2008 by Peter Penz * - * * - * 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: 2008 Peter Penz + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "kcmdolphinviewmodes.h" @@ -23,7 +10,6 @@ #include #include -#include #include #include @@ -31,14 +17,12 @@ #include #include -K_PLUGIN_FACTORY(KCMDolphinViewModesConfigFactory, registerPlugin(QStringLiteral("dolphinviewmodes"));) +K_PLUGIN_CLASS_WITH_JSON(DolphinViewModesConfigModule, "kcmdolphinviewmodes.json") -DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, const QVariantList& args) : - KCModule(parent), +DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget *parent, const QVariantList &args) : + KCModule(parent, args), m_tabs() { - Q_UNUSED(args); - setButtons(KCModule::Default | KCModule::Help); QVBoxLayout* topLayout = new QVBoxLayout(this); @@ -65,7 +49,7 @@ DolphinViewModesConfigModule::DolphinViewModesConfigModule(QWidget* parent, cons m_tabs.append(compactTab); m_tabs.append(detailsTab); - topLayout->addWidget(tabWidget, 0, nullptr); + topLayout->addWidget(tabWidget, 0, {}); } DolphinViewModesConfigModule::~DolphinViewModesConfigModule() @@ -74,7 +58,7 @@ DolphinViewModesConfigModule::~DolphinViewModesConfigModule() void DolphinViewModesConfigModule::save() { - foreach (ViewSettingsTab* tab, m_tabs) { + for (ViewSettingsTab *tab : qAsConst(m_tabs)) { tab->applySettings(); } reparseConfiguration(); @@ -82,7 +66,7 @@ void DolphinViewModesConfigModule::save() void DolphinViewModesConfigModule::defaults() { - foreach (ViewSettingsTab* tab, m_tabs) { + for (ViewSettingsTab *tab : qAsConst(m_tabs)) { tab->restoreDefaultSettings(); } reparseConfiguration(); @@ -90,13 +74,15 @@ void DolphinViewModesConfigModule::defaults() void DolphinViewModesConfigModule::reparseConfiguration() { - QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KonqMain"), QStringLiteral("org.kde.Konqueror.Main"), QStringLiteral("reparseConfiguration")); + QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/KonqMain"), + QStringLiteral("org.kde.Konqueror.Main"), + QStringLiteral("reparseConfiguration")); QDBusConnection::sessionBus().send(message); } void DolphinViewModesConfigModule::viewModeChanged() { - emit changed(true); + markAsChanged(); } #include "kcmdolphinviewmodes.moc"