-rw-r--r-- | korganizer/calendarview.cpp | 3 | ||||
-rw-r--r-- | libkcal/vcalformat.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 687943e..b1da144 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1509,17 +1509,17 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1509 | } | 1509 | } |
1510 | globalFlagBlockAgenda = 2; | 1510 | globalFlagBlockAgenda = 2; |
1511 | // if ( getLastSyncEvent() ) | 1511 | // if ( getLastSyncEvent() ) |
1512 | // getLastSyncEvent()->setReadOnly( true ); | 1512 | // getLastSyncEvent()->setReadOnly( true ); |
1513 | mCalendar->reInitAlarmSettings(); | 1513 | mCalendar->reInitAlarmSettings(); |
1514 | setSyncEventsReadOnly(); | 1514 | setSyncEventsReadOnly(); |
1515 | updateUnmanagedViews(); | 1515 | updateUnmanagedViews(); |
1516 | updateView(); | 1516 | updateView(); |
1517 | loadedFileVersion = QDateTime::currentDateTime(); | 1517 | setLoadedFileVersion( QDateTime::currentDateTime().addSecs( -1 )); |
1518 | if ( filename != MainWindow::defaultFileName() ) { | 1518 | if ( filename != MainWindow::defaultFileName() ) { |
1519 | saveCalendar( MainWindow::defaultFileName() ); | 1519 | saveCalendar( MainWindow::defaultFileName() ); |
1520 | watchSavedFile(); | 1520 | watchSavedFile(); |
1521 | } | 1521 | } |
1522 | return true; | 1522 | return true; |
1523 | } else { | 1523 | } else { |
1524 | // while failing to load, the calendar object could | 1524 | // while failing to load, the calendar object could |
1525 | // have become partially populated. Clear it out. | 1525 | // have become partially populated. Clear it out. |
@@ -1562,16 +1562,17 @@ bool CalendarView::checkFileChanged(QString fn) | |||
1562 | } | 1562 | } |
1563 | void CalendarView::watchSavedFile() | 1563 | void CalendarView::watchSavedFile() |
1564 | { | 1564 | { |
1565 | QFileInfo finf ( MainWindow::defaultFileName()); | 1565 | QFileInfo finf ( MainWindow::defaultFileName()); |
1566 | if ( !finf.exists() ) | 1566 | if ( !finf.exists() ) |
1567 | return; | 1567 | return; |
1568 | QDateTime dt = finf.lastModified (); | 1568 | QDateTime dt = finf.lastModified (); |
1569 | if ( dt < loadedFileVersion ) { | 1569 | if ( dt < loadedFileVersion ) { |
1570 | //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); | ||
1570 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); | 1571 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); |
1571 | return; | 1572 | return; |
1572 | } | 1573 | } |
1573 | loadedFileVersion = dt; | 1574 | loadedFileVersion = dt; |
1574 | } | 1575 | } |
1575 | 1576 | ||
1576 | bool CalendarView::checkFileVersion(QString fn) | 1577 | bool CalendarView::checkFileVersion(QString fn) |
1577 | { | 1578 | { |
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 4727a7a..309c699 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp | |||
@@ -1479,17 +1479,17 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr) | |||
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 | ||
1491 | QDate VCalFormat::ISOToQDate(const QString &dateStr) | 1491 | QDate 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(); |