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.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 96bcdfc..4163fb2 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -10,31 +10,34 @@
10** GNU General Public License version 2 as published by the Free Software 10** GNU General Public License version 2 as published by the Free Software
11** Foundation and appearing in the file LICENSE.GPL included in the 11** Foundation and appearing in the file LICENSE.GPL included in the
12** packaging of this file. 12** packaging of this file.
13** 13**
14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16** 16**
17**********************************************************************/ 17**********************************************************************/
18 18
19#include "benchmarkinfo.h" 19#include "benchmarkinfo.h"
20 20
21/* OPIE */ 21/* OPIE */
22#include <opie2/odebug.h>
22#include <opie2/ostorageinfo.h> 23#include <opie2/ostorageinfo.h>
23#include <opie2/olistview.h> 24#include <opie2/olistview.h>
24#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
25#include <qpe/qcopenvelope_qws.h> 26#include <qpe/qcopenvelope_qws.h>
26#include <qpe/qpedecoration_qws.h> 27#include <qpe/qpedecoration_qws.h>
27#include <qpe/resource.h> 28#include <qpe/resource.h>
28#include <qpe/config.h> 29#include <qpe/config.h>
30using namespace Opie::Core;
31using namespace Opie::Ui;
29 32
30/* QT */ 33/* QT */
31#include <qclipboard.h> 34#include <qclipboard.h>
32#include <qcolor.h> 35#include <qcolor.h>
33#include <qcombobox.h> 36#include <qcombobox.h>
34#include <qdirectpainter_qws.h> 37#include <qdirectpainter_qws.h>
35#include <qfile.h> 38#include <qfile.h>
36#include <qtextstream.h> 39#include <qtextstream.h>
37#include <qfiledialog.h> 40#include <qfiledialog.h>
38#include <qlabel.h> 41#include <qlabel.h>
39#include <qlayout.h> 42#include <qlayout.h>
40#include <qpainter.h> 43#include <qpainter.h>
@@ -42,28 +45,25 @@
42#include <qtimer.h> 45#include <qtimer.h>
43#include <qwhatsthis.h> 46#include <qwhatsthis.h>
44 47
45/* STD */ 48/* STD */
46#include <time.h> 49#include <time.h>
47#include <stdio.h> 50#include <stdio.h>
48#include <stdlib.h> 51#include <stdlib.h>
49#include <math.h> 52#include <math.h>
50#if defined (__GNUC__) && (__GNUC__ < 3) 53#if defined (__GNUC__) && (__GNUC__ < 3)
51#define round qRound 54#define round qRound
52#endif 55#endif
53 56
54using namespace Opie::Ui;
55using namespace Opie::Core;
56extern "C" 57extern "C"
57
58{ 58{
59 void BenchFFT( void ); 59 void BenchFFT( void );
60 double dhry_main( int ); 60 double dhry_main( int );
61} 61}
62 62
63#define DHRYSTONE_RUNS 20000000 63#define DHRYSTONE_RUNS 20000000
64#define TEST_DURATION 3 64#define TEST_DURATION 3
65 65
66#define BUFF_SIZE 8192 66#define BUFF_SIZE 8192
67#define FILE_SIZE 1024 * 1024 // 1Mb 67#define FILE_SIZE 1024 * 1024 // 1Mb
68 68
69//=========================================================================== 69//===========================================================================
@@ -139,50 +139,50 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
139 vb->addWidget( tests, 2 ); 139 vb->addWidget( tests, 2 );
140 140
141 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); 141 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" );
142 if ( f.open( IO_ReadOnly ) ) 142 if ( f.open( IO_ReadOnly ) )
143 { 143 {
144 machineCombo = new QComboBox( this ); 144 machineCombo = new QComboBox( this );
145 QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) ); 145 QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) );
146 146
147 QTextStream ts( &f ); 147 QTextStream ts( &f );
148 while( !ts.eof() ) 148 while( !ts.eof() )
149 { 149 {
150 QString machline = ts.readLine(); 150 QString machline = ts.readLine();
151 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline ); 151 odebug << "sysinfo: parsing benchmark results for '" << (const char*) machline << "'" << oendl;
152 QString resline = ts.readLine(); 152 QString resline = ts.readLine();
153 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); 153 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) );
154 machineCombo->insertItem( machline ); 154 machineCombo->insertItem( machline );
155 } 155 }
156 156
157 QHBoxLayout* hb = new QHBoxLayout( vb ); 157 QHBoxLayout* hb = new QHBoxLayout( vb );
158 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) ); 158 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) );
159 hb->addWidget( machineCombo, 2 ); 159 hb->addWidget( machineCombo, 2 );
160 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) ); 160 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) );
161 } 161 }
162 162
163 vb->addWidget( startButton, 2 ); 163 vb->addWidget( startButton, 2 );
164} 164}
165 165
166 166
167BenchmarkInfo::~BenchmarkInfo() 167BenchmarkInfo::~BenchmarkInfo()
168{} 168{}
169 169
170 170
171void BenchmarkInfo::machineActivated( int index ) 171void BenchmarkInfo::machineActivated( int index )
172{ 172{
173 QStringList* results = machines[ machineCombo->text( index ) ]; 173 QStringList* results = machines[ machineCombo->text( index ) ];
174 if ( !results ) 174 if ( !results )
175 { 175 {
176 qDebug( "sysinfo: no results available." ); 176 odebug << "sysinfo: no results available." << oendl;
177 return; 177 return;
178 } 178 }
179 QStringList::Iterator it = results->begin(); 179 QStringList::Iterator it = results->begin();
180 test_alu->setText( 2, *(it++) ); 180 test_alu->setText( 2, *(it++) );
181 test_fpu->setText( 2, *(it++) ); 181 test_fpu->setText( 2, *(it++) );
182 test_txt->setText( 2, *(it++) ); 182 test_txt->setText( 2, *(it++) );
183 test_gfx->setText( 2, *(it++) ); 183 test_gfx->setText( 2, *(it++) );
184 test_ram->setText( 2, *(it++) ); 184 test_ram->setText( 2, *(it++) );
185 test_sd->setText( 2, *(it++) ); 185 test_sd->setText( 2, *(it++) );
186 test_cf->setText( 2, *(it++) ); 186 test_cf->setText( 2, *(it++) );
187} 187}
188 188