Warning fixes: avoid C-style casts.

This commit is contained in:
Teo Mrnjavac 2016-07-15 11:42:59 +02:00
parent 30ff216dea
commit d44a3d831b

View File

@ -677,7 +677,9 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
// if the partition is unallocated(free space), we don't replace it but create new one // if the partition is unallocated(free space), we don't replace it but create new one
// with the same first and last sector // with the same first and last sector
Partition* selectedPartition = (Partition *)( current.data( PartitionModel::PartitionPtrRole ).value< void* >() ); Partition* selectedPartition =
static_cast< Partition* >( current.data( PartitionModel::PartitionPtrRole )
.value< void* >() );
if ( KPMHelpers::isPartitionFreeSpace( selectedPartition ) ) if ( KPMHelpers::isPartitionFreeSpace( selectedPartition ) )
{ {
//NOTE: if the selected partition is free space, we don't deal with //NOTE: if the selected partition is free space, we don't deal with
@ -896,7 +898,10 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
SelectionFilter filter = [ this ]( const QModelIndex& index ) SelectionFilter filter = [ this ]( const QModelIndex& index )
{ {
return PartUtils::canBeResized( (Partition*)( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ) ); return PartUtils::canBeResized(
static_cast< Partition* >(
index.data( PartitionModel::PartitionPtrRole )
.value< void* >() ) );
}; };
m_beforePartitionBarsView->setSelectionFilter( filter ); m_beforePartitionBarsView->setSelectionFilter( filter );
m_beforePartitionLabelsView->setSelectionFilter( filter ); m_beforePartitionLabelsView->setSelectionFilter( filter );
@ -968,7 +973,10 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
{ {
SelectionFilter filter = [ this ]( const QModelIndex& index ) SelectionFilter filter = [ this ]( const QModelIndex& index )
{ {
return PartUtils::canBeReplaced( (Partition*)( index.data( PartitionModel::PartitionPtrRole ).value< void* >() ) ); return PartUtils::canBeReplaced(
static_cast< Partition* >(
index.data( PartitionModel::PartitionPtrRole )
.value< void* >() ) );
}; };
m_beforePartitionBarsView->setSelectionFilter( filter ); m_beforePartitionBarsView->setSelectionFilter( filter );
m_beforePartitionLabelsView->setSelectionFilter( filter ); m_beforePartitionLabelsView->setSelectionFilter( filter );