diff --git a/src/modules/partition/core/PartitionCoreModule.cpp b/src/modules/partition/core/PartitionCoreModule.cpp index 5a842707b..dd1b74426 100644 --- a/src/modules/partition/core/PartitionCoreModule.cpp +++ b/src/modules/partition/core/PartitionCoreModule.cpp @@ -34,6 +34,7 @@ #include "jobs/FillGlobalStorageJob.h" #include "jobs/FormatPartitionJob.h" #include "jobs/ResizePartitionJob.h" +#include "jobs/SetPartitionFlagsJob.h" #include "Typedefs.h" #include "utils/Logger.h" @@ -296,7 +297,10 @@ PartitionCoreModule::formatPartition( Device* device, Partition* partition ) } void -PartitionCoreModule::resizePartition( Device* device, Partition* partition, qint64 first, qint64 last ) +PartitionCoreModule::resizePartition( Device* device, + Partition* partition, + qint64 first, + qint64 last ) { auto deviceInfo = infoForDevice( device ); Q_ASSERT( deviceInfo ); @@ -309,6 +313,22 @@ PartitionCoreModule::resizePartition( Device* device, Partition* partition, qint refresh(); } +void +PartitionCoreModule::setPartitionFlags( Device* device, + Partition* partition, + PartitionTable::Flags flags ) +{ + auto deviceInfo = infoForDevice( device ); + Q_ASSERT( deviceInfo ); + PartitionModel::ResetHelper( partitionModelForDevice( device ) ); + + SetPartFlagsJob* job = new SetPartFlagsJob( device, partition, flags ); + + deviceInfo->jobs << Calamares::job_ptr( job ); + + refresh(); +} + QList< Calamares::job_ptr > PartitionCoreModule::jobs() const { diff --git a/src/modules/partition/core/PartitionCoreModule.h b/src/modules/partition/core/PartitionCoreModule.h index c1d78bb35..27924e2b5 100644 --- a/src/modules/partition/core/PartitionCoreModule.h +++ b/src/modules/partition/core/PartitionCoreModule.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Aurélien Gâteau - * Copyright 2014-2015, Teo Mrnjavac + * Copyright 2014-2016, Teo Mrnjavac * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -89,6 +89,8 @@ public: void resizePartition( Device* device, Partition* partition, qint64 first, qint64 last ); + void setPartitionFlags( Device* device, Partition* partition, PartitionTable::Flags flags ); + void setBootLoaderInstallPath( const QString& path ); QList< Calamares::job_ptr > jobs() const;