summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-05 13:34:33 (UTC)
committer zautrix <zautrix>2004-10-05 13:34:33 (UTC)
commit191ced43b27c047b0a39f0acdc8ba1f8a58817df (patch) (side-by-side diff)
treed164ae32c16259d9a8d5c9fdfa74f975d1f10075
parenta946c09db6f71f595d8bdcb6b34ba3160c5497dc (diff)
downloadkdepimpi-191ced43b27c047b0a39f0acdc8ba1f8a58817df.zip
kdepimpi-191ced43b27c047b0a39f0acdc8ba1f8a58817df.tar.gz
kdepimpi-191ced43b27c047b0a39f0acdc8ba1f8a58817df.tar.bz2
fix for filewatch and vcal timezone
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp3
-rw-r--r--libkcal/vcalformat.cpp2
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
@@ -1505,25 +1505,25 @@ bool CalendarView::openCalendar(QString filename, bool merge)
//setModified( true );
mViewManager->setDocumentId( filename );
mDialogManager->setDocumentId( filename );
mTodoList->setDocumentId( filename );
}
globalFlagBlockAgenda = 2;
// if ( getLastSyncEvent() )
// getLastSyncEvent()->setReadOnly( true );
mCalendar->reInitAlarmSettings();
setSyncEventsReadOnly();
updateUnmanagedViews();
updateView();
- loadedFileVersion = QDateTime::currentDateTime();
+ setLoadedFileVersion( QDateTime::currentDateTime().addSecs( -1 ));
if ( filename != MainWindow::defaultFileName() ) {
saveCalendar( MainWindow::defaultFileName() );
watchSavedFile();
}
return true;
} else {
// while failing to load, the calendar object could
// have become partially populated. Clear it out.
if ( !merge ) {
mCalendar->close();
mViewManager->setDocumentId( filename );
mDialogManager->setDocumentId( filename );
@@ -1558,24 +1558,25 @@ bool CalendarView::checkFileChanged(QString fn)
if ( dt <= loadedFileVersion )
return false;
return true;
}
void CalendarView::watchSavedFile()
{
QFileInfo finf ( MainWindow::defaultFileName());
if ( !finf.exists() )
return;
QDateTime dt = finf.lastModified ();
if ( dt < loadedFileVersion ) {
+ //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
return;
}
loadedFileVersion = dt;
}
bool CalendarView::checkFileVersion(QString fn)
{
QFileInfo finf ( fn );
if ( !finf.exists() )
return true;
QDateTime dt = finf.lastModified ();
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp
index 4727a7a..309c699 100644
--- a/libkcal/vcalformat.cpp
+++ b/libkcal/vcalformat.cpp
@@ -1475,25 +1475,25 @@ QDateTime VCalFormat::ISOToQDateTime(const QString & dtStr)
day = tmpStr.mid(6,2).toInt();
hour = tmpStr.mid(9,2).toInt();
minute = tmpStr.mid(11,2).toInt();
second = tmpStr.mid(13,2).toInt();
tmpDate.setYMD(year, month, day);
tmpTime.setHMS(hour, minute, second);
ASSERT(tmpDate.isValid());
ASSERT(tmpTime.isValid());
QDateTime tmpDT(tmpDate, tmpTime);
// correct for GMT if string is in Zulu format
if (dtStr.at(dtStr.length()-1) == 'Z')
- tmpDT = tmpDT.addSecs(60*mCalendar->getTimeZone());
+ tmpDT = tmpDT.addSecs (KGlobal::locale()->localTimeOffset( tmpDT )*60);
return tmpDT;
}
QDate VCalFormat::ISOToQDate(const QString &dateStr)
{
int year, month, day;
year = dateStr.left(4).toInt();
month = dateStr.mid(4,2).toInt();
day = dateStr.mid(6,2).toInt();
return(QDate(year, month, day));