File indexing completed on 2024-05-12 05:48:27
0001 /* 0002 SPDX-FileCopyrightText: 2010-2013 Volker Lanz <vl@fidra.de> 0003 SPDX-FileCopyrightText: 2013-2018 Andrius Štikonas <andrius@stikonas.eu> 0004 SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com> 0005 0006 SPDX-License-Identifier: GPL-3.0-or-later 0007 */ 0008 0009 #include "plugins/dummy/dummypartitiontable.h" 0010 #include "plugins/dummy/dummybackend.h" 0011 0012 #include "core/partition.h" 0013 #include "core/device.h" 0014 0015 #include "fs/filesystem.h" 0016 0017 #include "util/report.h" 0018 0019 DummyPartitionTable::DummyPartitionTable() : 0020 CoreBackendPartitionTable() 0021 { 0022 } 0023 0024 DummyPartitionTable::~DummyPartitionTable() 0025 { 0026 } 0027 0028 bool DummyPartitionTable::open() 0029 { 0030 return true; 0031 } 0032 0033 0034 bool DummyPartitionTable::commit(quint32 timeout) 0035 { 0036 Q_UNUSED(timeout) 0037 0038 return true; 0039 } 0040 0041 QString DummyPartitionTable::createPartition(Report& report, const Partition& partition) 0042 { 0043 Q_UNUSED(report) 0044 Q_UNUSED(partition) 0045 0046 return QStringLiteral("dummy"); 0047 } 0048 0049 bool DummyPartitionTable::deletePartition(Report& report, const Partition& partition) 0050 { 0051 Q_UNUSED(report) 0052 Q_UNUSED(partition) 0053 0054 return true; 0055 } 0056 0057 bool DummyPartitionTable::updateGeometry(Report& report, const Partition& partition, qint64 sector_start, qint64 sector_end) 0058 { 0059 Q_UNUSED(report) 0060 Q_UNUSED(partition) 0061 Q_UNUSED(sector_start) 0062 Q_UNUSED(sector_end) 0063 0064 return true; 0065 } 0066 0067 bool DummyPartitionTable::clobberFileSystem(Report& report, const Partition& partition) 0068 { 0069 Q_UNUSED(report) 0070 Q_UNUSED(partition) 0071 0072 return true; 0073 } 0074 0075 bool DummyPartitionTable::resizeFileSystem(Report& report, const Partition& partition, qint64 newLength) 0076 { 0077 Q_UNUSED(report) 0078 Q_UNUSED(partition) 0079 Q_UNUSED(newLength) 0080 0081 return true; 0082 } 0083 0084 FileSystem::Type DummyPartitionTable::detectFileSystemBySector(Report& report, const Device& device, qint64 sector) 0085 { 0086 Q_UNUSED(report) 0087 Q_UNUSED(device) 0088 Q_UNUSED(sector) 0089 0090 FileSystem::Type rval = FileSystem::Type::Unknown; 0091 return rval; 0092 } 0093 0094 bool DummyPartitionTable::setPartitionSystemType(Report& report, const Partition& partition) 0095 { 0096 Q_UNUSED(report) 0097 Q_UNUSED(partition) 0098 0099 return true; 0100 } 0101 0102 bool DummyPartitionTable::setPartitionLabel(Report& report, const Partition& partition, const QString& label) 0103 { 0104 Q_UNUSED(report) 0105 Q_UNUSED(partition) 0106 Q_UNUSED(label) 0107 0108 return true; 0109 } 0110 0111 QString DummyPartitionTable::getPartitionUUID(Report& report, const Partition& partition) 0112 { 0113 Q_UNUSED(report) 0114 Q_UNUSED(partition) 0115 0116 return QString(); 0117 } 0118 0119 bool DummyPartitionTable::setPartitionUUID(Report& report, const Partition& partition, const QString& uuid) 0120 { 0121 Q_UNUSED(report) 0122 Q_UNUSED(partition) 0123 Q_UNUSED(uuid) 0124 0125 return true; 0126 } 0127 0128 bool DummyPartitionTable::setPartitionAttributes(Report& report, const Partition& partition, quint64 attrs) 0129 { 0130 Q_UNUSED(report) 0131 Q_UNUSED(partition) 0132 Q_UNUSED(attrs) 0133 0134 return true; 0135 } 0136 0137 bool DummyPartitionTable::setFlag(Report& report, const Partition& partition, PartitionTable::Flag partitionManagerFlag, bool state) 0138 { 0139 Q_UNUSED(report) 0140 Q_UNUSED(partition) 0141 Q_UNUSED(partitionManagerFlag) 0142 Q_UNUSED(state) 0143 0144 return true; 0145 }