File indexing completed on 2024-04-28 05:45:54
0001 /* 0002 SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com> 0003 0004 SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #ifndef KPMCORE_SETPARTITIONNAMEJOB_H 0008 #define KPMCORE_SETPARTITIONNAMEJOB_H 0009 0010 #include "jobs/job.h" 0011 0012 class Partition; 0013 class Device; 0014 class Report; 0015 0016 class QString; 0017 0018 /** Set a Partition label (GPT only). 0019 @author Gaël PORTAY <gael.portay@collabora.com> 0020 */ 0021 class SetPartitionLabelJob : public Job 0022 { 0023 public: 0024 SetPartitionLabelJob(Device& d, Partition& p, const QString& newLabel); 0025 0026 public: 0027 bool run(Report& parent) override; 0028 QString description() const override; 0029 0030 protected: 0031 Partition& partition() { 0032 return m_Partition; 0033 } 0034 const Partition& partition() const { 0035 return m_Partition; 0036 } 0037 0038 Device& device() { 0039 return m_Device; 0040 } 0041 const Device& device() const { 0042 return m_Device; 0043 } 0044 0045 const QString& label() const { 0046 return m_Label; 0047 } 0048 void setLabel(const QString& l) { 0049 m_Label = l; 0050 } 0051 0052 private: 0053 Device& m_Device; 0054 Partition& m_Partition; 0055 QString m_Label; 0056 }; 0057 0058 #endif