]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/viewpropsprogressinfo.cpp
SVN_SILENT made messages (.desktop file) - always resolve ours
[dolphin.git] / src / settings / viewpropsprogressinfo.cpp
index 44b7a4c8cedfb55d9068eebe26926b45018f2aee..fd5397bad65f9fcf58767041a18a108f71cb0aca 100644 (file)
@@ -1,29 +1,14 @@
-/***************************************************************************
- *   Copyright (C) 2006 by Peter Penz                                      *
- *   peter.penz@gmx.at                                                     *
- *                                                                         *
- *   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 <peter.penz@gmx.at>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
 
 #include "viewpropsprogressinfo.h"
 
 #include "applyviewpropsjob.h"
 #include "views/viewproperties.h"
 
-#include <KConfigGroup>
 #include <KLocalizedString>
 
 #include <QDialogButtonBox>
 #include <QTimer>
 #include <QVBoxLayout>
 
-ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
-                                             const QUrl& dir,
-                                             const ViewProperties& viewProps) :
-    QDialog(parent),
-    m_dir(dir),
-    m_viewProps(nullptr),
-    m_label(nullptr),
-    m_progressBar(nullptr),
-    m_dirSizeJob(nullptr),
-    m_applyViewPropsJob(nullptr),
-    m_timer(nullptr)
+ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget *parent, const QUrl &dir, const ViewProperties &viewProps)
+    : QDialog(parent)
+    , m_dir(dir)
+    , m_viewProps(nullptr)
+    , m_label(nullptr)
+    , m_progressBar(nullptr)
+    , m_dirSizeJob(nullptr)
+    , m_applyViewPropsJob(nullptr)
+    , m_timer(nullptr)
 {
     const QSize minSize = minimumSize();
     setMinimumSize(QSize(320, minSize.height()));
@@ -58,7 +41,6 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
     m_viewProps->setAutoSaveEnabled(false);
 
     auto layout = new QVBoxLayout(this);
-    setLayout(layout);
 
     m_label = new QLabel(i18nc("@info:progress", "Counting folders: %1", 0), this);
     layout->addWidget(m_label);
@@ -80,15 +62,13 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent,
     // allows to give a progress indication for the user when applying the view
     // properties later.
     m_dirSizeJob = KIO::directorySize(dir);
-    connect(m_dirSizeJob, &KIO::DirectorySizeJob::result,
-            this, &ViewPropsProgressInfo::applyViewProperties);
+    connect(m_dirSizeJob, &KIO::DirectorySizeJob::result, this, &ViewPropsProgressInfo::applyViewProperties);
 
     // The directory size job cannot emit any progress signal, as it is not aware
     // about the total number of directories. Therefor a timer is triggered, which
     // periodically updates the current directory count.
     m_timer = new QTimer(this);
-    connect(m_timer, &QTimer::timeout,
-            this, &ViewPropsProgressInfo::updateProgress);
+    connect(m_timer, &QTimer::timeout, this, &ViewPropsProgressInfo::updateProgress);
     m_timer->start(300);
 }
 
@@ -98,7 +78,7 @@ ViewPropsProgressInfo::~ViewPropsProgressInfo()
     m_viewProps = nullptr;
 }
 
-void ViewPropsProgressInfo::closeEvent(QCloseEventevent)
+void ViewPropsProgressInfo::closeEvent(QCloseEvent *event)
 {
     m_timer->stop();
     m_applyViewPropsJob = nullptr;
@@ -146,7 +126,7 @@ void ViewPropsProgressInfo::applyViewProperties()
     m_dirSizeJob = nullptr;
 
     m_applyViewPropsJob = new ApplyViewPropsJob(m_dir, *m_viewProps);
-    connect(m_applyViewPropsJob, &ApplyViewPropsJob::result,
-            this, &ViewPropsProgressInfo::close);
+    connect(m_applyViewPropsJob, &ApplyViewPropsJob::result, this, &ViewPropsProgressInfo::close);
 }
 
+#include "moc_viewpropsprogressinfo.cpp"