summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/DateValue.cpp
Unidiff
Diffstat (limited to 'kabc/vcard/DateValue.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/DateValue.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/kabc/vcard/DateValue.cpp b/kabc/vcard/DateValue.cpp
index c5c5c85..87c7007 100644
--- a/kabc/vcard/DateValue.cpp
+++ b/kabc/vcard/DateValue.cpp
@@ -22,6 +22,8 @@
22*/ 22*/
23 23
24#include <qregexp.h> 24#include <qregexp.h>
25//Added by qt3to4:
26#include <Q3CString>
25 27
26#include <kdebug.h> 28#include <kdebug.h>
27 29
@@ -105,7 +107,7 @@ DateValue::DateValue(const DateValue & x)
105 hasTime_ = x.hasTime_; 107 hasTime_ = x.hasTime_;
106} 108}
107 109
108DateValue::DateValue(const QCString & s) 110DateValue::DateValue(const Q3CString & s)
109 :Value(s) 111 :Value(s)
110{ 112{
111} 113}
@@ -120,7 +122,7 @@ DateValue::operator = (DateValue & x)
120} 122}
121 123
122 DateValue & 124 DateValue &
123DateValue::operator = (const QCString & s) 125DateValue::operator = (const Q3CString & s)
124{ 126{
125 Value::operator = (s); 127 Value::operator = (s);
126 return *this; 128 return *this;
@@ -154,8 +156,8 @@ DateValue::_parse()
154 156
155 int timeSep = strRep_.find('T'); 157 int timeSep = strRep_.find('T');
156 158
157 QCString dateStr; 159 Q3CString dateStr;
158 QCString timeStr; 160 Q3CString timeStr;
159 161
160 if (timeSep == -1) { 162 if (timeSep == -1) {
161 163
@@ -173,7 +175,7 @@ DateValue::_parse()
173 175
174 /////////////////////////////////////////////////////////////// DATE 176 /////////////////////////////////////////////////////////////// DATE
175 177
176 dateStr.replace(QRegExp("-"), ""); 178 dateStr.replace("-", "");
177 179
178 kdDebug(5710) << "dateStr: " << dateStr << endl; 180 kdDebug(5710) << "dateStr: " << dateStr << endl;
179 181
@@ -196,7 +198,7 @@ DateValue::_parse()
196 198
197 if (zoneSep != -1 && timeStr.length() - zoneSep > 3) { 199 if (zoneSep != -1 && timeStr.length() - zoneSep > 3) {
198 200
199 QCString zoneStr(timeStr.mid(zoneSep + 1)); 201 Q3CString zoneStr(timeStr.mid(zoneSep + 1));
200 vDebug("zoneStr == " + zoneStr); 202 vDebug("zoneStr == " + zoneStr);
201 203
202 zonePositive_= (zoneStr[0] == '+'); 204 zonePositive_= (zoneStr[0] == '+');
@@ -211,13 +213,13 @@ DateValue::_parse()
211 int secFracSep = timeStr.findRev(','); 213 int secFracSep = timeStr.findRev(',');
212 214
213 if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors. 215 if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors.
214 QCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); 216 Q3CString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep);
215 secFrac_ = quirkafleeg.toDouble(); 217 secFrac_ = quirkafleeg.toDouble();
216 } 218 }
217 219
218 /////////////////////////////////////////////////////////////// HMS 220 /////////////////////////////////////////////////////////////// HMS
219 221
220 timeStr.replace(QRegExp(":"), ""); 222 timeStr.replace(":", "");
221 223
222 hour_= timeStr.left(2).toInt(); 224 hour_= timeStr.left(2).toInt();
223 minute_= timeStr.mid(2, 2).toInt(); 225 minute_= timeStr.mid(2, 2).toInt();
@@ -229,9 +231,9 @@ DateValue::_assemble()
229{ 231{
230 vDebug("DateValue::_assemble"); 232 vDebug("DateValue::_assemble");
231 233
232 QCString year; 234 Q3CString year;
233 QCString month; 235 Q3CString month;
234 QCString day; 236 Q3CString day;
235 237
236 year.setNum( year_ ); 238 year.setNum( year_ );
237 month.setNum( month_ ); 239 month.setNum( month_ );
@@ -243,9 +245,9 @@ DateValue::_assemble()
243 strRep_ = year + '-' + month + '-' + day; 245 strRep_ = year + '-' + month + '-' + day;
244 246
245 if ( hasTime_ ) { 247 if ( hasTime_ ) {
246 QCString hour; 248 Q3CString hour;
247 QCString minute; 249 Q3CString minute;
248 QCString second; 250 Q3CString second;
249 251
250 hour.setNum( hour_ ); 252 hour.setNum( hour_ );
251 minute.setNum( minute_ ); 253 minute.setNum( minute_ );