Commit 5a1cd820 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Bug fixed in ByteSizeInputWidget.

parent 60103a34
......@@ -42,22 +42,22 @@ bool ByteSizeInputWidget::isAValidByteSize( const QString& text )
void ByteSizeInputWidget::setByteSize( uint64_t byteSize )
{
if( byteSize == m_ByteSize )
return;
m_ByteSize = byteSize;
if( !(byteSize & (uint64_t(1024)*1024*1024*1024-1)) )
setText( QString::number( byteSize>>40 ) + 'T' );
if( !(byteSize & (1024*1024*1024-1)) )
else if( !(byteSize & (1024*1024*1024-1)) )
setText( QString::number( byteSize>>30 ) + 'G' );
if( !(byteSize & (1024*1024-1)) )
else if( !(byteSize & (1024*1024-1)) )
setText( QString::number( byteSize>>20 ) + 'M' );
if( !(byteSize & (1024-1)) )
else if( !(byteSize & (1024-1)) )
setText( QString::number( byteSize>>10 ) + 'K' );
setText( QString::number( byteSize ) );
else
setText( QString::number( byteSize ) );
emit byteSizeChanged( byteSize );
if( byteSize != m_ByteSize )
{
m_ByteSize = byteSize;
emit byteSizeChanged( byteSize );
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment