author | zautrix <zautrix> | 2004-10-06 20:51:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-06 20:51:01 (UTC) |
commit | 0afcfa29ace7bc5e42a11fae44301e1e8230a376 (patch) (unidiff) | |
tree | b54f85b19ace24219be1b845469444089cacc94f /korganizer | |
parent | ed4675de07d947f55d2672c721599e3a0af1e24b (diff) | |
download | kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.zip kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.gz kdepimpi-0afcfa29ace7bc5e42a11fae44301e1e8230a376.tar.bz2 |
some prefs cleanups
-rw-r--r-- | korganizer/calendarview.cpp | 14 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 1 |
3 files changed, 0 insertions, 17 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 38b55f7..1de2759 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -864,47 +864,33 @@ Event* CalendarView::getLastSyncEvent() | |||
864 | lse = new Event(); | 864 | lse = new Event(); |
865 | lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); | 865 | lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); |
866 | QString sum = ""; | 866 | QString sum = ""; |
867 | if ( KOPrefs::instance()->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) | 867 | if ( KOPrefs::instance()->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) |
868 | sum = "E: "; | 868 | sum = "E: "; |
869 | lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); | 869 | lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); |
870 | lse->setDtStart( mLastCalendarSync ); | 870 | lse->setDtStart( mLastCalendarSync ); |
871 | lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); | 871 | lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); |
872 | lse->setCategories( i18n("SyncEvent") ); | 872 | lse->setCategories( i18n("SyncEvent") ); |
873 | lse->setReadOnly( true ); | 873 | lse->setReadOnly( true ); |
874 | mCalendar->addEvent( lse ); | 874 | mCalendar->addEvent( lse ); |
875 | } | 875 | } |
876 | 876 | ||
877 | return lse; | 877 | return lse; |
878 | 878 | ||
879 | } | 879 | } |
880 | // probaly useless | ||
881 | void CalendarView::setupExternSyncProfiles() | ||
882 | { | ||
883 | Event* lse; | ||
884 | mExternLastSyncEvent.clear(); | ||
885 | int i; | ||
886 | for ( i = 0; i < KOPrefs::instance()->mExternSyncProfiles.count(); ++i ) { | ||
887 | lse = mCalendar->event( "last-syncEvent-"+ KOPrefs::instance()->mExternSyncProfiles[i] ); | ||
888 | if ( lse ) | ||
889 | mExternLastSyncEvent.append( lse ); | ||
890 | else | ||
891 | qDebug("Last Sync event not found for %s ", KOPrefs::instance()->mExternSyncProfiles[i].latin1()); | ||
892 | } | ||
893 | 880 | ||
894 | } | ||
895 | // we check, if the to delete event has a id for a profile | 881 | // we check, if the to delete event has a id for a profile |
896 | // if yes, we set this id in the profile to delete | 882 | // if yes, we set this id in the profile to delete |
897 | void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) | 883 | void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) |
898 | { | 884 | { |
899 | if ( lastSync.count() == 0 ) { | 885 | if ( lastSync.count() == 0 ) { |
900 | //qDebug(" lastSync.count() == 0"); | 886 | //qDebug(" lastSync.count() == 0"); |
901 | return; | 887 | return; |
902 | } | 888 | } |
903 | if ( toDelete->type() == "Journal" ) | 889 | if ( toDelete->type() == "Journal" ) |
904 | return; | 890 | return; |
905 | 891 | ||
906 | Event* eve = lastSync.first(); | 892 | Event* eve = lastSync.first(); |
907 | 893 | ||
908 | while ( eve ) { | 894 | while ( eve ) { |
909 | QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name | 895 | QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name |
910 | if ( !id.isEmpty() ) { | 896 | if ( !id.isEmpty() ) { |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index a713c91..0f7e696 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -100,33 +100,32 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
100 | KODialogManager *dialogManager(); | 100 | KODialogManager *dialogManager(); |
101 | 101 | ||
102 | QDate startDate(); | 102 | QDate startDate(); |
103 | QDate endDate(); | 103 | QDate endDate(); |
104 | 104 | ||
105 | QWidgetStack *viewStack(); | 105 | QWidgetStack *viewStack(); |
106 | QWidget *leftFrame(); | 106 | QWidget *leftFrame(); |
107 | NavigatorBar *navigatorBar(); | 107 | NavigatorBar *navigatorBar(); |
108 | 108 | ||
109 | DateNavigator *dateNavigator(); | 109 | DateNavigator *dateNavigator(); |
110 | KDateNavigator *dateNavigatorWidget(); | 110 | KDateNavigator *dateNavigatorWidget(); |
111 | 111 | ||
112 | void addView(KOrg::BaseView *); | 112 | void addView(KOrg::BaseView *); |
113 | void showView(KOrg::BaseView *); | 113 | void showView(KOrg::BaseView *); |
114 | KOEventViewerDialog* getEventViewerDialog(); | 114 | KOEventViewerDialog* getEventViewerDialog(); |
115 | Incidence *currentSelection(); | 115 | Incidence *currentSelection(); |
116 | void setupExternSyncProfiles(); | ||
117 | 116 | ||
118 | signals: | 117 | signals: |
119 | /** This todo has been modified */ | 118 | /** This todo has been modified */ |
120 | void todoModified(Todo *, int); | 119 | void todoModified(Todo *, int); |
121 | 120 | ||
122 | /** when change is made to options dialog, the topwidget will catch this | 121 | /** when change is made to options dialog, the topwidget will catch this |
123 | * and emit this signal which notifies all widgets which have registered | 122 | * and emit this signal which notifies all widgets which have registered |
124 | * for notification to update their settings. */ | 123 | * for notification to update their settings. */ |
125 | void configChanged(); | 124 | void configChanged(); |
126 | /** emitted when the topwidget is closing down, so that any attached | 125 | /** emitted when the topwidget is closing down, so that any attached |
127 | child windows can also close. */ | 126 | child windows can also close. */ |
128 | void closingDown(); | 127 | void closingDown(); |
129 | /** emitted right before we die */ | 128 | /** emitted right before we die */ |
130 | void closed(QWidget *); | 129 | void closed(QWidget *); |
131 | 130 | ||
132 | /** Emitted when state of modified flag changes */ | 131 | /** Emitted when state of modified flag changes */ |
@@ -531,33 +530,32 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
531 | 530 | ||
532 | DateNavigator *mNavigator; | 531 | DateNavigator *mNavigator; |
533 | 532 | ||
534 | KOViewManager *mViewManager; | 533 | KOViewManager *mViewManager; |
535 | KODialogManager *mDialogManager; | 534 | KODialogManager *mDialogManager; |
536 | 535 | ||
537 | // Calendar filters | 536 | // Calendar filters |
538 | QPtrList<CalFilter> mFilters; | 537 | QPtrList<CalFilter> mFilters; |
539 | 538 | ||
540 | // various housekeeping variables. | 539 | // various housekeeping variables. |
541 | bool mModified; // flag indicating if calendar is modified | 540 | bool mModified; // flag indicating if calendar is modified |
542 | bool mReadOnly; // flag indicating if calendar is read-only | 541 | bool mReadOnly; // flag indicating if calendar is read-only |
543 | QDate mSaveSingleDate; | 542 | QDate mSaveSingleDate; |
544 | 543 | ||
545 | Incidence *mSelectedIncidence; | 544 | Incidence *mSelectedIncidence; |
546 | Incidence *mMoveIncidence; | 545 | Incidence *mMoveIncidence; |
547 | QPtrList<Event> mExternLastSyncEvent; | ||
548 | KOTodoView *mTodoList; | 546 | KOTodoView *mTodoList; |
549 | KOEventEditor * mEventEditor; | 547 | KOEventEditor * mEventEditor; |
550 | KOTodoEditor * mTodoEditor; | 548 | KOTodoEditor * mTodoEditor; |
551 | KOEventViewerDialog * mEventViewerDialog; | 549 | KOEventViewerDialog * mEventViewerDialog; |
552 | void keyPressEvent ( QKeyEvent *e) ; | 550 | void keyPressEvent ( QKeyEvent *e) ; |
553 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; | 551 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; |
554 | }; | 552 | }; |
555 | 553 | ||
556 | 554 | ||
557 | class CalendarViewVisitor : public Incidence::Visitor | 555 | class CalendarViewVisitor : public Incidence::Visitor |
558 | { | 556 | { |
559 | public: | 557 | public: |
560 | CalendarViewVisitor() : mView( 0 ) {} | 558 | CalendarViewVisitor() : mView( 0 ) {} |
561 | 559 | ||
562 | bool act( Incidence *incidence, CalendarView *view ) | 560 | bool act( Incidence *incidence, CalendarView *view ) |
563 | { | 561 | { |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index ec69b11..9104347 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -977,33 +977,32 @@ void MainWindow::fillSyncMenu() | |||
977 | config.sync(); | 977 | config.sync(); |
978 | delete temp; | 978 | delete temp; |
979 | } | 979 | } |
980 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 980 | KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
981 | KOPrefs::instance()->mSyncProfileNames = prof; | 981 | KOPrefs::instance()->mSyncProfileNames = prof; |
982 | int i; | 982 | int i; |
983 | for ( i = 0; i < prof.count(); ++i ) { | 983 | for ( i = 0; i < prof.count(); ++i ) { |
984 | 984 | ||
985 | syncMenu->insertItem( prof[i], 1000+i ); | 985 | syncMenu->insertItem( prof[i], 1000+i ); |
986 | if ( i == 2 ) | 986 | if ( i == 2 ) |
987 | syncMenu->insertSeparator(); | 987 | syncMenu->insertSeparator(); |
988 | } | 988 | } |
989 | QDir app_dir; | 989 | QDir app_dir; |
990 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 990 | if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
991 | syncMenu->setItemEnabled( false , 1000 ); | 991 | syncMenu->setItemEnabled( false , 1000 ); |
992 | } | 992 | } |
993 | mView->setupExternSyncProfiles(); | ||
994 | } | 993 | } |
995 | 994 | ||
996 | int MainWindow::ringSync() | 995 | int MainWindow::ringSync() |
997 | { | 996 | { |
998 | int syncedProfiles = 0; | 997 | int syncedProfiles = 0; |
999 | int i; | 998 | int i; |
1000 | QTime timer; | 999 | QTime timer; |
1001 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 1000 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
1002 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 1001 | QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; |
1003 | KSyncProfile* temp = new KSyncProfile (); | 1002 | KSyncProfile* temp = new KSyncProfile (); |
1004 | KOPrefs::instance()->mAskForPreferences = false; | 1003 | KOPrefs::instance()->mAskForPreferences = false; |
1005 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 1004 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
1006 | mCurrentSyncProfile = i; | 1005 | mCurrentSyncProfile = i; |
1007 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 1006 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
1008 | temp->readConfig(&config); | 1007 | temp->readConfig(&config); |
1009 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { | 1008 | if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { |