-rw-r--r-- | core/settings/citytime/zonemap.cpp | 2 | ||||
-rw-r--r-- | pics/simple_grid_400.png | bin | 4533 -> 0 bytes |
2 files changed, 1 insertions, 1 deletions
diff --git a/core/settings/citytime/zonemap.cpp b/core/settings/citytime/zonemap.cpp index 337f4d9..1d60aee 100644 --- a/core/settings/citytime/zonemap.cpp +++ b/core/settings/citytime/zonemap.cpp @@ -1,141 +1,141 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "sun.h" #include "zonemap.h" #include <qpe/resource.h> #include <qpe/timestring.h> #include <qpe/qpeapplication.h> #include <qdatetime.h> #include <qfile.h> #include <qimage.h> #include <qlabel.h> #include <qlist.h> #include <qmessagebox.h> #include <qpixmap.h> #include <qpainter.h> #include <qregexp.h> #include <qtextstream.h> #include <qtimer.h> #include <qtoolbutton.h> #include <limits.h> // the map file... static const char strZONEINFO[] = "/usr/share/zoneinfo/zone.tab"; -static const char strMAP[] = "simple_grid_400"; +static const char strMAP[] = "citytime/simple_grid_400"; // the maximum distance we'll allow the pointer to be away from a city // and still show the city's time static const int iTHRESHOLD = 50000; // The label offset (how far away from pointer) static const int iLABELOFFSET = 8; // the size of the dot to draw, and where to start it static const int iCITYSIZE = 3; const int iCITYOFFSET = 2; // the darkening function static inline void darken( QImage *pImage, int start, int stop, int row ); static void dayNight( QImage *pImage ); ZoneField::ZoneField( const QString& strLine ) { // make a bunch of RegExp's to match the data from the line QRegExp regCoord( "[-+][0-9]+" ); // the latitude QRegExp regCountry( "[A-Za-z]+/" ); // the country (not good enough) QRegExp regCity( "[A-Za-z_-]*" ); // the city int iStart, iStop, iLen, tmp; QString strTmp; // we should be able to assume that the country code is always the first // two chars, so just grap them and let it go... strCountryCode = strLine.left( 2 ); iStart = regCoord.match( strLine, 0, &iLen ); if ( iStart >= 0 ) { strTmp = strLine.mid( iStart, iLen ); tmp = strTmp.toInt(); // okay, there are two versions of the format, make a decision based on // the size... // Oh BTW, we are storing everything in seconds! if ( iLen < 7 ) { _y = tmp / 100; _y *= 60; _y += tmp % 100; _y *= 60; } else { _y = tmp / 10000; _y *= 60; tmp %= 10000; _y += tmp / 100; _y *= 60; tmp %= 100; _y += tmp; } } iStart = regCoord.match( strLine, iStart + iLen, &iLen ); if ( iStart >= 0 ) { strTmp = strLine.mid( iStart, iLen ); tmp = strTmp.toInt(); if ( iLen < 8 ) { _x = tmp / 100; _x *= 60; _x += tmp % 100; _x *= 60; } else { _x = tmp / 10000; _x *= 60; tmp %= 10000; _x += tmp / 100; _x *= 60; tmp %= 100; _x += tmp; } } iStart = regCountry.match( strLine, 0, &iLen ); // help with the shortcoming in 2.x regexp... iStop = strLine.findRev( '/' ); if ( iStart >= 0 ) { iLen = (iStop - iStart) + 1; strCountry = strLine.mid( iStart, iLen ); } // now match the city... iStart = regCity.match( strLine, iStart + iLen, &iLen ); if ( iStart >= 0 ) { strCity = strLine.mid( iStart, iLen ); } } void ZoneField::showStructure( void ) const { qDebug( "Country: %s", strCountry.latin1() ); qDebug( "City: %s", strCity.latin1() ); qDebug( "x: %d", _x ); qDebug( "y: %d\n", _y ); } ZoneMap::ZoneMap( QWidget *parent, const char* name ) : QScrollView( parent, name ), diff --git a/pics/simple_grid_400.png b/pics/simple_grid_400.png Binary files differdeleted file mode 100644 index 5e0e21d..0000000 --- a/pics/simple_grid_400.png +++ b/dev/null |