X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/9aee5d22513f0367febab54b38b3a7dc58d120bb..d0898592a17d14fc8d48fc5cba71f3d57f0a1856:/src/settings/viewpropsprogressinfo.cpp diff --git a/src/settings/viewpropsprogressinfo.cpp b/src/settings/viewpropsprogressinfo.cpp index 56fee8027..cd4ff379c 100644 --- a/src/settings/viewpropsprogressinfo.cpp +++ b/src/settings/viewpropsprogressinfo.cpp @@ -1,50 +1,35 @@ -/*************************************************************************** - * 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 + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ #include "viewpropsprogressinfo.h" + #include "applyviewpropsjob.h" +#include "views/viewproperties.h" + +#include +#include +#include #include #include +#include #include #include -#include -#include - -#include -#include -#include - -#include ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent, const QUrl& dir, const ViewProperties& viewProps) : QDialog(parent), m_dir(dir), - m_viewProps(0), - m_label(0), - m_progressBar(0), - m_dirSizeJob(0), - m_applyViewPropsJob(0), - m_timer(0) + 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())); @@ -54,12 +39,11 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent, m_viewProps = new ViewProperties(dir); m_viewProps->setDirProperties(viewProps); - // the view properties are stored by the ViewPropsApplierJob, so prevent + // the view properties are stored by the ApplyViewPropsJob, so prevent // that the view properties are saved twice: 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); @@ -96,13 +80,13 @@ ViewPropsProgressInfo::ViewPropsProgressInfo(QWidget* parent, ViewPropsProgressInfo::~ViewPropsProgressInfo() { delete m_viewProps; - m_viewProps = 0; + m_viewProps = nullptr; } void ViewPropsProgressInfo::closeEvent(QCloseEvent* event) { m_timer->stop(); - m_applyViewPropsJob = 0; + m_applyViewPropsJob = nullptr; QDialog::closeEvent(event); } @@ -110,12 +94,12 @@ void ViewPropsProgressInfo::reject() { if (m_dirSizeJob) { m_dirSizeJob->kill(); - m_dirSizeJob = 0; + m_dirSizeJob = nullptr; } if (m_applyViewPropsJob) { m_applyViewPropsJob->kill(); - m_applyViewPropsJob = 0; + m_applyViewPropsJob = nullptr; } QDialog::reject(); @@ -144,7 +128,7 @@ void ViewPropsProgressInfo::applyViewProperties() m_label->setText(i18nc("@info:progress", "Folders: %1", subdirs)); m_progressBar->setMaximum(subdirs); - m_dirSizeJob = 0; + m_dirSizeJob = nullptr; m_applyViewPropsJob = new ApplyViewPropsJob(m_dir, *m_viewProps); connect(m_applyViewPropsJob, &ApplyViewPropsJob::result,