Keep track of previous spinbox value.

This commit is contained in:
Teo Mrnjavac 2016-06-24 16:58:23 +02:00
parent cd94768850
commit 1f664f1eec
2 changed files with 7 additions and 0 deletions

View File

@ -130,6 +130,9 @@ PartitionSizeController::updatePartResizerWidget()
{
if ( m_updating )
return;
if ( m_spinBox->value() == m_currentSpinBoxValue )
return;
m_updating = true;
qint64 sectorSize = qint64( m_spinBox->value() ) * 1024 * 1024 / m_device->logicalSectorSize();
@ -183,6 +186,9 @@ PartitionSizeController::doUpdateSpinBox()
return;
qint64 mbSize = m_partition->length() * m_device->logicalSectorSize() / 1024 / 1024;
m_spinBox->setValue( mbSize );
if ( m_currentSpinBoxValue != -1 ) //it's not the first time we're setting it
m_dirty = true;
m_currentSpinBoxValue = mbSize;
}
qint64

View File

@ -71,6 +71,7 @@ private:
void doAlignAndUpdatePartResizerWidget( qint64 fistSector, qint64 lastSector );
bool m_dirty = false;
qint64 m_currentSpinBoxValue = -1;
private Q_SLOTS:
void updatePartResizerWidget();