Merge branch 'issue-1061'

FIXES #1061
This commit is contained in:
Adriaan de Groot 2019-04-25 06:47:32 -04:00
commit 3ddb49afb7
23 changed files with 107 additions and 56 deletions

View File

@ -2,6 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org> * Copyright 2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -46,9 +47,15 @@ BootLoaderModel::~BootLoaderModel()
void void
BootLoaderModel::init( const QList< Device* >& devices ) BootLoaderModel::init( const QList< Device* >& devices )
{ {
beginResetModel();
blockSignals( true );
m_devices = devices; m_devices = devices;
clear(); clear();
createMbrItems(); createMbrItems();
blockSignals( false );
endResetModel();
} }
void void
@ -69,6 +76,16 @@ BootLoaderModel::update()
{ {
beginResetModel(); beginResetModel();
blockSignals( true ); blockSignals( true );
updateInternal();
blockSignals( false );
endResetModel();
}
void
BootLoaderModel::updateInternal()
{
QMutexLocker lock(&m_lock);
clear(); clear();
createMbrItems(); createMbrItems();
@ -113,14 +130,13 @@ BootLoaderModel::update()
createBootLoaderItem( tr( "Do not install a boot loader" ), QString(), false ) createBootLoaderItem( tr( "Do not install a boot loader" ), QString(), false )
); );
} }
blockSignals( false );
endResetModel();
} }
QVariant QVariant
BootLoaderModel::data( const QModelIndex& index, int role ) const BootLoaderModel::data( const QModelIndex& index, int role ) const
{ {
QMutexLocker lock(&m_lock);
if ( role == Qt::DisplayRole ) if ( role == Qt::DisplayRole )
{ {
QString displayRole = QStandardItemModel::data( index, Qt::DisplayRole ).toString(); QString displayRole = QStandardItemModel::data( index, Qt::DisplayRole ).toString();

View File

@ -2,6 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015, Teo Mrnjavac <teo@kde.org> * Copyright 2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -19,8 +20,9 @@
#ifndef BOOTLOADERMODEL_H #ifndef BOOTLOADERMODEL_H
#define BOOTLOADERMODEL_H #define BOOTLOADERMODEL_H
#include <QStandardItemModel>
#include <QList> #include <QList>
#include <QMutex>
#include <QStandardItemModel>
class Device; class Device;
@ -51,10 +53,14 @@ public:
QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override; QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;
using DeviceList = QList< Device* >;
private: private:
QList< Device* > m_devices; DeviceList m_devices;
mutable QMutex m_lock;
void createMbrItems(); void createMbrItems();
void updateInternal();
}; };
#endif /* BOOTLOADERMODEL_H */ #endif /* BOOTLOADERMODEL_H */

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2014, Teo Mrnjavac <teo@kde.org> * Copyright 2014, Teo Mrnjavac <teo@kde.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -35,6 +36,15 @@
// STL // STL
#include <algorithm> #include <algorithm>
static void
sortDevices( DeviceModel::DeviceList& l )
{
std::sort( l.begin(), l.end(), []( const Device* dev1, const Device* dev2 )
{
return dev1->deviceNode() < dev2->deviceNode();
} );
}
DeviceModel::DeviceModel( QObject* parent ) DeviceModel::DeviceModel( QObject* parent )
: QAbstractListModel( parent ) : QAbstractListModel( parent )
{ {
@ -45,14 +55,11 @@ DeviceModel::~DeviceModel()
} }
void void
DeviceModel::init( const QList< Device* >& devices ) DeviceModel::init( const DeviceList& devices )
{ {
beginResetModel(); beginResetModel();
m_devices = devices; m_devices = devices;
std::sort( m_devices.begin(), m_devices.end(), []( const Device* dev1, const Device* dev2 ) sortDevices( m_devices );
{
return dev1->deviceNode() < dev2->deviceNode();
} );
endResetModel(); endResetModel();
} }
@ -138,13 +145,8 @@ void
DeviceModel::addDevice( Device *device ) DeviceModel::addDevice( Device *device )
{ {
beginResetModel(); beginResetModel();
m_devices << device; m_devices << device;
std::sort( m_devices.begin(), m_devices.end(), []( const Device* dev1, const Device* dev2 ) sortDevices( m_devices );
{
return dev1->deviceNode() < dev2->deviceNode();
} );
endResetModel(); endResetModel();
} }
@ -152,12 +154,7 @@ void
DeviceModel::removeDevice( Device *device ) DeviceModel::removeDevice( Device *device )
{ {
beginResetModel(); beginResetModel();
m_devices.removeAll( device ); m_devices.removeAll( device );
std::sort( m_devices.begin(), m_devices.end(), []( const Device* dev1, const Device* dev2 ) sortDevices( m_devices );
{
return dev1->deviceNode() < dev2->deviceNode();
} );
endResetModel(); endResetModel();
} }

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org> * Copyright 2017, 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -36,11 +36,13 @@ public:
DeviceModel( QObject* parent = nullptr ); DeviceModel( QObject* parent = nullptr );
~DeviceModel() override; ~DeviceModel() override;
using DeviceList = QList< Device* >;
/** /**
* Init the model with the list of devices. Does *not* take ownership of the * Init the model with the list of devices. Does *not* take ownership of the
* devices. * devices.
*/ */
void init( const QList< Device* >& devices ); void init( const DeviceList& devices );
int rowCount( const QModelIndex& parent = QModelIndex() ) const override; int rowCount( const QModelIndex& parent = QModelIndex() ) const override;
QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override; QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override;
@ -54,7 +56,7 @@ public:
void removeDevice( Device* device ); void removeDevice( Device* device );
private: private:
QList< Device* > m_devices; DeviceList m_devices;
}; };
#endif /* DEVICEMODEL_H */ #endif /* DEVICEMODEL_H */

