mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 17:35:37 -04:00
[partition] Lock the bootloader model during reset
- Try to avoid races between resetting the model and getting data from it for the UI.
This commit is contained in:
parent
b03d72952b
commit
752a922bde
2 changed files with 18 additions and 4 deletions
|
@ -69,6 +69,16 @@ BootLoaderModel::update()
|
|||
{
|
||||
beginResetModel();
|
||||
blockSignals( true );
|
||||
updateInternal();
|
||||
blockSignals( false );
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BootLoaderModel::updateInternal()
|
||||
{
|
||||
QMutexLocker lock(&m_lock);
|
||||
clear();
|
||||
createMbrItems();
|
||||
|
||||
|
@ -113,14 +123,13 @@ BootLoaderModel::update()
|
|||
createBootLoaderItem( tr( "Do not install a boot loader" ), QString(), false )
|
||||
);
|
||||
}
|
||||
blockSignals( false );
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
QVariant
|
||||
BootLoaderModel::data( const QModelIndex& index, int role ) const
|
||||
{
|
||||
QMutexLocker lock(&m_lock);
|
||||
if ( role == Qt::DisplayRole )
|
||||
{
|
||||
QString displayRole = QStandardItemModel::data( index, Qt::DisplayRole ).toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue