Improve error reports in setPartitionSystemType
This commit is contained in:
parent
edcd154b80
commit
b629eebe0f
|
@ -344,12 +344,18 @@ FileSystem::Type LibPartedPartitionTable::detectFileSystemBySector(Report& repor
|
||||||
bool LibPartedPartitionTable::setPartitionSystemType(Report& report, const Partition& partition)
|
bool LibPartedPartitionTable::setPartitionSystemType(Report& report, const Partition& partition)
|
||||||
{
|
{
|
||||||
PedFileSystemType* pedFsType = (partition.roles().has(PartitionRole::Extended) || partition.fileSystem().type() == FileSystem::Unformatted) ? NULL : getPedFileSystemType(partition.fileSystem().type());
|
PedFileSystemType* pedFsType = (partition.roles().has(PartitionRole::Extended) || partition.fileSystem().type() == FileSystem::Unformatted) ? NULL : getPedFileSystemType(partition.fileSystem().type());
|
||||||
|
if (pedFsType == NULL)
|
||||||
PedPartition* pedPartition = ped_disk_get_partition_by_sector(pedDisk(), partition.firstSector());
|
|
||||||
|
|
||||||
if (pedFsType == NULL || pedPartition == NULL)
|
|
||||||
{
|
{
|
||||||
report.line() << xi18nc("@info/plain", "Could not update the system type for partition <filename>%1</filename>.", partition.deviceNode());
|
report.line() << xi18nc("@info/plain", "Could not update the system type for partition <filename>%1</filename>.", partition.deviceNode());
|
||||||
|
report.line() << xi18nc("@info/plain", "No file system defined.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
PedPartition* pedPartition = ped_disk_get_partition_by_sector(pedDisk(), partition.firstSector());
|
||||||
|
if (pedPartition == NULL)
|
||||||
|
{
|
||||||
|
report.line() << xi18nc("@info/plain", "Could not update the system type for partition <filename>%1</filename>.", partition.deviceNode());
|
||||||
|
report.line() << xi18nc("@info/plain", "No partition found at sector %1.", partition.firstSector());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue