[partition] Use Q_EMIT
This commit is contained in:
parent
4fa61249a8
commit
d8a862ec82
@ -180,7 +180,7 @@ Config::setInstallChoice( InstallChoice c )
|
|||||||
if ( c != m_installChoice )
|
if ( c != m_installChoice )
|
||||||
{
|
{
|
||||||
m_installChoice = c;
|
m_installChoice = c;
|
||||||
emit installChoiceChanged( c );
|
Q_EMIT installChoiceChanged( c );
|
||||||
::updateGlobalStorage( c, m_swapChoice );
|
::updateGlobalStorage( c, m_swapChoice );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ Config::setSwapChoice( Config::SwapChoice c )
|
|||||||
if ( c != m_swapChoice )
|
if ( c != m_swapChoice )
|
||||||
{
|
{
|
||||||
m_swapChoice = c;
|
m_swapChoice = c;
|
||||||
emit swapChoiceChanged( c );
|
Q_EMIT swapChoiceChanged( c );
|
||||||
::updateGlobalStorage( m_installChoice, c );
|
::updateGlobalStorage( m_installChoice, c );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ DeviceModel::swapDevice( Device* oldDevice, Device* newDevice )
|
|||||||
|
|
||||||
m_devices[ indexOfOldDevice ] = newDevice;
|
m_devices[ indexOfOldDevice ] = newDevice;
|
||||||
|
|
||||||
emit dataChanged( index( indexOfOldDevice ), index( indexOfOldDevice ) );
|
Q_EMIT dataChanged( index( indexOfOldDevice ), index( indexOfOldDevice ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -687,7 +687,7 @@ void
|
|||||||
PartitionCoreModule::refreshPartition( Device* device, Partition* )
|
PartitionCoreModule::refreshPartition( Device* device, Partition* )
|
||||||
{
|
{
|
||||||
// Keep it simple for now: reset the model. This can be improved to cause
|
// Keep it simple for now: reset the model. This can be improved to cause
|
||||||
// the model to emit dataChanged() for the affected row instead, avoiding
|
// the model to Q_EMIT dataChanged() for the affected row instead, avoiding
|
||||||
// the loss of the current selection.
|
// the loss of the current selection.
|
||||||
auto model = partitionModelForDevice( device );
|
auto model = partitionModelForDevice( device );
|
||||||
Q_ASSERT( model );
|
Q_ASSERT( model );
|
||||||
@ -966,7 +966,7 @@ PartitionCoreModule::revert()
|
|||||||
m_deviceInfos.clear();
|
m_deviceInfos.clear();
|
||||||
doInit();
|
doInit();
|
||||||
updateIsDirty();
|
updateIsDirty();
|
||||||
emit reverted();
|
Q_EMIT reverted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1040,7 +1040,7 @@ PartitionCoreModule::revertDevice( Device* dev, bool individualRevert )
|
|||||||
{
|
{
|
||||||
refreshAfterModelChange();
|
refreshAfterModelChange();
|
||||||
}
|
}
|
||||||
emit deviceReverted( newDev );
|
Q_EMIT deviceReverted( newDev );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,5 +327,5 @@ PartitionModel::partitionForIndex( const QModelIndex& index ) const
|
|||||||
void
|
void
|
||||||
PartitionModel::update()
|
PartitionModel::update()
|
||||||
{
|
{
|
||||||
emit dataChanged( index( 0, 0 ), index( rowCount() - 1, columnCount() - 1 ) );
|
Q_EMIT dataChanged( index( 0, 0 ), index( rowCount() - 1, columnCount() - 1 ) );
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* This helper class must be instantiated on the stack *before* making
|
* This helper class must be instantiated on the stack *before* making
|
||||||
* changes to the device represented by this model. It will cause the model
|
* changes to the device represented by this model. It will cause the model
|
||||||
* to emit modelAboutToBeReset() when instantiated and modelReset() when
|
* to Q_EMIT modelAboutToBeReset() when instantiated and modelReset() when
|
||||||
* destructed.
|
* destructed.
|
||||||
*/
|
*/
|
||||||
class ResetHelper
|
class ResetHelper
|
||||||
|
@ -300,7 +300,7 @@ ChoicePage::setupChoices()
|
|||||||
m_config->setInstallChoice( id );
|
m_config->setInstallChoice( id );
|
||||||
updateNextEnabled();
|
updateNextEnabled();
|
||||||
|
|
||||||
emit actionChosen();
|
Q_EMIT actionChosen();
|
||||||
}
|
}
|
||||||
else // An action was unpicked, either on its own or because of another selection.
|
else // An action was unpicked, either on its own or because of another selection.
|
||||||
{
|
{
|
||||||
@ -310,7 +310,7 @@ ChoicePage::setupChoices()
|
|||||||
m_config->setInstallChoice( InstallChoice::NoChoice );
|
m_config->setInstallChoice( InstallChoice::NoChoice );
|
||||||
updateNextEnabled();
|
updateNextEnabled();
|
||||||
|
|
||||||
emit actionChosen();
|
Q_EMIT actionChosen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
@ -433,8 +433,8 @@ ChoicePage::continueApplyDeviceChoice()
|
|||||||
checkInstallChoiceRadioButton( m_config->installChoice() );
|
checkInstallChoiceRadioButton( m_config->installChoice() );
|
||||||
}
|
}
|
||||||
|
|
||||||
emit actionChosen();
|
Q_EMIT actionChosen();
|
||||||
emit deviceChosen();
|
Q_EMIT deviceChosen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -489,14 +489,14 @@ ChoicePage::applyActionChoice( InstallChoice choice )
|
|||||||
} ),
|
} ),
|
||||||
[=] {
|
[=] {
|
||||||
PartitionActions::doAutopartition( m_core, selectedDevice(), options );
|
PartitionActions::doAutopartition( m_core, selectedDevice(), options );
|
||||||
emit deviceChosen();
|
Q_EMIT deviceChosen();
|
||||||
},
|
},
|
||||||
this );
|
this );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PartitionActions::doAutopartition( m_core, selectedDevice(), options );
|
PartitionActions::doAutopartition( m_core, selectedDevice(), options );
|
||||||
emit deviceChosen();
|
Q_EMIT deviceChosen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1599,7 +1599,7 @@ ChoicePage::updateNextEnabled()
|
|||||||
if ( enabled != m_nextEnabled )
|
if ( enabled != m_nextEnabled )
|
||||||
{
|
{
|
||||||
m_nextEnabled = enabled;
|
m_nextEnabled = enabled;
|
||||||
emit nextStatusChanged( enabled );
|
Q_EMIT nextStatusChanged( enabled );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ EncryptWidget::updateState()
|
|||||||
if ( newState != m_state )
|
if ( newState != m_state )
|
||||||
{
|
{
|
||||||
m_state = newState;
|
m_state = newState;
|
||||||
emit stateChanged( m_state );
|
Q_EMIT stateChanged( m_state );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ PartitionSplitterWidget::setSplitPartition( const QString& path, qint64 minSize,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit partitionResized( m_itemToResize.itemPath, m_itemToResize.size, m_itemToResizeNext.size );
|
Q_EMIT partitionResized( m_itemToResize.itemPath, m_itemToResize.size, m_itemToResizeNext.size );
|
||||||
|
|
||||||
cDebug() << "Items updated. Status:";
|
cDebug() << "Items updated. Status:";
|
||||||
foreach ( const PartitionSplitterItem& item, m_items )
|
foreach ( const PartitionSplitterItem& item, m_items )
|
||||||
@ -374,7 +374,7 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event )
|
|||||||
|
|
||||||
repaint();
|
repaint();
|
||||||
|
|
||||||
emit partitionResized( itemPath, m_itemToResize.size, m_itemToResizeNext.size );
|
Q_EMIT partitionResized( itemPath, m_itemToResize.size, m_itemToResizeNext.size );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -327,7 +327,7 @@ PartitionViewStep::isNextEnabled() const
|
|||||||
void
|
void
|
||||||
PartitionViewStep::nextPossiblyChanged( bool )
|
PartitionViewStep::nextPossiblyChanged( bool )
|
||||||
{
|
{
|
||||||
emit nextStatusChanged( isNextEnabled() );
|
Q_EMIT nextStatusChanged( isNextEnabled() );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -311,7 +311,7 @@ ReplaceWidget::setNextEnabled( bool enabled )
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_nextEnabled = enabled;
|
m_nextEnabled = enabled;
|
||||||
emit nextStatusChanged( enabled );
|
Q_EMIT nextStatusChanged( enabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,5 +68,5 @@ void
|
|||||||
ScanningDialog::setVisible( bool visible )
|
ScanningDialog::setVisible( bool visible )
|
||||||
{
|
{
|
||||||
QDialog::setVisible( visible );
|
QDialog::setVisible( visible );
|
||||||
emit visibilityChanged();
|
Q_EMIT visibilityChanged();
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ PartitionJob::iprogress( int percent )
|
|||||||
{
|
{
|
||||||
percent = 100;
|
percent = 100;
|
||||||
}
|
}
|
||||||
emit progress( qreal( percent / 100.0 ) );
|
Q_EMIT progress( qreal( percent / 100.0 ) );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user