Calamares::JobResult
SetPartFlagsJob::exec()
{
    cDebug() << "Setting flags on" << m_device->deviceNode()
        << "partition" << partition()->deviceNode()
        << "to" << m_flags;

    Report report ( nullptr );
    SetPartFlagsOperation op( *m_device, *partition(), m_flags );
    op.setStatus( Operation::StatusRunning );
    connect( &op, &Operation::progress, this, &SetPartFlagsJob::iprogress );

    QString errorMessage = tr( "The installer failed to set flags on partition %1." )
                           .arg( m_partition->partitionPath() );
    if ( op.execute( report ) )
        return Calamares::JobResult::ok();

    return Calamares::JobResult::error( errorMessage, report.toText() );
}
Calamares::JobResult
ResizePartitionJob::exec()
{
    Report report (nullptr);
    // Restore partition sectors that were modified for preview
    m_partition->setFirstSector( m_oldFirstSector );
    m_partition->setLastSector( m_oldLastSector );
    ResizeOperation op(*m_device, *m_partition, m_newFirstSector, m_newLastSector);
    op.setStatus(Operation::StatusRunning);
    connect(&op, &Operation::progress, this, &ResizePartitionJob::iprogress );

    QString errorMessage = tr( "The installer failed to resize partition %1 on disk '%2'." )
                       .arg( m_partition->partitionPath() )
                       .arg( m_device->name() );
    if (op.execute(report))
        return Calamares::JobResult::ok();

    return Calamares::JobResult::error(errorMessage, report.toText());
}