summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/benchmarkinfo.cpp
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/benchmarkinfo.cpp') (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 0aeb251..d6ecec5 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -100,97 +100,97 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
100 100
101 test_alu = new QCheckListItem( tests, tr( "1. Integer Arithmetic " ), QCheckListItem::CheckBox ); 101 test_alu = new QCheckListItem( tests, tr( "1. Integer Arithmetic " ), QCheckListItem::CheckBox );
102 test_fpu = new QCheckListItem( tests, tr( "2. Floating Point Unit " ), QCheckListItem::CheckBox ); 102 test_fpu = new QCheckListItem( tests, tr( "2. Floating Point Unit " ), QCheckListItem::CheckBox );
103 test_txt = new QCheckListItem( tests, tr( "3. Text Rendering " ), QCheckListItem::CheckBox ); 103 test_txt = new QCheckListItem( tests, tr( "3. Text Rendering " ), QCheckListItem::CheckBox );
104 test_gfx = new QCheckListItem( tests, tr( "4. Gfx Rendering " ), QCheckListItem::CheckBox ); 104 test_gfx = new QCheckListItem( tests, tr( "4. Gfx Rendering " ), QCheckListItem::CheckBox );
105 test_ram = new QCheckListItem( tests, tr( "5. RAM Performance " ), QCheckListItem::CheckBox ); 105 test_ram = new QCheckListItem( tests, tr( "5. RAM Performance " ), QCheckListItem::CheckBox );
106 test_sd = new QCheckListItem( tests, tr( "6. SD Card Performance " ), QCheckListItem::CheckBox ); 106 test_sd = new QCheckListItem( tests, tr( "6. SD Card Performance " ), QCheckListItem::CheckBox );
107 test_cf = new QCheckListItem( tests, tr( "7. CF Card Performance " ), QCheckListItem::CheckBox ); 107 test_cf = new QCheckListItem( tests, tr( "7. CF Card Performance " ), QCheckListItem::CheckBox );
108 108
109 test_alu->setText( 1, "n/a" ); 109 test_alu->setText( 1, "n/a" );
110 test_fpu->setText( 1, "n/a" ); 110 test_fpu->setText( 1, "n/a" );
111 test_txt->setText( 1, "n/a" ); 111 test_txt->setText( 1, "n/a" );
112 test_gfx->setText( 1, "n/a" ); 112 test_gfx->setText( 1, "n/a" );
113 test_ram->setText( 1, "n/a" ); 113 test_ram->setText( 1, "n/a" );
114 test_sd->setText( 1, "n/a" ); 114 test_sd->setText( 1, "n/a" );
115 test_cf->setText( 1, "n/a" ); 115 test_cf->setText( 1, "n/a" );
116 116
117 test_alu->setText( 2, "n/a" ); 117 test_alu->setText( 2, "n/a" );
118 test_fpu->setText( 2, "n/a" ); 118 test_fpu->setText( 2, "n/a" );
119 test_txt->setText( 2, "n/a" ); 119 test_txt->setText( 2, "n/a" );
120 test_gfx->setText( 2, "n/a" ); 120 test_gfx->setText( 2, "n/a" );
121 test_ram->setText( 2, "n/a" ); 121 test_ram->setText( 2, "n/a" );
122 test_sd->setText( 2, "n/a" ); 122 test_sd->setText( 2, "n/a" );
123 test_cf->setText( 2, "n/a" ); 123 test_cf->setText( 2, "n/a" );
124 124
125 startButton = new QPushButton( tr( "&Start Tests!" ), this ); 125 startButton = new QPushButton( tr( "&Start Tests!" ), this );
126 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); 126 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) );
127 127
128 vb->addWidget( tests, 2 ); 128 vb->addWidget( tests, 2 );
129 129
130 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); 130 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" );
131 if ( f.open( IO_ReadOnly ) ) 131 if ( f.open( IO_ReadOnly ) )
132 { 132 {
133 machineCombo = new QComboBox( this ); 133 machineCombo = new QComboBox( this );
134 134
135 QTextStream ts( &f ); 135 QTextStream ts( &f );
136 while( !ts.eof() ) 136 while( !ts.eof() )
137 { 137 {
138 QString machline = ts.readLine(); 138 QString machline = ts.readLine();
139 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline ); 139 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline );
140 QString resline = ts.readLine(); 140 QString resline = ts.readLine();
141 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); 141 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) );
142 machineCombo->insertItem( machline ); 142 machineCombo->insertItem( machline );
143 } 143 }
144 144
145 QHBoxLayout* hb = new QHBoxLayout( vb ); 145 QHBoxLayout* hb = new QHBoxLayout( vb );
146 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) ); 146 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) );
147 hb->addWidget( machineCombo, 2 ); 147 hb->addWidget( machineCombo, 2 );
148 connect( machineCombo, SIGNAL( activated( int ) ), this, SLOT( machineActivated( int ) ) ); 148 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) );
149 } 149 }
150 150
151 vb->addWidget( startButton, 2 ); 151 vb->addWidget( startButton, 2 );
152} 152}
153 153
154 154
155BenchmarkInfo::~BenchmarkInfo() 155BenchmarkInfo::~BenchmarkInfo()
156{} 156{}
157 157
158 158
159void BenchmarkInfo::machineActivated( int index ) 159void BenchmarkInfo::machineActivated( int index )
160{ 160{
161 QStringList* results = machines[ machineCombo->text( index ) ]; 161 QStringList* results = machines[ machineCombo->text( index ) ];
162 if ( !results ) 162 if ( !results )
163 { 163 {
164 qDebug( "sysinfo: no results available." ); 164 qDebug( "sysinfo: no results available." );
165 return; 165 return;
166 } 166 }
167 QStringList::Iterator it = results->begin(); 167 QStringList::Iterator it = results->begin();
168 test_alu->setText( 2, *(it++) ); 168 test_alu->setText( 2, *(it++) );
169 test_fpu->setText( 2, *(it++) ); 169 test_fpu->setText( 2, *(it++) );
170 test_txt->setText( 2, *(it++) ); 170 test_txt->setText( 2, *(it++) );
171 test_gfx->setText( 2, *(it++) ); 171 test_gfx->setText( 2, *(it++) );
172 test_ram->setText( 2, *(it++) ); 172 test_ram->setText( 2, *(it++) );
173 test_sd->setText( 2, *(it++) ); 173 test_sd->setText( 2, *(it++) );
174 test_cf->setText( 2, *(it++) ); 174 test_cf->setText( 2, *(it++) );
175} 175}
176 176
177 177
178void BenchmarkInfo::run() 178void BenchmarkInfo::run()
179{ 179{
180 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); 180 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" );
181 qApp->processEvents(); 181 qApp->processEvents();
182 QTime t; 182 QTime t;
183 183
184 if ( test_alu->isOn() ) 184 if ( test_alu->isOn() )
185 { 185 {
186 int d = round( dhry_main( DHRYSTONE_RUNS ) ); 186 int d = round( dhry_main( DHRYSTONE_RUNS ) );
187 test_alu->setText( 1, QString( "%1 dhrys" ).arg( QString::number( d ) ) ); 187 test_alu->setText( 1, QString( "%1 dhrys" ).arg( QString::number( d ) ) );
188 test_alu->setOn( false ); 188 test_alu->setOn( false );
189 } 189 }
190 190
191 if ( test_fpu->isOn() ) 191 if ( test_fpu->isOn() )
192 { 192 {
193 t.start(); 193 t.start();
194 BenchFFT(); 194 BenchFFT();
195 test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); 195 test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) );
196 test_fpu->setOn( false ); 196 test_fpu->setOn( false );