View File

@ -2,7 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019 Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -2,6 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019 Adriaan de Groot <groot@kde.org>
* Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com> * Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019 Adriaan de Groot <groot@kde.org>
* Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com> * Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org> * Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org> * Copyright 2017-2019, Adriaan de Groot <groot@kde.org>
* Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com> * Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify

View File

@ -2,7 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> * Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017-2018, Adriaan de Groot <groot@kde.org> * Copyright 2017-2019, Adriaan de Groot <groot@kde.org>
* Copyright 2018, Caio Carvalho <caiojcarvalho@gmail.com> * Copyright 2018, Caio Carvalho <caiojcarvalho@gmail.com>
* Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com> * Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com>
* *

View File

@ -2,6 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -40,11 +40,16 @@
PartitionModel::ResetHelper::ResetHelper( PartitionModel* model ) PartitionModel::ResetHelper::ResetHelper( PartitionModel* model )
: m_model( model ) : m_model( model )
{ {
m_model->m_lock.lock();
m_model->beginResetModel(); m_model->beginResetModel();
} }
PartitionModel::ResetHelper::~ResetHelper() PartitionModel::ResetHelper::~ResetHelper()
{ {
// We need to unlock the mutex before emitting the reset signal,
// because the reset will cause clients to start looking at the
// (new) data.
m_model->m_lock.unlock();
m_model->endResetModel(); m_model->endResetModel();
} }
@ -58,6 +63,7 @@ PartitionModel::PartitionModel( QObject* parent )
void void
PartitionModel::init( Device* device , const OsproberEntryList& osproberEntries ) PartitionModel::init( Device* device , const OsproberEntryList& osproberEntries )
{ {
QMutexLocker lock(&m_lock);
beginResetModel(); beginResetModel();
m_device = device; m_device = device;
m_osproberEntries = osproberEntries; m_osproberEntries = osproberEntries;
@ -271,6 +277,7 @@ PartitionModel::headerData( int section, Qt::Orientation, int role ) const
Partition* Partition*
PartitionModel::partitionForIndex( const QModelIndex& index ) const PartitionModel::partitionForIndex( const QModelIndex& index ) const
{ {
QMutexLocker lock(&m_lock);
if ( !index.isValid() ) if ( !index.isValid() )
return nullptr; return nullptr;
return reinterpret_cast< Partition* >( index.internalPointer() ); return reinterpret_cast< Partition* >( index.internalPointer() );

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org> * Copyright 2017, 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -23,6 +23,7 @@
// Qt // Qt
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include <QMutex>
class Device; class Device;
class Partition; class Partition;
@ -115,8 +116,11 @@ public:
void update(); void update();
private: private:
friend class ResetHelper;
Device* m_device; Device* m_device;
OsproberEntryList m_osproberEntries; OsproberEntryList m_osproberEntries;
mutable QMutex m_lock;
}; };
#endif /* PARTITIONMODEL_H */ #endif /* PARTITIONMODEL_H */

View File

@ -2,7 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2016, Teo Mrnjavac <teo@kde.org> * Copyright 2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019 Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -2,7 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019, Adriaan de Groot <groot@kde.org>
* Copyright 2018, Andrius Štikonas <andrius@stikonas.eu> * Copyright 2018, Andrius Štikonas <andrius@stikonas.eu>
* Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com> * Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com>
* Copyright 2019, Collabora Ltd * Copyright 2019, Collabora Ltd
@ -512,7 +512,8 @@ findBootloader( const QAbstractItemModel* model, const QString& path )
for ( int i = 0; i < model->rowCount(); ++i) for ( int i = 0; i < model->rowCount(); ++i)
{ {
const auto index = model->index( i, 0, QModelIndex() ); const auto index = model->index( i, 0, QModelIndex() );
cDebug() << i << model->itemData( index ); if ( !index.isValid() )
continue;
QVariant var = model->data( index, BootLoaderModel::BootLoaderPathRole ); QVariant var = model->data( index, BootLoaderModel::BootLoaderPathRole );
if ( var.isValid() && var.toString() == path ) if ( var.isValid() && var.toString() == path )
return i; return i;

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019, Adriaan de Groot <groot@kde.org>
* Copyright 2019, Collabora Ltd * Copyright 2019, Collabora Ltd
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify

View File

@ -2,7 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org> * Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org> * Copyright 2018-2019, Adriaan de Groot <groot@kde.org>
* Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com> * Copyright 2019, Collabora Ltd <arnaud.ferraris@collabora.com>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
@ -60,8 +60,6 @@
#include <QtConcurrent/QtConcurrent> #include <QtConcurrent/QtConcurrent>
#include <QFutureWatcher> #include <QFutureWatcher>
#include <unistd.h> // For sleep(3)
PartitionViewStep::PartitionViewStep( QObject* parent ) PartitionViewStep::PartitionViewStep( QObject* parent )
: Calamares::ViewStep( parent ) : Calamares::ViewStep( parent )
, m_core( nullptr ) , m_core( nullptr )
@ -92,15 +90,16 @@ void
PartitionViewStep::continueLoading() PartitionViewStep::continueLoading()
{ {
Q_ASSERT( !m_choicePage ); Q_ASSERT( !m_choicePage );
Q_ASSERT( !m_manualPartitionPage );
m_manualPartitionPage = new PartitionPage( m_core );
m_choicePage = new ChoicePage( m_swapChoices ); m_choicePage = new ChoicePage( m_swapChoices );
m_choicePage->init( m_core ); m_choicePage->init( m_core );
m_widget->addWidget( m_choicePage ); m_widget->addWidget( m_choicePage );
m_widget->addWidget( m_manualPartitionPage );
// Instantiate the manual partitioning page as needed.
//
Q_ASSERT( !m_manualPartitionPage );
// m_manualPartitionPage = new PartitionPage( m_core );
// m_widget->addWidget( m_manualPartitionPage );
m_widget->removeWidget( m_waitingWidget ); m_widget->removeWidget( m_waitingWidget );
m_waitingWidget->deleteLater(); m_waitingWidget->deleteLater();
m_waitingWidget = nullptr; m_waitingWidget = nullptr;
@ -289,6 +288,12 @@ PartitionViewStep::next()
{ {
if ( m_choicePage->currentChoice() == ChoicePage::Manual ) if ( m_choicePage->currentChoice() == ChoicePage::Manual )
{ {
if ( !m_manualPartitionPage )
{
m_manualPartitionPage = new PartitionPage( m_core );
m_widget->addWidget( m_manualPartitionPage );
}
m_widget->setCurrentWidget( m_manualPartitionPage ); m_widget->setCurrentWidget( m_manualPartitionPage );
m_manualPartitionPage->selectDeviceByIndex( m_choicePage->lastSelectedDeviceIndex() ); m_manualPartitionPage->selectDeviceByIndex( m_choicePage->lastSelectedDeviceIndex() );
if ( m_core->isDirty() ) if ( m_core->isDirty() )
@ -306,6 +311,12 @@ PartitionViewStep::back()
{ {
m_widget->setCurrentWidget( m_choicePage ); m_widget->setCurrentWidget( m_choicePage );
m_choicePage->setLastSelectedDeviceIndex( m_manualPartitionPage->selectedDeviceIndex() ); m_choicePage->setLastSelectedDeviceIndex( m_manualPartitionPage->selectedDeviceIndex() );
if ( m_manualPartitionPage )
{
m_manualPartitionPage->deleteLater();
m_manualPartitionPage = nullptr;
}
} }
} }
@ -313,10 +324,10 @@ PartitionViewStep::back()
bool bool
PartitionViewStep::isNextEnabled() const PartitionViewStep::isNextEnabled() const
{ {
if ( m_choicePage && m_choicePage == m_widget->currentWidget() ) if ( m_choicePage && m_widget->currentWidget() == m_choicePage )
return m_choicePage->isNextEnabled(); return m_choicePage->isNextEnabled();
if ( m_manualPartitionPage && m_manualPartitionPage == m_widget->currentWidget() ) if ( m_manualPartitionPage && m_widget->currentWidget() == m_manualPartitionPage )
return m_core->hasRootMountPoint(); return m_core->hasRootMountPoint();
return false; return false;
@ -333,7 +344,7 @@ PartitionViewStep::isBackEnabled() const
bool bool
PartitionViewStep::isAtBeginning() const PartitionViewStep::isAtBeginning() const
{ {
if ( m_widget->currentWidget() == m_manualPartitionPage ) if ( m_widget->currentWidget() != m_choicePage )
return false; return false;
return true; return true;
} }
@ -342,7 +353,7 @@ PartitionViewStep::isAtBeginning() const
bool bool
PartitionViewStep::isAtEnd() const PartitionViewStep::isAtEnd() const
{ {
if ( m_choicePage == m_widget->currentWidget() ) if ( m_widget->currentWidget() == m_choicePage )
{ {
if ( m_choicePage->currentChoice() == ChoicePage::Erase || if ( m_choicePage->currentChoice() == ChoicePage::Erase ||
m_choicePage->currentChoice() == ChoicePage::Replace || m_choicePage->currentChoice() == ChoicePage::Replace ||

View File

@ -2,6 +2,7 @@
* *
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org> * Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com> * Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -29,8 +30,8 @@
#include <QSpinBox> #include <QSpinBox>
ResizeVolumeGroupDialog::ResizeVolumeGroupDialog( LvmDevice *device, ResizeVolumeGroupDialog::ResizeVolumeGroupDialog( LvmDevice *device,
QVector< const Partition* > availablePVs, const PartitionVector& availablePVs,
QVector< const Partition* >& selectedPVs, PartitionVector& selectedPVs,
QWidget* parent ) QWidget* parent )
: VolumeGroupBaseDialog( device->name(), device->physicalVolumes(), parent ) : VolumeGroupBaseDialog( device->name(), device->physicalVolumes(), parent )
, m_selectedPVs( selectedPVs ) , m_selectedPVs( selectedPVs )

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com> * Copyright 2018, Caio Jordão Carvalho <caiojcarvalho@gmail.com>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,15 +27,17 @@ class LvmDevice;
class ResizeVolumeGroupDialog : public VolumeGroupBaseDialog class ResizeVolumeGroupDialog : public VolumeGroupBaseDialog
{ {
public: public:
using PartitionVector = QVector< const Partition* >;
ResizeVolumeGroupDialog( LvmDevice *device, ResizeVolumeGroupDialog( LvmDevice *device,
QVector< const Partition* > availablePVs, const PartitionVector& availablePVs,
QVector< const Partition* >& selectedPVs, PartitionVector& selectedPVs,
QWidget* parent ); QWidget* parent );
void accept() override; void accept() override;
private: private:
QVector< const Partition* >& m_selectedPVs; PartitionVector& m_selectedPVs;
}; };
#endif // RESIZEVOLUMEGROUPDIALOG_H #endif // RESIZEVOLUMEGROUPDIALOG_H

View File

@ -2,7 +2,7 @@
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2015-2016, Teo Mrnjavac <teo@kde.org> * Copyright 2015-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org> * Copyright 2017, 2019, Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://github.com/calamares> ===
* *
* Copyright 2014, Aurélien Gâteau <agateau@kde.org> * Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org> * Copyright 2017, 2019 Adriaan de Groot <groot@kde.org>
* *
* Calamares is free software: you can redistribute it and/or modify * Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by