kpmcore/src/jobs/changepermissionsjob.cpp

43 lines
967 B
C++

/*
SPDX-FileCopyrightText: Tomaz Canabrava <tcanabrava@kde.org>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "jobs/changepermissionsjob.h"
#include "core/lvmdevice.h"
#include "core/partition.h"
#include "util/report.h"
#include <KLocalizedString>
/** Creates a new CreateVolumeGroupJob
* @param permission the new permission for the partition, in chmod style.
* @param partition the partition to change the permission.
*/
ChangePermissionJob::ChangePermissionJob(Partition& partition) :
Job(),
m_Partition(partition)
{
}
bool ChangePermissionJob::run(Report& parent)
{
bool rval = false;
Report* report = jobStarted(parent);
rval = m_Partition.execChangePermission(*report);
jobFinished(*report, rval);
return rval;
}
QString ChangePermissionJob::description() const
{
return xi18nc("@info/plain", "Change the permissions of: <filename>%1</filename> to %2", m_Partition.deviceNode(), m_permissions);
}