summaryrefslogtreecommitdiff
path: root/core/settings/citytime
authorchicken <chicken>2004-03-01 17:53:46 (UTC)
committer chicken <chicken>2004-03-01 17:53:46 (UTC)
commit5b4e342004537f84fa53911a46cd00d810378da7 (patch) (unidiff)
tree763c74ad41014de91c010fb996ec527f841ef3bc /core/settings/citytime
parent5b640d3f070b0b2de361421abf93949410546e19 (diff)
downloadopie-5b4e342004537f84fa53911a46cd00d810378da7.zip
opie-5b4e342004537f84fa53911a46cd00d810378da7.tar.gz
opie-5b4e342004537f84fa53911a46cd00d810378da7.tar.bz2
fix includes
Diffstat (limited to 'core/settings/citytime') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/citytime/citytime.cpp5
-rw-r--r--core/settings/citytime/citytimebase.cpp3
-rw-r--r--core/settings/citytime/main.cpp1
-rw-r--r--core/settings/citytime/stylusnormalizer.cpp1
-rw-r--r--core/settings/citytime/zonemap.cpp7
5 files changed, 0 insertions, 17 deletions
diff --git a/core/settings/citytime/citytime.cpp b/core/settings/citytime/citytime.cpp
index b359ae1..e7f0c46 100644
--- a/core/settings/citytime/citytime.cpp
+++ b/core/settings/citytime/citytime.cpp
@@ -1,87 +1,82 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21// changes by Maximilian Reiss <harlekin@handhelds.org> 21// changes by Maximilian Reiss <harlekin@handhelds.org>
22 22
23#include "zonemap.h" 23#include "zonemap.h"
24#include "citytime.h" 24#include "citytime.h"
25 25
26#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#include <qpe/config.h> 27#include <qpe/config.h>
28#include <qpe/timestring.h>
29#include <qpe/tzselect.h> 28#include <qpe/tzselect.h>
30#if !defined(QT_NO_COP) 29#if !defined(QT_NO_COP)
31#include <qpe/qcopenvelope_qws.h> 30#include <qpe/qcopenvelope_qws.h>
32#endif 31#endif
33 32
34#include <qdir.h>
35#include <qfile.h>
36#include <qlabel.h> 33#include <qlabel.h>
37#include <qmessagebox.h> 34#include <qmessagebox.h>
38#include <qregexp.h>
39#include <qtextstream.h>
40#include <qtoolbutton.h> 35#include <qtoolbutton.h>
41#include <qlayout.h> 36#include <qlayout.h>
42 37
43#include <stdlib.h> 38#include <stdlib.h>
44 39
45CityTime::CityTime( QWidget *parent, const char* name, 40CityTime::CityTime( QWidget *parent, const char* name,
46 WFlags fl ) 41 WFlags fl )
47 : CityTimeBase( parent, name, fl ), 42 : CityTimeBase( parent, name, fl ),
48 strRealTz(0), 43 strRealTz(0),
49 bAdded(false) 44 bAdded(false)
50{ 45{
51 Config config( "qpe" ); 46 Config config( "qpe" );
52 config.setGroup( "Time" ); 47 config.setGroup( "Time" );
53 bWhichClock = config.readBoolEntry( "AMPM", TRUE ); 48 bWhichClock = config.readBoolEntry( "AMPM", TRUE );
54 qDebug( QString("%1").arg(bWhichClock) ); 49 qDebug( QString("%1").arg(bWhichClock) );
55 frmMap->changeClock( bWhichClock ); 50 frmMap->changeClock( bWhichClock );
56 51
57 char *pEnv; 52 char *pEnv;
58 pEnv = NULL; 53 pEnv = NULL;
59 pEnv = getenv("TZ"); 54 pEnv = getenv("TZ");
60 if ( pEnv ) 55 if ( pEnv )
61 strRealTz = pEnv; 56 strRealTz = pEnv;
62 pEnv = NULL; 57 pEnv = NULL;
63 pEnv = getenv("HOME"); 58 pEnv = getenv("HOME");
64 if ( pEnv ) 59 if ( pEnv )
65 strHome = pEnv; 60 strHome = pEnv;
66 // append the labels to their respective lists... 61 // append the labels to their respective lists...
67 listCities.setAutoDelete( true ); 62 listCities.setAutoDelete( true );
68 listTimes.setAutoDelete( true ); 63 listTimes.setAutoDelete( true );
69 64
70 listCities.append( cmdCity1 ); 65 listCities.append( cmdCity1 );
71 listCities.append( cmdCity2 ); 66 listCities.append( cmdCity2 );
72 listCities.append( cmdCity3 ); 67 listCities.append( cmdCity3 );
73 68
74 listTimes.append( lblCTime1 ); 69 listTimes.append( lblCTime1 );
75 listTimes.append( lblCTime2 ); 70 listTimes.append( lblCTime2 );
76 listTimes.append( lblCTime3 ); 71 listTimes.append( lblCTime3 );
77 72
78 73
79 // kludgy way of getting the screen size so we don't have to depend 74 // kludgy way of getting the screen size so we don't have to depend
80 // on a resize event... 75 // on a resize event...
81 QWidget *d = QApplication::desktop(); 76 QWidget *d = QApplication::desktop();
82 if ( d->width() < d->height() ) { 77 if ( d->width() < d->height() ) {
83 // append for that 4 down look 78 // append for that 4 down look
84 listCities.append( cmdCity4 ); 79 listCities.append( cmdCity4 );
85 listCities.append( cmdCity5 ); 80 listCities.append( cmdCity5 );
86 listCities.append( cmdCity6 ); 81 listCities.append( cmdCity6 );
87 listTimes.append( lblCTime4 ); 82 listTimes.append( lblCTime4 );
diff --git a/core/settings/citytime/citytimebase.cpp b/core/settings/citytime/citytimebase.cpp
index d734cf3..a3483cc 100644
--- a/core/settings/citytime/citytimebase.cpp
+++ b/core/settings/citytime/citytimebase.cpp
@@ -1,61 +1,58 @@
1 1
2 2
3// changes by Maximilian Reiss <harlekin@handhelds.org> 3// changes by Maximilian Reiss <harlekin@handhelds.org>
4 4
5#include "citytimebase.h" 5#include "citytimebase.h"
6 6
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qpushbutton.h>
9#include <qtoolbutton.h> 8#include <qtoolbutton.h>
10#include "zonemap.h" 9#include "zonemap.h"
11#include <qlayout.h> 10#include <qlayout.h>
12#include <qvariant.h>
13#include <qtooltip.h>
14#include <qwhatsthis.h> 11#include <qwhatsthis.h>
15 12
16 13
17/* 14/*
18 * Constructs a CityTimeBase which is a child of 'parent', with the 15 * Constructs a CityTimeBase which is a child of 'parent', with the
19 * name 'name' and widget flags set to 'f' 16 * name 'name' and widget flags set to 'f'
20 */ 17 */
21CityTimeBase::CityTimeBase( QWidget* parent, const char* name, WFlags ) 18CityTimeBase::CityTimeBase( QWidget* parent, const char* name, WFlags )
22 : QWidget( parent, name, WStyle_ContextHelp ) 19 : QWidget( parent, name, WStyle_ContextHelp )
23{ 20{
24 if ( !name ) 21 if ( !name )
25 setName( "CityTimeBase" ); 22 setName( "CityTimeBase" );
26 setCaption( tr( "City Time" ) ); 23 setCaption( tr( "City Time" ) );
27 CityTimeBaseLayout = new QVBoxLayout( this ); 24 CityTimeBaseLayout = new QVBoxLayout( this );
28 CityTimeBaseLayout->setSpacing( 3 ); 25 CityTimeBaseLayout->setSpacing( 3 );
29 CityTimeBaseLayout->setMargin( 0 ); 26 CityTimeBaseLayout->setMargin( 0 );
30 27
31 frmMap = new ZoneMap( this, "frmMap" ); 28 frmMap = new ZoneMap( this, "frmMap" );
32 frmMap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, frmMap->sizePolicy().hasHeightForWidth() ) ); 29 frmMap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, frmMap->sizePolicy().hasHeightForWidth() ) );
33 CityTimeBaseLayout->addWidget( frmMap ); 30 CityTimeBaseLayout->addWidget( frmMap );
34 31
35 buttonWidget = new QWidget( this ); 32 buttonWidget = new QWidget( this );
36 QWhatsThis::add( buttonWidget, tr( "Click on one of the set cities to replace it" ) ); 33 QWhatsThis::add( buttonWidget, tr( "Click on one of the set cities to replace it" ) );
37 Layout2 = new QGridLayout( buttonWidget ); 34 Layout2 = new QGridLayout( buttonWidget );
38 Layout2->setSpacing( 3 ); 35 Layout2->setSpacing( 3 );
39 Layout2->setMargin( 4 ); 36 Layout2->setMargin( 4 );
40 37
41 cmdCity7 = new QToolButton( buttonWidget, "cmdCity7" ); 38 cmdCity7 = new QToolButton( buttonWidget, "cmdCity7" );
42 cmdCity7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity7->sizePolicy().hasHeightForWidth() ) ); 39 cmdCity7->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, cmdCity7->sizePolicy().hasHeightForWidth() ) );
43 QFont cmdCity7_font( cmdCity7->font() ); 40 QFont cmdCity7_font( cmdCity7->font() );
44 cmdCity7_font.setBold( TRUE ); 41 cmdCity7_font.setBold( TRUE );
45 cmdCity7->setFont( cmdCity7_font ); 42 cmdCity7->setFont( cmdCity7_font );
46 cmdCity7->setFocusPolicy( QToolButton::TabFocus ); 43 cmdCity7->setFocusPolicy( QToolButton::TabFocus );
47 cmdCity7->setText( tr( "" ) ); 44 cmdCity7->setText( tr( "" ) );
48 cmdCity7->setToggleButton( TRUE ); 45 cmdCity7->setToggleButton( TRUE );
49 cmdCity7->setToggleButton( TRUE ); 46 cmdCity7->setToggleButton( TRUE );
50 47
51 Layout2->addWidget( cmdCity7, 0, 2 ); 48 Layout2->addWidget( cmdCity7, 0, 2 );
52 49
53 lblCTime9 = new QLabel( buttonWidget, "lblCTime9" ); 50 lblCTime9 = new QLabel( buttonWidget, "lblCTime9" );
54 lblCTime9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime9->sizePolicy().hasHeightForWidth() ) ); 51 lblCTime9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)1, lblCTime9->sizePolicy().hasHeightForWidth() ) );
55 QFont lblCTime9_font( lblCTime9->font() ); 52 QFont lblCTime9_font( lblCTime9->font() );
56 lblCTime9_font.setPointSize( 10 ); 53 lblCTime9_font.setPointSize( 10 );
57 lblCTime9->setFont( lblCTime9_font ); 54 lblCTime9->setFont( lblCTime9_font );
58 lblCTime9->setText( tr( "" ) ); 55 lblCTime9->setText( tr( "" ) );
59 lblCTime9->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); 56 lblCTime9->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
60 57
61 Layout2->addWidget( lblCTime9, 2, 3 ); 58 Layout2->addWidget( lblCTime9, 2, 3 );
diff --git a/core/settings/citytime/main.cpp b/core/settings/citytime/main.cpp
index 69bfe44..59498b7 100644
--- a/core/settings/citytime/main.cpp
+++ b/core/settings/citytime/main.cpp
@@ -1,25 +1,24 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "citytime.h" 21#include "citytime.h"
22#include <qpe/qpeapplication.h>
23#include <opie/oapplicationfactory.h> 22#include <opie/oapplicationfactory.h>
24 23
25OPIE_EXPORT_APP( OApplicationFactory<CityTime> ) 24OPIE_EXPORT_APP( OApplicationFactory<CityTime> )
diff --git a/core/settings/citytime/stylusnormalizer.cpp b/core/settings/citytime/stylusnormalizer.cpp
index c6c65d2..281a0bc 100644
--- a/core/settings/citytime/stylusnormalizer.cpp
+++ b/core/settings/citytime/stylusnormalizer.cpp
@@ -1,69 +1,68 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qpoint.h>
22#include <qtimer.h> 21#include <qtimer.h>
23 22
24#include "stylusnormalizer.h" 23#include "stylusnormalizer.h"
25 24
26static const int FLUSHTIME = 100; 25static const int FLUSHTIME = 100;
27 26
28_StylusEvent::_StylusEvent( const QPoint& newPt ) 27_StylusEvent::_StylusEvent( const QPoint& newPt )
29 : _pt( newPt ), 28 : _pt( newPt ),
30 _t( QTime::currentTime() ) 29 _t( QTime::currentTime() )
31{ 30{
32} 31}
33 32
34_StylusEvent::~_StylusEvent() 33_StylusEvent::~_StylusEvent()
35{ 34{
36} 35}
37 36
38StylusNormalizer::StylusNormalizer( QWidget *parent, const char* name ) 37StylusNormalizer::StylusNormalizer( QWidget *parent, const char* name )
39 : QWidget( parent, name ), 38 : QWidget( parent, name ),
40 _next( 0 ), 39 _next( 0 ),
41 bFirst( true ) 40 bFirst( true )
42{ 41{
43 // initialize _ptList 42 // initialize _ptList
44 int i; 43 int i;
45 for (i = 0; i < SAMPLES; i++ ) { 44 for (i = 0; i < SAMPLES; i++ ) {
46 _ptList[i].setPoint( -1, -1 ); 45 _ptList[i].setPoint( -1, -1 );
47 } 46 }
48 _tExpire = new QTimer( this ); 47 _tExpire = new QTimer( this );
49 QObject::connect( _tExpire, SIGNAL( timeout() ), 48 QObject::connect( _tExpire, SIGNAL( timeout() ),
50 this, SLOT( slotAveragePoint() ) ); 49 this, SLOT( slotAveragePoint() ) );
51} 50}
52 51
53StylusNormalizer::~StylusNormalizer() 52StylusNormalizer::~StylusNormalizer()
54{ 53{
55} 54}
56 55
57void StylusNormalizer::addEvent( const QPoint& pt ) 56void StylusNormalizer::addEvent( const QPoint& pt )
58{ 57{
59 _ptList[_next].setPoint( pt ); 58 _ptList[_next].setPoint( pt );
60 _ptList[_next++].setTime( QTime::currentTime() ); 59 _ptList[_next++].setTime( QTime::currentTime() );
61 if ( _next >= SAMPLES ) { 60 if ( _next >= SAMPLES ) {
62 _next = 0; 61 _next = 0;
63 } 62 }
64 // make a single mouse click work 63 // make a single mouse click work
65 if ( bFirst ) { 64 if ( bFirst ) {
66 slotAveragePoint(); 65 slotAveragePoint();
67 bFirst = false; 66 bFirst = false;
68 } 67 }
69} 68}
diff --git a/core/settings/citytime/zonemap.cpp b/core/settings/citytime/zonemap.cpp
index 872e786..b83da59 100644
--- a/core/settings/citytime/zonemap.cpp
+++ b/core/settings/citytime/zonemap.cpp
@@ -1,86 +1,79 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21// changes by Maximilian Reiss <harlekin@handhelds.org> 21// changes by Maximilian Reiss <harlekin@handhelds.org>
22 22
23#include "sun.h" 23#include "sun.h"
24#include "zonemap.h" 24#include "zonemap.h"
25 25
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/timestring.h>
28#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
29 28
30#include <qdatetime.h>
31#include <qfile.h> 29#include <qfile.h>
32#include <qimage.h>
33#include <qlabel.h> 30#include <qlabel.h>
34#include <qlist.h>
35#include <qmessagebox.h> 31#include <qmessagebox.h>
36#include <qpixmap.h>
37#include <qpainter.h>
38#include <qregexp.h>
39#include <qtextstream.h> 32#include <qtextstream.h>
40#include <qtimer.h> 33#include <qtimer.h>
41#include <qtoolbutton.h> 34#include <qtoolbutton.h>
42#include <qlayout.h> 35#include <qlayout.h>
43#include <qhbox.h> 36#include <qhbox.h>
44#include <qlistview.h> 37#include <qlistview.h>
45#include <qwhatsthis.h> 38#include <qwhatsthis.h>
46 39
47#include <limits.h> 40#include <limits.h>
48 41
49// the map file... 42// the map file...
50static const char strZONEINFO[] = "/usr/share/zoneinfo/zone.tab"; 43static const char strZONEINFO[] = "/usr/share/zoneinfo/zone.tab";
51static const char strMAP[] = "citytime/simple_grid_400"; 44static const char strMAP[] = "citytime/simple_grid_400";
52 45
53// the maximum distance we'll allow the pointer to be away from a city 46// the maximum distance we'll allow the pointer to be away from a city
54// and still show the city's time 47// and still show the city's time
55static const int iTHRESHOLD = 50000; 48static const int iTHRESHOLD = 50000;
56 49
57// The label offset (how far away from pointer) 50// The label offset (how far away from pointer)
58static const int iLABELOFFSET = 8; 51static const int iLABELOFFSET = 8;
59 52
60// the size of the dot to draw, and where to start it 53// the size of the dot to draw, and where to start it
61static const int iCITYSIZE = 3; 54static const int iCITYSIZE = 3;
62const int iCITYOFFSET = 2; 55const int iCITYOFFSET = 2;
63 56
64// the darkening function 57// the darkening function
65static inline void darken( QImage *pImage, int start, int stop, int row ); 58static inline void darken( QImage *pImage, int start, int stop, int row );
66static void dayNight( QImage *pImage ); 59static void dayNight( QImage *pImage );
67 60
68ZoneField::ZoneField( const QString& strLine ) 61ZoneField::ZoneField( const QString& strLine )
69{ 62{
70 // make a bunch of RegExp's to match the data from the line 63 // make a bunch of RegExp's to match the data from the line
71 QRegExp regCoord( "[-+][0-9]+" );// the latitude 64 QRegExp regCoord( "[-+][0-9]+" );// the latitude
72 QRegExp regCountry( "[A-Za-z]+/" ); // the country (not good enough) 65 QRegExp regCountry( "[A-Za-z]+/" ); // the country (not good enough)
73 QRegExp regCity( "[A-Za-z_-]*" ); // the city 66 QRegExp regCity( "[A-Za-z_-]*" ); // the city
74 67
75 int iStart, 68 int iStart,
76 iStop, 69 iStop,
77 iLen, 70 iLen,
78 tmp; 71 tmp;
79 QString strTmp; 72 QString strTmp;
80 // we should be able to assume that the country code is always the first 73 // we should be able to assume that the country code is always the first
81 // two chars, so just grap them and let it go... 74 // two chars, so just grap them and let it go...
82 strCountryCode = strLine.left( 2 ); 75 strCountryCode = strLine.left( 2 );
83 iStart = regCoord.match( strLine, 0, &iLen ); 76 iStart = regCoord.match( strLine, 0, &iLen );
84 if ( iStart >= 0 ) { 77 if ( iStart >= 0 ) {
85 strTmp = strLine.mid( iStart, iLen ); 78 strTmp = strLine.mid( iStart, iLen );
86 tmp = strTmp.toInt(); 79 tmp = strTmp.toInt();