author | zautrix <zautrix> | 2004-10-08 13:31:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-08 13:31:08 (UTC) |
commit | ec5bc1b8c708b55884f1e03861204123de097129 (patch) (side-by-side diff) | |
tree | 0c5c8a341fd69ed9b45a22a42b9445da8b56a5e8 | |
parent | 38e390e51967b34d53e19bd275efd1760572cdfb (diff) | |
download | kdepimpi-ec5bc1b8c708b55884f1e03861204123de097129.zip kdepimpi-ec5bc1b8c708b55884f1e03861204123de097129.tar.gz kdepimpi-ec5bc1b8c708b55884f1e03861204123de097129.tar.bz2 |
cleanup
-rw-r--r-- | korganizer/calendarview.cpp | 36 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 4 |
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() } #endif } -void CalendarView::confSync() -{ - //DELETE -} - //KOPrefs::instance()->mWriteBackFile //KOPrefs::instance()->mWriteBackExistingOnly @@ -1200,8 +1195,9 @@ void CalendarView::setSyncName( QString s ) mCurrentSyncName= s; } bool CalendarView::syncCalendar(QString filename, int mode) { + //qDebug("syncCalendar %s ", filename.latin1()); mGlobalSyncMode = SYNC_MODE_NORMAL; CalendarLocal* calendar = new CalendarLocal(); calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); FileStorage* storage = new FileStorage( calendar ); @@ -1226,12 +1222,9 @@ bool CalendarView::syncCalendar(QString filename, int mode) if ( syncOK ) updateView(); return syncOK; } -void CalendarView::syncPhone() -{ - //DELETE -} + void CalendarView::syncExternal( int mode ) { mGlobalSyncMode = SYNC_MODE_EXTERNAL; @@ -1312,14 +1305,8 @@ void CalendarView::syncExternal( int mode ) updateView(); return ;//syncOK; } -void CalendarView::syncSharp() -{ - //DELETE - -} - bool CalendarView::importBday() { #ifndef KORG_NOKABC @@ -1588,12 +1575,15 @@ bool CalendarView::openCalendar(QString filename, bool merge) mCalendar->reInitAlarmSettings(); setSyncEventsReadOnly(); updateUnmanagedViews(); updateView(); - setLoadedFileVersion( QDateTime::currentDateTime().addSecs( -1 )); if ( filename != MainWindow::defaultFileName() ) { saveCalendar( MainWindow::defaultFileName() ); - watchSavedFile(); + } else { + QFileInfo finf ( MainWindow::defaultFileName()); + if ( finf.exists() ) { + setLoadedFileVersion( finf.lastModified () ); + } } return true; } else { // while failing to load, the calendar object could @@ -1688,18 +1678,21 @@ bool CalendarView::saveCalendar( QString filename ) // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); if ( mViewManager->currentView() ) mViewManager->currentView()->flushView(); - //mStorage->setFileName( filename ); + QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); mStorage->setSaveFormat( new ICalFormat() ); mStorage->setFileName( filename ); bool success; success = mStorage->save(); if ( !success ) { return false; } - + if ( filename == MainWindow::defaultFileName() ) { + setLoadedFileVersion( lfv ); + watchSavedFile(); + } return true; } void CalendarView::closeCalendar() @@ -2181,13 +2174,8 @@ void CalendarView::edit_options() { mDialogManager->showOptionsDialog(); //writeSettings(); } -void CalendarView::edit_sync_options() -{ - // DELETE - -} void CalendarView::slotSelectPickerDate( QDate d) { 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 void edit_paste(); /** edit viewing and configuration options. */ void edit_options(); - void edit_sync_options(); /** Functions for printing, previewing a print, and setting up printing parameters. */ @@ -435,10 +434,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); bool importQtopia( const QString &categoriesFile, const QString &datebookFile, const QString &tasklistFile ); - void syncSharp( ); - void syncPhone( ); void syncExternal( int mode ); void slotSelectPickerDate( QDate ) ; void showDatePicker( ) ; void moveIncidence(Incidence *) ; @@ -465,9 +462,8 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser int msgCalModified(); virtual bool sync(KSyncManager* manager, QString filename, int mode); virtual bool syncExternal(KSyncManager* manager, QString resource); - void confSync(); void setSyncManager(KSyncManager* manager); void setLoadedFileVersion(QDateTime); bool checkFileVersion(QString fn); 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() QTime neededSaveTime = QDateTime::currentDateTime().time(); setCaption(i18n("KO/Pi:Saving Data to File ..." )); qDebug("KO: Start saving data to file!"); - mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1)); mView->saveCalendar( defaultFileName() ); int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); - mView->watchSavedFile(); qDebug("KO: Needed %d ms for saving.",msNeeded ); QString savemes; savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); setCaption(savemes); @@ -1820,12 +1818,10 @@ void MainWindow::getFile( bool success ) if ( ! success ) { setCaption( i18n("Error receiving file. Nothing changed!") ); return; } - mView->watchSavedFile(); mView->openCalendar( defaultFileName() ); setCaption( i18n("Pi-Sync successful!") ); - } void MainWindow::printSel( ) { |