mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-22 18:05:45 -05:00
[partition] Handle KPMcore deprecations
This commit is contained in:
parent
e4b198d13b
commit
98f47ee407
2 changed files with 13 additions and 3 deletions
|
@ -41,8 +41,8 @@ if(NOT TARGET calapmcore)
|
||||||
|
|
||||||
target_link_libraries(calapmcore INTERFACE kpmcore ${qtname}::DBus ${kfname}::I18n ${kfname}::WidgetsAddons)
|
target_link_libraries(calapmcore INTERFACE kpmcore ${qtname}::DBus ${kfname}::I18n ${kfname}::WidgetsAddons)
|
||||||
target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR})
|
target_include_directories(calapmcore INTERFACE ${KPMCORE_INCLUDE_DIR})
|
||||||
# If there were KPMcore API variations, figure them out here
|
math(EXPR _kpm_version_number "(0x${KPMcore_VERSION_MAJOR} * 0x10000)+(0x${KPMcore_VERSION_MINOR} * 0x100)+(0x${KPMcore_VERSION_PATCH})" OUTPUT_FORMAT HEXADECIMAL)
|
||||||
# target_compile_definitions(calapmcore INTERFACE WITH_KPMcore)
|
target_compile_definitions(calapmcore INTERFACE WITH_KPMcore=${_kpm_version_number})
|
||||||
|
|
||||||
# Flag that this library has KPMcore support. A variable
|
# Flag that this library has KPMcore support. A variable
|
||||||
# set here has the wrong scope. ENV{} would be visible
|
# set here has the wrong scope. ENV{} would be visible
|
||||||
|
|
|
@ -54,6 +54,16 @@
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QtConcurrent/QtConcurrent>
|
#include <QtConcurrent/QtConcurrent>
|
||||||
|
|
||||||
|
///@brief At some point the msdos_sectorbased partition table type was retired
|
||||||
|
static bool isMSDOSPartition(PartitionTable::TableType t)
|
||||||
|
{
|
||||||
|
#if WITH_KPMcore > 0x240801
|
||||||
|
return t == PartitionTable::TableType::msdos;
|
||||||
|
#else
|
||||||
|
return t == PartitionTable::TableType::msdos || t == PartitionTable::TableType::msdos_sectorbased;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
PartitionPage::PartitionPage( PartitionCoreModule* core, const Config & config, QWidget* parent )
|
PartitionPage::PartitionPage( PartitionCoreModule* core, const Config & config, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, m_ui( new Ui_PartitionPage )
|
, m_ui( new Ui_PartitionPage )
|
||||||
|
@ -253,7 +263,7 @@ PartitionPage::checkCanCreate( Device* device )
|
||||||
{
|
{
|
||||||
auto table = device->partitionTable();
|
auto table = device->partitionTable();
|
||||||
|
|
||||||
if ( table->type() == PartitionTable::msdos || table->type() == PartitionTable::msdos_sectorbased )
|
if ( isMSDOSPartition( table->type() ) )
|
||||||
{
|
{
|
||||||
cDebug() << "Checking MSDOS partition" << table->numPrimaries() << "primaries, max" << table->maxPrimaries();
|
cDebug() << "Checking MSDOS partition" << table->numPrimaries() << "primaries, max" << table->maxPrimaries();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue