summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 47be13c..be7e4b6 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -359,53 +359,53 @@ void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item
359 QString writeCommand = QString( "dd if=/dev/zero of=%1 count=%2 bs=%3 && sync" ).arg( filename ) 359 QString writeCommand = QString( "dd if=/dev/zero of=%1 count=%2 bs=%3 && sync" ).arg( filename )
360 .arg( FILE_TEST_COUNT ) 360 .arg( FILE_TEST_COUNT )
361 .arg( FILE_TEST_BLOCKSIZE ); 361 .arg( FILE_TEST_BLOCKSIZE );
362 QString readCommand = QString( "dd if=%1 of=/dev/null count=%2 bs=%3").arg( filename ) 362 QString readCommand = QString( "dd if=%1 of=/dev/null count=%2 bs=%3").arg( filename )
363 .arg( FILE_TEST_COUNT ) 363 .arg( FILE_TEST_COUNT )
364 .arg( FILE_TEST_BLOCKSIZE ); 364 .arg( FILE_TEST_BLOCKSIZE );
365 ::system( "sync" ); 365 ::system( "sync" );
366 odebug << "performing file test on " << filename << oendl; 366 odebug << "performing file test on " << filename << oendl;
367 367
368 int write = 0; 368 int write = 0;
369 int read = 0; 369 int read = 0;
370 370
371 QTime time; 371 QTime time;
372 time.start(); 372 time.start();
373 if ( ::system( writeCommand ) == 0 ) 373 if ( ::system( writeCommand ) == 0 )
374 { 374 {
375 write = time.elapsed(); 375 write = time.elapsed();
376 } 376 }
377 else 377 else
378 { 378 {
379 item->setText( 1, tr( "error" ) ); 379 item->setText( 1, tr( "error" ) );
380 return; 380 return;
381 } 381 }
382 382
383 time.restart(); 383 time.restart();
384 if ( ::system( readCommand ) == 0 ) 384 if ( ::system( readCommand ) == 0 )
385 { 385 {
386 read = time.elapsed(); 386 read = time.elapsed();
387 } 387 }
388 else 388 else
389 { 389 {
390 item->setText( 1, tr( "error" ) ); 390 item->setText( 1, tr( "error" ) );
391 return; 391 return;
392 } 392 }
393 393
394 QFile::remove( filename ); 394 QFile::remove( filename );
395 double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 ); 395 double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 );
396 QString readUnit = "kB/s"; 396 QString readUnit = "kB/s";
397 if ( readSpeed > 1024 ) 397 if ( readSpeed > 1024 )
398 { 398 {
399 readSpeed = readSpeed / 1024.0; 399 readSpeed = readSpeed / 1024.0;
400 readUnit = "MB/s"; 400 readUnit = "MB/s";
401 } 401 }
402 double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 ); 402 double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 );
403 QString writeUnit = "kb/s"; 403 QString writeUnit = "kb/s";
404 if ( writeSpeed > 1024 ) 404 if ( writeSpeed > 1024 )
405 { 405 {
406 writeSpeed = writeSpeed / 1024.0; 406 writeSpeed = writeSpeed / 1024.0;
407 writeUnit = "MBb/s"; 407 writeUnit = "MB/s";
408 } 408 }
409 item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) ); 409 item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) );
410 item->setOn( false ); 410 item->setOn( false );
411} 411}