summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/vcalformat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 4727a7a..309c699 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -1463,49 +1463,49 @@ QString VCalFormat::qDateTimeToISO(const QDateTime &qdt, bool zulu)
1463} 1463}
1464 1464
1465QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr) 1465QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr)
1466{ 1466{
1467 QDate tmpDate; 1467 QDate tmpDate;
1468 QTime tmpTime; 1468 QTime tmpTime;
1469 QString tmpStr; 1469 QString tmpStr;
1470 int year, month, day, hour, minute, second; 1470 int year, month, day, hour, minute, second;
1471 1471
1472 tmpStr = dtStr; 1472 tmpStr = dtStr;
1473 year = tmpStr.left(4).toInt(); 1473 year = tmpStr.left(4).toInt();
1474 month = tmpStr.mid(4,2).toInt(); 1474 month = tmpStr.mid(4,2).toInt();
1475 day = tmpStr.mid(6,2).toInt(); 1475 day = tmpStr.mid(6,2).toInt();
1476 hour = tmpStr.mid(9,2).toInt(); 1476 hour = tmpStr.mid(9,2).toInt();
1477 minute = tmpStr.mid(11,2).toInt(); 1477 minute = tmpStr.mid(11,2).toInt();
1478 second = tmpStr.mid(13,2).toInt(); 1478 second = tmpStr.mid(13,2).toInt();
1479 tmpDate.setYMD(year, month, day); 1479 tmpDate.setYMD(year, month, day);
1480 tmpTime.setHMS(hour, minute, second); 1480 tmpTime.setHMS(hour, minute, second);
1481 1481
1482 ASSERT(tmpDate.isValid()); 1482 ASSERT(tmpDate.isValid());
1483 ASSERT(tmpTime.isValid()); 1483 ASSERT(tmpTime.isValid());
1484 QDateTime tmpDT(tmpDate, tmpTime); 1484 QDateTime tmpDT(tmpDate, tmpTime);
1485 // correct for GMT if string is in Zulu format 1485 // correct for GMT if string is in Zulu format
1486 if (dtStr.at(dtStr.length()-1) == 'Z') 1486 if (dtStr.at(dtStr.length()-1) == 'Z')
1487 tmpDT = tmpDT.addSecs(60*mCalendar->getTimeZone()); 1487 tmpDT = tmpDT.addSecs (KGlobal::locale()->localTimeOffset( tmpDT )*60);
1488 return tmpDT; 1488 return tmpDT;
1489} 1489}
1490 1490
1491QDate VCalFormat::ISOToQDate(const QString &dateStr) 1491QDate VCalFormat::ISOToQDate(const QString &dateStr)
1492{ 1492{
1493 int year, month, day; 1493 int year, month, day;
1494 1494
1495 year = dateStr.left(4).toInt(); 1495 year = dateStr.left(4).toInt();
1496 month = dateStr.mid(4,2).toInt(); 1496 month = dateStr.mid(4,2).toInt();
1497 day = dateStr.mid(6,2).toInt(); 1497 day = dateStr.mid(6,2).toInt();
1498 1498
1499 return(QDate(year, month, day)); 1499 return(QDate(year, month, day));
1500} 1500}
1501 1501
1502// take a raw vcalendar (i.e. from a file on disk, clipboard, etc. etc. 1502// take a raw vcalendar (i.e. from a file on disk, clipboard, etc. etc.
1503// and break it down from it's tree-like format into the dictionary format 1503// and break it down from it's tree-like format into the dictionary format
1504// that is used internally in the VCalFormat. 1504// that is used internally in the VCalFormat.
1505void VCalFormat::populate(VObject *vcal) 1505void VCalFormat::populate(VObject *vcal)
1506{ 1506{
1507 // this function will populate the caldict dictionary and other event 1507 // this function will populate the caldict dictionary and other event
1508 // lists. It turns vevents into Events and then inserts them. 1508 // lists. It turns vevents into Events and then inserts them.
1509 1509
1510 VObjectIterator i; 1510 VObjectIterator i;
1511 VObject *curVO, *curVOProp; 1511 VObject *curVO, *curVOProp;