summaryrefslogtreecommitdiff
path: root/library/tzselect.cpp
Unidiff
Diffstat (limited to 'library/tzselect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/tzselect.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/library/tzselect.cpp b/library/tzselect.cpp
index 9436867..2e5a433 100644
--- a/library/tzselect.cpp
+++ b/library/tzselect.cpp
@@ -7,95 +7,91 @@
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#define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL 21#define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL
22 22
23#include "tzselect.h" 23#include "tzselect.h"
24#include "resource.h" 24#include "resource.h"
25#include "global.h" 25#include "global.h"
26#include "config.h" 26#include "config.h"
27#include <qtoolbutton.h> 27#include <qtoolbutton.h>
28#include <qfile.h> 28#include <qfile.h>
29#include <stdlib.h> 29#include <stdlib.h>
30 30
31#ifdef Q_WS_QWS
32#include <qcopchannel_qws.h> 31#include <qcopchannel_qws.h>
33#endif
34 32
35class TimeZoneSelectorPrivate 33class TimeZoneSelectorPrivate
36{ 34{
37public: 35public:
38 TimeZoneSelectorPrivate() : includeLocal(FALSE) {} 36 TimeZoneSelectorPrivate() : includeLocal(FALSE) {}
39 bool includeLocal; 37 bool includeLocal;
40}; 38};
41 39
42TZCombo::TZCombo( QWidget *p, const char* n ) 40TZCombo::TZCombo( QWidget *p, const char* n )
43 : QComboBox( p, n ) 41 : QComboBox( p, n )
44{ 42{
45 updateZones(); 43 updateZones();
46 // check to see if TZ is set, if it is set the current item to that 44 // check to see if TZ is set, if it is set the current item to that
47 QString tz = getenv("TZ"); 45 QString tz = getenv("TZ");
48 if (parent()->inherits("TimeZoneSelector")) { 46 if (parent()->inherits("TimeZoneSelector")) {
49 if ( ((TimeZoneSelector *)parent())->localIncluded() ) { 47 if ( ((TimeZoneSelector *)parent())->localIncluded() ) {
50 // overide to the 'local' type. 48 // overide to the 'local' type.
51 tz = "None"; 49 tz = "None";
52 } 50 }
53 } 51 }
54 if ( !tz.isNull() ) { 52 if ( !tz.isNull() ) {
55 int n = 0, 53 int n = 0,
56 index = 0; 54 index = 0;
57 for ( QStringList::Iterator it=identifiers.begin(); 55 for ( QStringList::Iterator it=identifiers.begin();
58 it!=identifiers.end(); ++it) { 56 it!=identifiers.end(); ++it) {
59 if ( *it == tz ) 57 if ( *it == tz )
60 index = n; 58 index = n;
61 n++; 59 n++;
62 } 60 }
63 setCurrentItem(index); 61 setCurrentItem(index);
64 } else { 62 } else {
65 setCurrentItem(0); 63 setCurrentItem(0);
66 } 64 }
67 65
68 66
69 67
70 // listen on QPE/System 68 // listen on QPE/System
71#if defined(Q_WS_QWS)
72#if !defined(QT_NO_COP) 69#if !defined(QT_NO_COP)
73 QCopChannel *channel = new QCopChannel( "QPE/System", this ); 70 QCopChannel *channel = new QCopChannel( "QPE/System", this );
74 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 71 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
75 this, SLOT(handleSystemChannel(const QCString&, const QByteArray&)) ); 72 this, SLOT(handleSystemChannel(const QCString&, const QByteArray&)) );
76#endif 73#endif
77#endif
78 74
79 75
80} 76}
81 77
82TZCombo::~TZCombo() 78TZCombo::~TZCombo()
83{ 79{
84} 80}
85 81
86void TZCombo::updateZones() 82void TZCombo::updateZones()
87{ 83{
88 QString cur = currentText(); 84 QString cur = currentText();
89 clear(); 85 clear();
90 identifiers.clear(); 86 identifiers.clear();
91 int curix=0; 87 int curix=0;
92 QString tz = getenv("TZ"); 88 QString tz = getenv("TZ");
93 bool tzFound = FALSE; 89 bool tzFound = FALSE;
94 Config cfg("CityTime"); 90 Config cfg("CityTime");
95 cfg.setGroup("TimeZones"); 91 cfg.setGroup("TimeZones");
96 int listIndex = 0; 92 int listIndex = 0;
97 if (parent()->inherits("TimeZoneSelector")) { 93 if (parent()->inherits("TimeZoneSelector")) {
98 if ( ((TimeZoneSelector *)parent())->localIncluded() ) { 94 if ( ((TimeZoneSelector *)parent())->localIncluded() ) {
99 // overide to the 'local' type. 95 // overide to the 'local' type.
100 identifiers.append( "None" ); 96 identifiers.append( "None" );
101 insertItem( tr("None") ); 97 insertItem( tr("None") );