Warning, file /office/calligra/gemini/ProgressProxy.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2012 KO GmbH. Contact : Boudewijn Rempt <boud@kogmbh.com> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #include "ProgressProxy.h" 0007 0008 class ProgressProxy::Private 0009 { 0010 public: 0011 int minimum; 0012 int maximum; 0013 QString taskName; 0014 }; 0015 0016 ProgressProxy::ProgressProxy(QObject *parent) 0017 : QObject(parent), d(new Private) 0018 { 0019 } 0020 0021 ProgressProxy::~ProgressProxy() 0022 { 0023 0024 } 0025 0026 QString ProgressProxy::taskName() const 0027 { 0028 return d->taskName; 0029 } 0030 0031 void ProgressProxy::setFormat(const QString& format) 0032 { 0033 if ( format != d->taskName ) { 0034 d->taskName = format; 0035 emit taskNameChanged(); 0036 } 0037 } 0038 0039 void ProgressProxy::setRange(int minimum, int maximum) 0040 { 0041 d->minimum = minimum; 0042 d->maximum = maximum; 0043 } 0044 0045 void ProgressProxy::setValue(int value) 0046 { 0047 if (value == d->minimum) { 0048 emit taskStarted(); 0049 } 0050 0051 if (value == d->maximum) { 0052 emit taskEnded(); 0053 } 0054 0055 emit valueChanged(value); 0056 } 0057 0058 int ProgressProxy::maximum() const 0059 { 0060 return d->maximum; 0061 } 0062