author | zautrix <zautrix> | 2004-10-08 13:31:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-08 13:31:08 (UTC) |
commit | ec5bc1b8c708b55884f1e03861204123de097129 (patch) (unidiff) | |
tree | 0c5c8a341fd69ed9b45a22a42b9445da8b56a5e8 /korganizer/calendarview.cpp | |
parent | 38e390e51967b34d53e19bd275efd1760572cdfb (diff) | |
download | kdepimpi-ec5bc1b8c708b55884f1e03861204123de097129.zip kdepimpi-ec5bc1b8c708b55884f1e03861204123de097129.tar.gz kdepimpi-ec5bc1b8c708b55884f1e03861204123de097129.tar.bz2 |
cleanup
-rw-r--r-- | korganizer/calendarview.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 04051a2..0c35bb3 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -695,17 +695,12 @@ void CalendarView::createPrinter() | |||
695 | mCalPrinter = new CalPrinter(this, mCalendar); | 695 | mCalPrinter = new CalPrinter(this, mCalendar); |
696 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); | 696 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); |
697 | } | 697 | } |
698 | #endif | 698 | #endif |
699 | } | 699 | } |
700 | 700 | ||
701 | void 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 | ||
710 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 705 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
711 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 706 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
@@ -1198,12 +1193,13 @@ void CalendarView::setSyncDevice( QString s ) | |||
1198 | void CalendarView::setSyncName( QString s ) | 1193 | void CalendarView::setSyncName( QString s ) |
1199 | { | 1194 | { |
1200 | mCurrentSyncName= s; | 1195 | mCurrentSyncName= s; |
1201 | } | 1196 | } |
1202 | bool CalendarView::syncCalendar(QString filename, int mode) | 1197 | bool 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 ); |
1208 | bool syncOK = false; | 1204 | bool syncOK = false; |
1209 | storage->setFileName( filename ); | 1205 | storage->setFileName( filename ); |
@@ -1224,16 +1220,13 @@ bool CalendarView::syncCalendar(QString filename, int mode) | |||
1224 | delete storage; | 1220 | delete storage; |
1225 | delete calendar; | 1221 | delete calendar; |
1226 | if ( syncOK ) | 1222 | if ( syncOK ) |
1227 | updateView(); | 1223 | updateView(); |
1228 | return syncOK; | 1224 | return syncOK; |
1229 | } | 1225 | } |
1230 | void CalendarView::syncPhone() | 1226 | |
1231 | { | ||
1232 | //DELETE | ||
1233 | } | ||
1234 | void CalendarView::syncExternal( int mode ) | 1227 | void CalendarView::syncExternal( int mode ) |
1235 | { | 1228 | { |
1236 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 1229 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1237 | 1230 | ||
1238 | qApp->processEvents(); | 1231 | qApp->processEvents(); |
1239 | CalendarLocal* calendar = new CalendarLocal(); | 1232 | CalendarLocal* calendar = new CalendarLocal(); |
@@ -1310,18 +1303,12 @@ void CalendarView::syncExternal( int mode ) | |||
1310 | } | 1303 | } |
1311 | delete calendar; | 1304 | delete calendar; |
1312 | updateView(); | 1305 | updateView(); |
1313 | return ;//syncOK; | 1306 | return ;//syncOK; |
1314 | 1307 | ||
1315 | } | 1308 | } |
1316 | void CalendarView::syncSharp() | ||
1317 | { | ||
1318 | //DELETE | ||
1319 | |||
1320 | } | ||
1321 | |||
1322 | 1309 | ||
1323 | bool CalendarView::importBday() | 1310 | bool CalendarView::importBday() |
1324 | { | 1311 | { |
1325 | #ifndef KORG_NOKABC | 1312 | #ifndef KORG_NOKABC |
1326 | 1313 | ||
1327 | #ifdef DESKTOP_VERSION | 1314 | #ifdef DESKTOP_VERSION |
@@ -1586,16 +1573,19 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1586 | // if ( getLastSyncEvent() ) | 1573 | // if ( getLastSyncEvent() ) |
1587 | // getLastSyncEvent()->setReadOnly( true ); | 1574 | // getLastSyncEvent()->setReadOnly( true ); |
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 |
1600 | // have become partially populated. Clear it out. | 1590 | // have become partially populated. Clear it out. |
1601 | if ( !merge ) { | 1591 | if ( !merge ) { |
@@ -1686,22 +1676,25 @@ bool CalendarView::saveCalendar( QString filename ) | |||
1686 | 1676 | ||
1687 | // Store back all unsaved data into calendar object | 1677 | // Store back all unsaved data into calendar object |
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 ); | 1682 | |
1693 | 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 | ||
1705 | void CalendarView::closeCalendar() | 1698 | void CalendarView::closeCalendar() |
1706 | { | 1699 | { |
1707 | 1700 | ||
@@ -2179,17 +2172,12 @@ void CalendarView::edit_paste() | |||
2179 | 2172 | ||
2180 | void CalendarView::edit_options() | 2173 | void CalendarView::edit_options() |
2181 | { | 2174 | { |
2182 | mDialogManager->showOptionsDialog(); | 2175 | mDialogManager->showOptionsDialog(); |
2183 | //writeSettings(); | 2176 | //writeSettings(); |
2184 | } | 2177 | } |
2185 | void CalendarView::edit_sync_options() | ||
2186 | { | ||
2187 | // DELETE | ||
2188 | |||
2189 | } | ||
2190 | 2178 | ||
2191 | void CalendarView::slotSelectPickerDate( QDate d) | 2179 | void CalendarView::slotSelectPickerDate( QDate d) |
2192 | { | 2180 | { |
2193 | mDateFrame->hide(); | 2181 | mDateFrame->hide(); |
2194 | if ( mDatePickerMode == 1 ) { | 2182 | if ( mDatePickerMode == 1 ) { |
2195 | mNavigator->slotDaySelect( d ); | 2183 | mNavigator->slotDaySelect( d ); |