summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/citytime/citytime.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/settings/citytime/citytime.cpp b/core/settings/citytime/citytime.cpp
index 5dc9b02..b359ae1 100644
--- a/core/settings/citytime/citytime.cpp
+++ b/core/settings/citytime/citytime.cpp
@@ -36,33 +36,35 @@
#include <qlabel.h>
#include <qmessagebox.h>
#include <qregexp.h>
#include <qtextstream.h>
#include <qtoolbutton.h>
#include <qlayout.h>
#include <stdlib.h>
CityTime::CityTime( QWidget *parent, const char* name,
WFlags fl )
: CityTimeBase( parent, name, fl ),
strRealTz(0),
bAdded(false)
{
Config config( "qpe" );
+ config.setGroup( "Time" );
bWhichClock = config.readBoolEntry( "AMPM", TRUE );
+ qDebug( QString("%1").arg(bWhichClock) );
frmMap->changeClock( bWhichClock );
char *pEnv;
pEnv = NULL;
pEnv = getenv("TZ");
if ( pEnv )
strRealTz = pEnv;
pEnv = NULL;
pEnv = getenv("HOME");
if ( pEnv )
strHome = pEnv;
// append the labels to their respective lists...
listCities.setAutoDelete( true );
listTimes.setAutoDelete( true );
listCities.append( cmdCity1 );
@@ -170,33 +172,33 @@ void CityTime::timerEvent( QTimerEvent *e )
void CityTime::mousePressEvent( QMouseEvent * )
{
// DEBUG enable this to get a look at the zone information DEBUG
// frmMap->showZones();
}
void CityTime::showTime( void )
{
int i;
QListIterator<QLabel> itTime(listTimes);
// traverse the list...
for ( i = 0, itTime.toFirst(); i < CITIES; i++, ++itTime) {
if ( !strCityTz[i].isNull() ) {
if ( setenv( "TZ", strCityTz[i], true ) == 0 ) {
- itTime.current()->setText( TimeString::shortTime(bWhichClock) );
+ itTime.current()->setText( TimeString::shortTime( bWhichClock ) );
} else {
QMessageBox::critical( this, tr( "Time Changing" ),
tr( "There was a problem setting timezone %1" )
.arg( QString::number( i + 1 ) ) );
}
}
}
// done playing around... put it all back
unsetenv( "TZ" );
if ( !strRealTz.isNull() ) {
if ( setenv( "TZ", strRealTz, true ) != 0 ) {
QMessageBox::critical( this, tr( "Restore Time Zone" ),
tr( "There was a problem setting your timezone."
"Your time may be wrong now..." ) );
}
}