summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/DateValue.cpp
Side-by-side diff
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
@@ -19,12 +19,14 @@
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <qregexp.h>
+//Added by qt3to4:
+#include <Q3CString>
#include <kdebug.h>
#include <VCardDefines.h>
#include <VCardDateValue.h>
#include <VCardValue.h>
@@ -102,13 +104,13 @@ DateValue::DateValue(const DateValue & x)
zoneHour_ = x.zoneHour_;
zoneMinute_ = x.zoneMinute_;
secFrac_ = x.secFrac_;
hasTime_ = x.hasTime_;
}
-DateValue::DateValue(const QCString & s)
+DateValue::DateValue(const Q3CString & s)
: Value(s)
{
}
DateValue &
DateValue::operator = (DateValue & x)
@@ -117,13 +119,13 @@ DateValue::operator = (DateValue & x)
Value::operator = (x);
return *this;
}
DateValue &
-DateValue::operator = (const QCString & s)
+DateValue::operator = (const Q3CString & s)
{
Value::operator = (s);
return *this;
}
bool
@@ -151,14 +153,14 @@ DateValue::_parse()
// date = date-full-year ["-"] date-month ["-"] date-mday
// time = time-hour [":"] time-minute [":"] time-second [":"]
// [time-secfrac] [time-zone]
int timeSep = strRep_.find('T');
- QCString dateStr;
- QCString timeStr;
+ Q3CString dateStr;
+ Q3CString timeStr;
if (timeSep == -1) {
dateStr = strRep_;
vDebug("Has date string \"" + dateStr + "\"");
@@ -170,13 +172,13 @@ DateValue::_parse()
timeStr = strRep_.mid(timeSep + 1);
vDebug("Has time string \"" + timeStr + "\"");
}
/////////////////////////////////////////////////////////////// DATE
- dateStr.replace(QRegExp("-"), "");
+ dateStr.replace("-", "");
kdDebug(5710) << "dateStr: " << dateStr << endl;
year_ = dateStr.left(4).toInt();
month_ = dateStr.mid(4, 2).toInt();
day_ = dateStr.right(2).toInt();
@@ -193,13 +195,13 @@ DateValue::_parse()
/////////////////////////////////////////////////////////////// ZONE
int zoneSep = timeStr.find('Z');
if (zoneSep != -1 && timeStr.length() - zoneSep > 3) {
- QCString zoneStr(timeStr.mid(zoneSep + 1));
+ Q3CString zoneStr(timeStr.mid(zoneSep + 1));
vDebug("zoneStr == " + zoneStr);
zonePositive_ = (zoneStr[0] == '+');
zoneHour_ = zoneStr.mid(1, 2).toInt();
zoneMinute_ = zoneStr.right(2).toInt();
@@ -208,47 +210,47 @@ DateValue::_parse()
//////////////////////////////////////////////////// SECOND FRACTION
int secFracSep = timeStr.findRev(',');
if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors.
- QCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep);
+ Q3CString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep);
secFrac_ = quirkafleeg.toDouble();
}
/////////////////////////////////////////////////////////////// HMS
- timeStr.replace(QRegExp(":"), "");
+ timeStr.replace(":", "");
hour_ = timeStr.left(2).toInt();
minute_ = timeStr.mid(2, 2).toInt();
second_ = timeStr.mid(4, 2).toInt();
}
void
DateValue::_assemble()
{
vDebug("DateValue::_assemble");
- QCString year;
- QCString month;
- QCString day;
+ Q3CString year;
+ Q3CString month;
+ Q3CString day;
year.setNum( year_ );
month.setNum( month_ );
day.setNum( day_ );
if ( month.length() < 2 ) month.prepend( "0" );
if ( day.length() < 2 ) day.prepend( "0" );
strRep_ = year + '-' + month + '-' + day;
if ( hasTime_ ) {
- QCString hour;
- QCString minute;
- QCString second;
+ Q3CString hour;
+ Q3CString minute;
+ Q3CString second;
hour.setNum( hour_ );
minute.setNum( minute_ );
second.setNum( second_ );
if ( hour.length() < 2 ) hour.prepend( "0" );