summaryrefslogtreecommitdiff
path: root/library/tzselect.cpp
authorzecke <zecke>2002-10-01 10:40:16 (UTC)
committer zecke <zecke>2002-10-01 10:40:16 (UTC)
commitc79aa2c8de0f508d45b993521b5c11e39de221e9 (patch) (side-by-side diff)
treec132b7cd24fc5604ce52840daccb873edd2e53e5 /library/tzselect.cpp
parent61fdbd044d40cb3c93eab5a1ba262964a9413c66 (diff)
downloadopie-c79aa2c8de0f508d45b993521b5c11e39de221e9.zip
opie-c79aa2c8de0f508d45b993521b5c11e39de221e9.tar.gz
opie-c79aa2c8de0f508d45b993521b5c11e39de221e9.tar.bz2
Patch by stelian
to fix problem with timezone switching The CityTime settngs app writes in to CityTime where the tzselector wanted to read from WorldTime thank
Diffstat (limited to 'library/tzselect.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/tzselect.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/tzselect.cpp b/library/tzselect.cpp
index e16b8d4..9436867 100644
--- a/library/tzselect.cpp
+++ b/library/tzselect.cpp
@@ -46,97 +46,97 @@ TZCombo::TZCombo( QWidget *p, const char* n )
// check to see if TZ is set, if it is set the current item to that
QString tz = getenv("TZ");
if (parent()->inherits("TimeZoneSelector")) {
if ( ((TimeZoneSelector *)parent())->localIncluded() ) {
// overide to the 'local' type.
tz = "None";
}
}
if ( !tz.isNull() ) {
int n = 0,
index = 0;
for ( QStringList::Iterator it=identifiers.begin();
it!=identifiers.end(); ++it) {
if ( *it == tz )
index = n;
n++;
}
setCurrentItem(index);
} else {
setCurrentItem(0);
}
// listen on QPE/System
#if defined(Q_WS_QWS)
#if !defined(QT_NO_COP)
QCopChannel *channel = new QCopChannel( "QPE/System", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
this, SLOT(handleSystemChannel(const QCString&, const QByteArray&)) );
#endif
#endif
}
TZCombo::~TZCombo()
{
}
void TZCombo::updateZones()
{
QString cur = currentText();
clear();
identifiers.clear();
int curix=0;
QString tz = getenv("TZ");
bool tzFound = FALSE;
- Config cfg("WorldTime");
+ Config cfg("CityTime");
cfg.setGroup("TimeZones");
int listIndex = 0;
if (parent()->inherits("TimeZoneSelector")) {
if ( ((TimeZoneSelector *)parent())->localIncluded() ) {
// overide to the 'local' type.
identifiers.append( "None" );
insertItem( tr("None") );
if ( cur == tr("None"))
curix = 0;
listIndex++;
}
}
int cfgIndex = 0;
while (1) {
QString zn = cfg.readEntry("Zone"+QString::number(cfgIndex), QString::null);
if ( zn.isNull() )
break;
if ( zn == tz )
tzFound = TRUE;
QString nm = cfg.readEntry("ZoneName"+QString::number(cfgIndex));
identifiers.append(zn);
insertItem(nm);
if ( nm == cur )
curix = listIndex;
++cfgIndex;
++listIndex;
}
if ( !listIndex ) {
QStringList list = timezoneDefaults();
for ( QStringList::Iterator it = list.begin(); it!=list.end(); ++it ) {
QString zn = *it;
QString nm = *++it;
if ( zn == tz )
tzFound = TRUE;
if ( nm == cur )
curix = listIndex;
identifiers.append(zn);
insertItem(nm);
++listIndex;
}
}
for (QStringList::Iterator it=extras.begin(); it!=extras.end(); ++it) {
insertItem(*it);
identifiers.append(*it);
if ( *it == cur )
curix = listIndex;
++listIndex;
}