summaryrefslogtreecommitdiff
path: root/library/tzselect.cpp
authoralwin <alwin>2004-03-02 12:21:11 (UTC)
committer alwin <alwin>2004-03-02 12:21:11 (UTC)
commitb6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff)
treed3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /library/tzselect.cpp
parent0d59c780513da78033f4d9040475dee9db0256d4 (diff)
downloadopie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz
opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'library/tzselect.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/tzselect.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/tzselect.cpp b/library/tzselect.cpp
index f28100b..848dfb7 100644
--- a/library/tzselect.cpp
+++ b/library/tzselect.cpp
@@ -56,50 +56,50 @@ TZCombo::TZCombo( QWidget *p, const char* n )
56 if ( ((TimeZoneSelector *)parent())->localIncluded() ) { 56 if ( ((TimeZoneSelector *)parent())->localIncluded() ) {
57 // overide to the 'local' type. 57 // overide to the 'local' type.
58 tz = "None"; 58 tz = "None";
59 } 59 }
60 } 60 }
61 if ( !tz.isNull() ) { 61 if ( !tz.isNull() ) {
62 int n = 0, 62 int n = 0,
63 index = 0; 63 index = 0;
64 for ( QStringList::Iterator it=identifiers.begin(); 64 for ( QStringList::Iterator it=identifiers.begin();
65 it!=identifiers.end(); ++it) { 65 it!=identifiers.end(); ++it) {
66 if ( *it == tz ) 66 if ( *it == tz )
67 index = n; 67 index = n;
68 n++; 68 n++;
69 } 69 }
70 setCurrentItem(index); 70 setCurrentItem(index);
71 } else { 71 } else {
72 setCurrentItem(0); 72 setCurrentItem(0);
73 } 73 }
74 74
75 75
76 76
77 // listen on QPE/System 77 // listen on QPE/System
78#if !defined(QT_NO_COP) 78#if !defined(QT_NO_COP)
79 QCopChannel *channel = new QCopChannel( "QPE/System", this ); 79 QCopChannel *channel = new QCopChannel( "QPE/System", this );
80 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 80 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
81 this, SLOT(handleSystemChannel(const QCString&, const QByteArray&)) ); 81 this, SLOT(handleSystemChannel(const QCString&,const QByteArray&)) );
82#endif 82#endif
83 83
84 84
85} 85}
86 86
87TZCombo::~TZCombo() 87TZCombo::~TZCombo()
88{ 88{
89} 89}
90 90
91void TZCombo::updateZones() 91void TZCombo::updateZones()
92{ 92{
93 QString cur = currentText(); 93 QString cur = currentText();
94 clear(); 94 clear();
95 identifiers.clear(); 95 identifiers.clear();
96 int curix=0; 96 int curix=0;
97 QString tz = getenv("TZ"); 97 QString tz = getenv("TZ");
98 bool tzFound = FALSE; 98 bool tzFound = FALSE;
99 Config cfg("CityTime"); 99 Config cfg("CityTime");
100 cfg.setGroup("TimeZones"); 100 cfg.setGroup("TimeZones");
101 int listIndex = 0; 101 int listIndex = 0;
102 if (parent()->inherits("TimeZoneSelector")) { 102 if (parent()->inherits("TimeZoneSelector")) {
103 if ( ((TimeZoneSelector *)parent())->localIncluded() ) { 103 if ( ((TimeZoneSelector *)parent())->localIncluded() ) {
104 // overide to the 'local' type. 104 // overide to the 'local' type.
105 identifiers.append( "None" ); 105 identifiers.append( "None" );
@@ -197,50 +197,50 @@ void TZCombo::handleSystemChannel(const QCString&msg, const QByteArray&)
197{ 197{
198 if ( msg == "timeZoneListChange()" ) { 198 if ( msg == "timeZoneListChange()" ) {
199 updateZones(); 199 updateZones();
200 } 200 }
201} 201}
202 202
203/*! 203/*!
204 Creates a new TimeZoneSelector with parent \a p and name \a n. The combobox will be 204 Creates a new TimeZoneSelector with parent \a p and name \a n. The combobox will be
205 populated with the available timezones. 205 populated with the available timezones.
206*/ 206*/
207 207
208TimeZoneSelector::TimeZoneSelector(QWidget* p, const char* n) : 208TimeZoneSelector::TimeZoneSelector(QWidget* p, const char* n) :
209 QHBox(p,n) 209 QHBox(p,n)
210{ 210{
211 d = new TimeZoneSelectorPrivate(); 211 d = new TimeZoneSelectorPrivate();
212 // build the combobox before we do any updates... 212 // build the combobox before we do any updates...
213 cmbTz = new TZCombo( this, "timezone combo" ); 213 cmbTz = new TZCombo( this, "timezone combo" );
214 214
215 cmdTz = new QToolButton( this, "timezone button" ); 215 cmdTz = new QToolButton( this, "timezone button" );
216 cmdTz->setIconSet( Resource::loadIconSet( "citytime_icon" ) ); 216 cmdTz->setIconSet( Resource::loadIconSet( "citytime_icon" ) );
217 cmdTz->setMaximumSize( cmdTz->sizeHint() ); 217 cmdTz->setMaximumSize( cmdTz->sizeHint() );
218 218
219 // set up a connection to catch a newly selected item and throw our 219 // set up a connection to catch a newly selected item and throw our
220 // signal 220 // signal
221 QObject::connect( cmbTz, SIGNAL( activated( int ) ), 221 QObject::connect( cmbTz, SIGNAL( activated(int) ),
222 this, SLOT( slotTzActive( int ) ) ); 222 this, SLOT( slotTzActive(int) ) );
223 QObject::connect( cmdTz, SIGNAL( clicked() ), 223 QObject::connect( cmdTz, SIGNAL( clicked() ),
224 this, SLOT( slotExecute() ) ); 224 this, SLOT( slotExecute() ) );
225} 225}
226 226
227/*! 227/*!
228 Destroys a TimeZoneSelector. 228 Destroys a TimeZoneSelector.
229*/ 229*/
230TimeZoneSelector::~TimeZoneSelector() 230TimeZoneSelector::~TimeZoneSelector()
231{ 231{
232} 232}
233 233
234void TimeZoneSelector::setLocalIncluded(bool b) 234void TimeZoneSelector::setLocalIncluded(bool b)
235{ 235{
236 d->includeLocal = b; 236 d->includeLocal = b;
237 cmbTz->updateZones(); 237 cmbTz->updateZones();
238} 238}
239 239
240bool TimeZoneSelector::localIncluded() const 240bool TimeZoneSelector::localIncluded() const
241{ 241{
242 return d->includeLocal; 242 return d->includeLocal;
243} 243}
244 244
245/*! 245/*!
246 Returns the currently selected timezone as a string in location format, e.g. 246 Returns the currently selected timezone as a string in location format, e.g.