summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/benchmarkinfo.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/sysinfo/benchmarkinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 8497c8b..47be13c 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -111,30 +111,34 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
test_alu = new OCheckListItem( tests, tr( "1. Integer Arithmetic " ), OCheckListItem::CheckBox );
test_fpu = new OCheckListItem( tests, tr( "2. Floating Point Unit " ), OCheckListItem::CheckBox );
test_txt = new OCheckListItem( tests, tr( "3. Text Rendering " ), OCheckListItem::CheckBox );
test_gfx = new OCheckListItem( tests, tr( "4. Gfx Rendering " ), OCheckListItem::CheckBox );
test_ram = new OCheckListItem( tests, tr( "5. RAM Performance " ), OCheckListItem::CheckBox );
+#ifndef QT_QWS_RAMSES
test_sd = new OCheckListItem( tests, tr( "6. SD Card Performance " ), OCheckListItem::CheckBox );
test_cf = new OCheckListItem( tests, tr( "7. CF Card Performance " ), OCheckListItem::CheckBox );
-
+#endif
test_alu->setText( 1, "n/a" );
test_fpu->setText( 1, "n/a" );
test_txt->setText( 1, "n/a" );
test_gfx->setText( 1, "n/a" );
test_ram->setText( 1, "n/a" );
+#ifndef QT_QWS_RAMSES
test_sd->setText( 1, "n/a" );
test_cf->setText( 1, "n/a" );
-
+#endif
test_alu->setText( 2, "n/a" );
test_fpu->setText( 2, "n/a" );
test_txt->setText( 2, "n/a" );
test_gfx->setText( 2, "n/a" );
test_ram->setText( 2, "n/a" );
+#ifndef QT_QWS_RAMSES
test_sd->setText( 2, "n/a" );
test_cf->setText( 2, "n/a" );
+#endif
startButton = new QPushButton( tr( "&Start Tests!" ), this );
QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) );
connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) );
vb->addWidget( tests, 2 );
@@ -179,14 +183,16 @@ void BenchmarkInfo::machineActivated( int index )
QStringList::Iterator it = results->begin();
test_alu->setText( 2, *(it++) );
test_fpu->setText( 2, *(it++) );
test_txt->setText( 2, *(it++) );
test_gfx->setText( 2, *(it++) );
test_ram->setText( 2, *(it++) );
+#ifndef QT_QWS_RAMSES
test_sd->setText( 2, *(it++) );
test_cf->setText( 2, *(it++) );
+#endif
}
void BenchmarkInfo::run()
{
startButton->setText( "> Don't touch! Running Tests! Don't touch! <" );
@@ -215,32 +221,34 @@ void BenchmarkInfo::run()
test_txt->setOn( false );
}
if ( test_gfx->isOn() )
{
int value = gfxRendering( TEST_DURATION );
- test_gfx->setText( 1, QString().sprintf( "%.2f gops/sec", value / 4 / TEST_DURATION ) ); // 4 tests
+ test_gfx->setText( 1, QString().sprintf( "%.2f gops/sec", value / 4.0 / TEST_DURATION ) ); // 4 tests
test_gfx->setOn( false );
}
if ( test_ram->isOn() ) // /tmp is supposed to be in RAM on a PDA
{
performFileTest( "/tmp/benchmarkFile.dat", test_ram );
}
+#ifndef QT_QWS_RAMSES
if ( test_cf->isOn() )
{
OStorageInfo storage;
performFileTest( storage.cfPath() + "/benchmarkFile.dat", test_cf );
}
if ( test_sd->isOn() )
{
OStorageInfo storage;
performFileTest( storage.sdPath() + "/benchmarkFile.dat", test_sd );
}
+#endif
startButton->setText( tr( "&Start Tests!" ) );
}
int BenchmarkInfo::textRendering( int seconds )
@@ -382,22 +390,22 @@ void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item
item->setText( 1, tr( "error" ) );
return;
}
QFile::remove( filename );
double readSpeed = FILE_TEST_COUNT / ( read / 1000.0 );
- QString readUnit = "kb/s";
+ QString readUnit = "kB/s";
if ( readSpeed > 1024 )
{
readSpeed = readSpeed / 1024.0;
- readUnit = "mb/s";
+ readUnit = "MB/s";
}
double writeSpeed = FILE_TEST_COUNT / ( write / 1000.0 );
QString writeUnit = "kb/s";
if ( writeSpeed > 1024 )
{
writeSpeed = writeSpeed / 1024.0;
- writeUnit = "mb/s";
+ writeUnit = "MBb/s";
}
item->setText( 1, QString().sprintf( "%.2f %s, %.2f %s", readSpeed, readUnit.latin1(), writeSpeed, writeUnit.latin1() ) );
item->setOn( false );
}