Try to invalidate whole PartitionModel on replace.

This commit is contained in:
Teo Mrnjavac 2015-12-24 13:37:42 +01:00
parent 2a61114d9e
commit 9847b8efa9
3 changed files with 12 additions and 0 deletions

View File

@ -239,3 +239,10 @@ PartitionModel::partitionForIndex( const QModelIndex& index ) const
return nullptr;
return reinterpret_cast< Partition* >( index.internalPointer() );
}
void
PartitionModel::update()
{
emit dataChanged( index( 0, 0 ), index( rowCount() - 1, columnCount() - 1 ) );
}

View File

@ -110,6 +110,8 @@ public:
return m_device;
}
void update();
private:
Device* m_device;
OsproberEntryList m_osproberEntries;

View File

@ -444,6 +444,9 @@ ChoicePage::applyActionChoice( ChoicePage::Choice choice )
PartitionActions::doReplacePartition( m_core,
selectedDevice(),
partition );
PartitionModel* m = qobject_cast< PartitionModel* >( m_afterPartitionBarsView->model() );
if ( m )
m->update();
};
if ( m_core->isDirty() )