[partition] Use a "real" slot for UniqueConnection
This commit is contained in:
parent
c69e229be0
commit
9d1fec3668
@ -563,6 +563,14 @@ PartitionPage::restoreSelectedBootLoader()
|
|||||||
Calamares::restoreSelectedBootLoader( *( m_ui->bootLoaderComboBox ), m_core->bootLoaderInstallPath() );
|
Calamares::restoreSelectedBootLoader( *( m_ui->bootLoaderComboBox ), m_core->bootLoaderInstallPath() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PartitionPage::reconcileSelections()
|
||||||
|
{
|
||||||
|
QModelIndex selectedIndex = m_ui->partitionBarsView->selectionModel()->currentIndex();
|
||||||
|
selectedIndex = selectedIndex.sibling( selectedIndex.row(), 0 );
|
||||||
|
m_ui->partitionBarsView->setCurrentIndex( selectedIndex );
|
||||||
|
m_ui->partitionLabelsView->setCurrentIndex( selectedIndex );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PartitionPage::updateFromCurrentDevice()
|
PartitionPage::updateFromCurrentDevice()
|
||||||
@ -605,18 +613,11 @@ PartitionPage::updateFromCurrentDevice()
|
|||||||
// This is necessary because even with the same selection model it might happen that
|
// This is necessary because even with the same selection model it might happen that
|
||||||
// a !=0 column is selected in the tree view, which for some reason doesn't trigger a
|
// a !=0 column is selected in the tree view, which for some reason doesn't trigger a
|
||||||
// timely repaint in the bars view.
|
// timely repaint in the bars view.
|
||||||
connect(
|
connect( m_ui->partitionBarsView->selectionModel(),
|
||||||
m_ui->partitionBarsView->selectionModel(),
|
&QItemSelectionModel::currentChanged,
|
||||||
&QItemSelectionModel::currentChanged,
|
this,
|
||||||
this,
|
&PartitionPage::reconcileSelections,
|
||||||
[ = ]
|
Qt::UniqueConnection );
|
||||||
{
|
|
||||||
QModelIndex selectedIndex = m_ui->partitionBarsView->selectionModel()->currentIndex();
|
|
||||||
selectedIndex = selectedIndex.sibling( selectedIndex.row(), 0 );
|
|
||||||
m_ui->partitionBarsView->setCurrentIndex( selectedIndex );
|
|
||||||
m_ui->partitionLabelsView->setCurrentIndex( selectedIndex );
|
|
||||||
},
|
|
||||||
Qt::UniqueConnection );
|
|
||||||
|
|
||||||
// Must be done here because we need to have a model set to define
|
// Must be done here because we need to have a model set to define
|
||||||
// individual column resize mode
|
// individual column resize mode
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
int selectedDeviceIndex();
|
int selectedDeviceIndex();
|
||||||
void selectDeviceByIndex( int index );
|
void selectDeviceByIndex( int index );
|
||||||
|
|
||||||
private slots:
|
private Q_SLOTS:
|
||||||
/// @brief Update everything when the base device changes
|
/// @brief Update everything when the base device changes
|
||||||
void updateFromCurrentDevice();
|
void updateFromCurrentDevice();
|
||||||
/// @brief Update when the selected device for boot loader changes
|
/// @brief Update when the selected device for boot loader changes
|
||||||
@ -49,6 +49,8 @@ private slots:
|
|||||||
void updateSelectedBootLoaderIndex();
|
void updateSelectedBootLoaderIndex();
|
||||||
/// @brief After boot loader model changes, try to preserve previously set value
|
/// @brief After boot loader model changes, try to preserve previously set value
|
||||||
void restoreSelectedBootLoader();
|
void restoreSelectedBootLoader();
|
||||||
|
/// @brief Make the selections in each widget match
|
||||||
|
void reconcileSelections();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer< Ui_PartitionPage > m_ui;
|
QScopedPointer< Ui_PartitionPage > m_ui;
|
||||||
|
Loading…
Reference in New Issue
Block a user