]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/kcm/kcmdolphinviewmodes.cpp
Merge branch 'release/20.08'
[dolphin.git] / src / settings / kcm / kcmdolphinviewmodes.cpp
index 71364bf5cb9d3b0774473c8b154f6114161d7e47..5ab53e9b9dd3d65e0735b972e95e65df2c02af80 100644 (file)
@@ -1,48 +1,33 @@
-/***************************************************************************
- *   Copyright (C) 2008 by Peter Penz <peter.penz19@gmail.com>             *
- *                                                                         *
- *   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 <peter.penz19@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "kcmdolphinviewmodes.h"
 
+#include "settings/viewmodes/viewsettingstab.h"
+
 #include <KLocalizedString>
 #include <KPluginFactory>
 #include <KPluginLoader>
-#include <QIcon>
-
-#include <settings/viewmodes/viewsettingstab.h>
 
 #include <QDBusConnection>
 #include <QDBusMessage>
-#include <QVBoxLayout>
+#include <QIcon>
 #include <QTabWidget>
+#include <QVBoxLayout>
 
 K_PLUGIN_FACTORY(KCMDolphinViewModesConfigFactory, registerPlugin<DolphinViewModesConfigModule>(QStringLiteral("dolphinviewmodes"));)
 
-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);
-    topLayout->setMargin(0);
+    topLayout->setContentsMargins(0, 0, 0, 0);
 
     QTabWidget* tabWidget = new QTabWidget(this);
 
@@ -65,7 +50,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 +59,7 @@ DolphinViewModesConfigModule::~DolphinViewModesConfigModule()
 
 void DolphinViewModesConfigModule::save()
 {
-    foreach (ViewSettingsTab* tab, m_tabs) {
+    for (ViewSettingsTab *tab : qAsConst(m_tabs)) {
         tab->applySettings();
     }
     reparseConfiguration();
@@ -82,7 +67,7 @@ void DolphinViewModesConfigModule::save()
 
 void DolphinViewModesConfigModule::defaults()
 {
-    foreach (ViewSettingsTab* tab, m_tabs) {
+    for (ViewSettingsTab *tab : qAsConst(m_tabs)) {
         tab->restoreDefaultSettings();
     }
     reparseConfiguration();
@@ -90,13 +75,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"