Revert "Improve user-visible strings in SetPartFlagsJob."

This reverts commit fbe72b3663.
This commit is contained in:
Philip 2016-10-28 20:50:10 +02:00
parent 5e81ddecad
commit 381f3e9bb3

View File

@ -44,15 +44,7 @@ SetPartFlagsJob::SetPartFlagsJob( Device* device,
QString QString
SetPartFlagsJob::prettyName() const SetPartFlagsJob::prettyName() const
{ {
if ( !partition()->partitionPath().isEmpty() ) return tr( "Set flags on partition %1." ).arg( partition()->partitionPath() );
return tr( "Set flags on partition %1." ).arg( partition()->partitionPath() );
if ( !partition()->fileSystem().name().isEmpty() )
return tr( "Set flags on %1MB %2 partition." )
.arg( partition()->capacity() /1024 /1024)
.arg( partition()->fileSystem().name() );
return tr( "Set flags on new partition." );
} }
@ -61,34 +53,13 @@ SetPartFlagsJob::prettyDescription() const
{ {
QStringList flagsList = PartitionTable::flagNames( m_flags ); QStringList flagsList = PartitionTable::flagNames( m_flags );
if ( flagsList.count() == 0 ) if ( flagsList.count() == 0 )
{ return tr( "Clear flags on partition <strong>%1</strong>." )
if ( !partition()->partitionPath().isEmpty() ) .arg( partition()->partitionPath() );
return tr( "Clear flags on partition <strong>%1</strong>." )
.arg( partition()->partitionPath() );
if ( !partition()->fileSystem().name().isEmpty() ) return tr( "Flag partition <strong>%1</strong> as "
return tr( "Clear flags on %1MB <strong>%2</strong> partition." ) "<strong>%2</strong>." )
.arg( partition()->capacity() /1024 /1024) .arg( partition()->partitionPath() )
.arg( partition()->fileSystem().name() ); .arg( flagsList.join( ", " ) );
return tr( "Clear flags on new partition." );
}
if ( !partition()->partitionPath().isEmpty() )
return tr( "Flag partition <strong>%1</strong> as "
"<strong>%2</strong>." )
.arg( partition()->partitionPath() )
.arg( flagsList.join( ", " ) );
if ( !partition()->fileSystem().name().isEmpty() )
return tr( "Flag %1MB <strong>%2</strong> partition as "
"<strong>%3</strong>." )
.arg( partition()->capacity() /1024 /1024)
.arg( partition()->fileSystem().name() )
.arg( flagsList.join( ", " ) );
return tr( "Flag new partition as <strong>%1</strong>." )
.arg( flagsList.join( ", " ) );
} }
@ -97,34 +68,13 @@ SetPartFlagsJob::prettyStatusMessage() const
{ {
QStringList flagsList = PartitionTable::flagNames( m_flags ); QStringList flagsList = PartitionTable::flagNames( m_flags );
if ( flagsList.count() == 0 ) if ( flagsList.count() == 0 )
{ return tr( "Clearing flags on partition <strong>%1</strong>." )
if ( !partition()->partitionPath().isEmpty() ) .arg( partition()->partitionPath() );
return tr( "Clearing flags on partition <strong>%1</strong>." )
.arg( partition()->partitionPath() );
if ( !partition()->fileSystem().name().isEmpty() ) return tr( "Setting flags <strong>%2</strong> on partition "
return tr( "Clearing flags on %1MB <strong>%2</strong> partition." ) "<strong>%1</strong>." )
.arg( partition()->capacity() /1024 /1024) .arg( partition()->partitionPath() )
.arg( partition()->fileSystem().name() ); .arg( flagsList.join( ", " ) );
return tr( "Clearing flags on new partition." );
}
if ( !partition()->partitionPath().isEmpty() )
return tr( "Setting flags <strong>%2</strong> on partition "
"<strong>%1</strong>." )
.arg( partition()->partitionPath() )
.arg( flagsList.join( ", " ) );
if ( !partition()->fileSystem().name().isEmpty() )
return tr( "Setting flags <strong>%3</strong> on "
"%1MB <strong>%2</strong> partition." )
.arg( partition()->capacity() /1024 /1024)
.arg( partition()->fileSystem().name() )
.arg( flagsList.join( ", " ) );
return tr( "Setting flags <strong>%1</strong> on new partition." )
.arg( flagsList.join( ", " ) );
} }