2017-12-20 14:39:09 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
2014-07-18 14:29:27 +02:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2014 Aurélien Gâteau <agateau@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2014-07-18 14:29:27 +02:00
|
|
|
*
|
|
|
|
* Calamares 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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares 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 Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-06-14 22:59:40 +02:00
|
|
|
#include "PartitionJob.h"
|
2014-07-18 14:29:27 +02:00
|
|
|
|
|
|
|
PartitionJob::PartitionJob( Partition* partition )
|
|
|
|
: m_partition( partition )
|
2020-04-07 11:36:40 +02:00
|
|
|
{
|
|
|
|
}
|
2017-12-14 22:09:54 +01:00
|
|
|
|
2020-04-07 11:36:40 +02:00
|
|
|
void
|
|
|
|
PartitionJob::iprogress( int percent )
|
2017-12-14 22:09:54 +01:00
|
|
|
{
|
|
|
|
if ( percent < 0 )
|
2020-04-07 11:36:40 +02:00
|
|
|
{
|
2017-12-14 22:09:54 +01:00
|
|
|
percent = 0;
|
2020-04-07 11:36:40 +02:00
|
|
|
}
|
2017-12-14 22:09:54 +01:00
|
|
|
if ( percent > 100 )
|
2020-04-07 11:36:40 +02:00
|
|
|
{
|
2017-12-14 22:09:54 +01:00
|
|
|
percent = 100;
|
2020-04-07 11:36:40 +02:00
|
|
|
}
|
2017-12-14 22:09:54 +01:00
|
|
|
emit progress( qreal( percent / 100.0 ) );
|
|
|
|
}
|