diff --git a/CMakeLists.txt b/CMakeLists.txt index 189cd84..dfc878f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ set(VERSION_MAJOR "4") set(VERSION_MINOR "1") set(VERSION_RELEASE "0") set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE}) -set(SOVERSION "9") +set(SOVERSION "10") add_definitions(-D'VERSION="${VERSION}"') #" set(CMAKE_CXX_STANDARD 14) diff --git a/src/core/partition.h b/src/core/partition.h index 7b6c0f8..36d64b0 100644 --- a/src/core/partition.h +++ b/src/core/partition.h @@ -125,6 +125,9 @@ public: const QString& label() const { return m_Label; /**< @return the GPT Partition label */ } + const QString& type() const { + return m_Type; /**< @return the GPT Partition type */ + } const QString& uuid() const { return m_UUID; /**< @return the GPT Partition UUID */ } @@ -210,6 +213,9 @@ public: void setLabel(const QString& s) { m_Label = s; /**< @param s the new label */ } + void setType(const QString& s) { + m_Type = s; /**< @param s the new type */ + } void setUUID(const QString& s) { m_UUID = s; /**< @param s the new UUID */ } @@ -266,6 +272,7 @@ private: qint64 m_LastSector; QString m_DevicePath; QString m_Label; + QString m_Type; QString m_UUID; QString m_PartitionPath; QString m_MountPoint; diff --git a/src/plugins/sfdisk/sfdiskpartitiontable.cpp b/src/plugins/sfdisk/sfdiskpartitiontable.cpp index 5ed36ac..796e042 100644 --- a/src/plugins/sfdisk/sfdiskpartitiontable.cpp +++ b/src/plugins/sfdisk/sfdiskpartitiontable.cpp @@ -215,7 +215,9 @@ static QLatin1String getPartitionType(FileSystem::Type t, PartitionTable::TableT bool SfdiskPartitionTable::setPartitionSystemType(Report& report, const Partition& partition) { - QString partitionType = getPartitionType(partition.fileSystem().type(), m_device->partitionTable()->type()); + QString partitionType = partition.type(); + if (partitionType.isEmpty()) + partitionType = getPartitionType(partition.fileSystem().type(), m_device->partitionTable()->type()); if (partitionType.isEmpty()) return true; ExternalCommand sfdiskCommand(report, QStringLiteral("sfdisk"), { QStringLiteral("--part-type"), m_device->deviceNode(), QString::number(partition.number()),