summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp36
-rw-r--r--korganizer/calendarview.h4
-rw-r--r--korganizer/mainwindow.cpp4
3 files changed, 12 insertions, 32 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 04051a2..0c35bb3 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -697,13 +697,8 @@ void CalendarView::createPrinter()
697 } 697 }
698#endif 698#endif
699} 699}
700 700
701void CalendarView::confSync()
702{
703 //DELETE
704}
705
706 701
707//KOPrefs::instance()->mWriteBackFile 702//KOPrefs::instance()->mWriteBackFile
708//KOPrefs::instance()->mWriteBackExistingOnly 703//KOPrefs::instance()->mWriteBackExistingOnly
709 704
@@ -1200,8 +1195,9 @@ void CalendarView::setSyncName( QString s )
1200 mCurrentSyncName= s; 1195 mCurrentSyncName= s;
1201} 1196}
1202bool CalendarView::syncCalendar(QString filename, int mode) 1197bool CalendarView::syncCalendar(QString filename, int mode)
1203{ 1198{
1199 //qDebug("syncCalendar %s ", filename.latin1());
1204 mGlobalSyncMode = SYNC_MODE_NORMAL; 1200 mGlobalSyncMode = SYNC_MODE_NORMAL;
1205 CalendarLocal* calendar = new CalendarLocal(); 1201 CalendarLocal* calendar = new CalendarLocal();
1206 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 1202 calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
1207 FileStorage* storage = new FileStorage( calendar ); 1203 FileStorage* storage = new FileStorage( calendar );
@@ -1226,12 +1222,9 @@ bool CalendarView::syncCalendar(QString filename, int mode)
1226 if ( syncOK ) 1222 if ( syncOK )
1227 updateView(); 1223 updateView();
1228 return syncOK; 1224 return syncOK;
1229} 1225}
1230void CalendarView::syncPhone() 1226
1231{
1232 //DELETE
1233}
1234void CalendarView::syncExternal( int mode ) 1227void CalendarView::syncExternal( int mode )
1235{ 1228{
1236 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1229 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1237 1230
@@ -1312,14 +1305,8 @@ void CalendarView::syncExternal( int mode )
1312 updateView(); 1305 updateView();
1313 return ;//syncOK; 1306 return ;//syncOK;
1314 1307
1315} 1308}
1316void CalendarView::syncSharp()
1317{
1318 //DELETE
1319
1320}
1321
1322 1309
1323bool CalendarView::importBday() 1310bool CalendarView::importBday()
1324{ 1311{
1325#ifndef KORG_NOKABC 1312#ifndef KORG_NOKABC
@@ -1588,12 +1575,15 @@ bool CalendarView::openCalendar(QString filename, bool merge)
1588 mCalendar->reInitAlarmSettings(); 1575 mCalendar->reInitAlarmSettings();
1589 setSyncEventsReadOnly(); 1576 setSyncEventsReadOnly();
1590 updateUnmanagedViews(); 1577 updateUnmanagedViews();
1591 updateView(); 1578 updateView();
1592 setLoadedFileVersion( QDateTime::currentDateTime().addSecs( -1 ));
1593 if ( filename != MainWindow::defaultFileName() ) { 1579 if ( filename != MainWindow::defaultFileName() ) {
1594 saveCalendar( MainWindow::defaultFileName() ); 1580 saveCalendar( MainWindow::defaultFileName() );
1595 watchSavedFile(); 1581 } else {
1582 QFileInfo finf ( MainWindow::defaultFileName());
1583 if ( finf.exists() ) {
1584 setLoadedFileVersion( finf.lastModified () );
1585 }
1596 } 1586 }
1597 return true; 1587 return true;
1598 } else { 1588 } else {
1599 // while failing to load, the calendar object could 1589 // while failing to load, the calendar object could
@@ -1688,18 +1678,21 @@ bool CalendarView::saveCalendar( QString filename )
1688 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 1678 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
1689 if ( mViewManager->currentView() ) 1679 if ( mViewManager->currentView() )
1690 mViewManager->currentView()->flushView(); 1680 mViewManager->currentView()->flushView();
1691 1681
1692 //mStorage->setFileName( filename );
1693 1682
1683 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
1694 mStorage->setSaveFormat( new ICalFormat() ); 1684 mStorage->setSaveFormat( new ICalFormat() );
1695 mStorage->setFileName( filename ); 1685 mStorage->setFileName( filename );
1696 bool success; 1686 bool success;
1697 success = mStorage->save(); 1687 success = mStorage->save();
1698 if ( !success ) { 1688 if ( !success ) {
1699 return false; 1689 return false;
1700 } 1690 }
1701 1691 if ( filename == MainWindow::defaultFileName() ) {
1692 setLoadedFileVersion( lfv );
1693 watchSavedFile();
1694 }
1702 return true; 1695 return true;
1703} 1696}
1704 1697
1705void CalendarView::closeCalendar() 1698void CalendarView::closeCalendar()
@@ -2181,13 +2174,8 @@ void CalendarView::edit_options()
2181{ 2174{
2182 mDialogManager->showOptionsDialog(); 2175 mDialogManager->showOptionsDialog();
2183 //writeSettings(); 2176 //writeSettings();
2184} 2177}
2185void CalendarView::edit_sync_options()
2186{
2187 // DELETE
2188
2189}
2190 2178
2191void CalendarView::slotSelectPickerDate( QDate d) 2179void CalendarView::slotSelectPickerDate( QDate d)
2192{ 2180{
2193 mDateFrame->hide(); 2181 mDateFrame->hide();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 751b8d9..660cce7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -319,9 +319,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
319 void edit_paste(); 319 void edit_paste();
320 320
321 /** edit viewing and configuration options. */ 321 /** edit viewing and configuration options. */
322 void edit_options(); 322 void edit_options();
323 void edit_sync_options();
324 /** 323 /**
325 Functions for printing, previewing a print, and setting up printing 324 Functions for printing, previewing a print, and setting up printing
326 parameters. 325 parameters.
327 */ 326 */
@@ -435,10 +434,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
435 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 434 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
436 bool importQtopia( const QString &categoriesFile, 435 bool importQtopia( const QString &categoriesFile,
437 const QString &datebookFile, 436 const QString &datebookFile,
438 const QString &tasklistFile ); 437 const QString &tasklistFile );
439 void syncSharp( );
440 void syncPhone( );
441 void syncExternal( int mode ); 438 void syncExternal( int mode );
442 void slotSelectPickerDate( QDate ) ; 439 void slotSelectPickerDate( QDate ) ;
443 void showDatePicker( ) ; 440 void showDatePicker( ) ;
444 void moveIncidence(Incidence *) ; 441 void moveIncidence(Incidence *) ;
@@ -465,9 +462,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
465 int msgCalModified(); 462 int msgCalModified();
466 virtual bool sync(KSyncManager* manager, QString filename, int mode); 463 virtual bool sync(KSyncManager* manager, QString filename, int mode);
467 464
468 virtual bool syncExternal(KSyncManager* manager, QString resource); 465 virtual bool syncExternal(KSyncManager* manager, QString resource);
469 void confSync();
470 void setSyncManager(KSyncManager* manager); 466 void setSyncManager(KSyncManager* manager);
471 void setLoadedFileVersion(QDateTime); 467 void setLoadedFileVersion(QDateTime);
472 bool checkFileVersion(QString fn); 468 bool checkFileVersion(QString fn);
473 bool checkFileChanged(QString fn); 469 bool checkFileChanged(QString fn);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c7ce8cb..2d17986 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1383,13 +1383,11 @@ void MainWindow::save()
1383 1383
1384 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1384 QTime neededSaveTime = QDateTime::currentDateTime().time();
1385 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1385 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1386 qDebug("KO: Start saving data to file!"); 1386 qDebug("KO: Start saving data to file!");
1387 mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
1388 mView->saveCalendar( defaultFileName() ); 1387 mView->saveCalendar( defaultFileName() );
1389 1388
1390 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1389 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1391 mView->watchSavedFile();
1392 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1390 qDebug("KO: Needed %d ms for saving.",msNeeded );
1393 QString savemes; 1391 QString savemes;
1394 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1392 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1395 setCaption(savemes); 1393 setCaption(savemes);
@@ -1820,12 +1818,10 @@ void MainWindow::getFile( bool success )
1820 if ( ! success ) { 1818 if ( ! success ) {
1821 setCaption( i18n("Error receiving file. Nothing changed!") ); 1819 setCaption( i18n("Error receiving file. Nothing changed!") );
1822 return; 1820 return;
1823 } 1821 }
1824 mView->watchSavedFile();
1825 mView->openCalendar( defaultFileName() ); 1822 mView->openCalendar( defaultFileName() );
1826 setCaption( i18n("Pi-Sync successful!") ); 1823 setCaption( i18n("Pi-Sync successful!") );
1827
1828} 1824}
1829 1825
1830void MainWindow::printSel( ) 1826void MainWindow::printSel( )
1831{ 1827{