-rw-r--r-- | korganizer/calendarview.cpp | 19 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 7 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 1 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 4 | ||||
-rw-r--r-- | korganizer/kojournalview.h | 1 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 4 | ||||
-rw-r--r-- | korganizer/kolistview.h | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 10 | ||||
-rw-r--r-- | korganizer/komonthview.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 13 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 1 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 5 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 1 |
15 files changed, 67 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 608b73b..e13d0be 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1144,6 +1144,7 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1144 | Event* eventL; | 1144 | Event* eventL; |
1145 | Event* eventRSync; | 1145 | Event* eventRSync; |
1146 | Event* eventLSync; | 1146 | Event* eventLSync; |
1147 | clearAllViews(); | ||
1147 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); | 1148 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); |
1148 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); | 1149 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); |
1149 | bool fullDateRange = false; | 1150 | bool fullDateRange = false; |
@@ -1836,8 +1837,8 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1836 | } | 1837 | } |
1837 | 1838 | ||
1838 | globalFlagBlockAgenda = 1; | 1839 | globalFlagBlockAgenda = 1; |
1840 | clearAllViews(); | ||
1839 | if (!merge) { | 1841 | if (!merge) { |
1840 | mTodoList->clearList(); | ||
1841 | mViewManager->setDocumentId( filename ); | 1842 | mViewManager->setDocumentId( filename ); |
1842 | mCalendar->close(); | 1843 | mCalendar->close(); |
1843 | } | 1844 | } |
@@ -1948,7 +1949,8 @@ bool CalendarView::checkFileVersion(QString fn) | |||
1948 | mSyncManager->mShowSyncSummary = false; | 1949 | mSyncManager->mShowSyncSummary = false; |
1949 | syncCalendar( fn, 3 ); | 1950 | syncCalendar( fn, 3 ); |
1950 | Event * e = getLastSyncEvent(); | 1951 | Event * e = getLastSyncEvent(); |
1951 | mCalendar->deleteEvent ( e ); | 1952 | if ( e ) |
1953 | deleteEvent ( e ); | ||
1952 | updateView(); | 1954 | updateView(); |
1953 | return true; | 1955 | return true; |
1954 | } | 1956 | } |
@@ -1981,6 +1983,7 @@ void CalendarView::closeCalendar() | |||
1981 | { | 1983 | { |
1982 | 1984 | ||
1983 | // child windows no longer valid | 1985 | // child windows no longer valid |
1986 | clearAllViews(); | ||
1984 | emit closingDown(); | 1987 | emit closingDown(); |
1985 | 1988 | ||
1986 | mCalendar->close(); | 1989 | mCalendar->close(); |
@@ -2432,6 +2435,17 @@ void CalendarView::updateView(const QDate &start, const QDate &end) | |||
2432 | //mDateNavigator->updateView(); | 2435 | //mDateNavigator->updateView(); |
2433 | } | 2436 | } |
2434 | 2437 | ||
2438 | void CalendarView::clearAllViews() | ||
2439 | { | ||
2440 | mTodoList->clearList(); | ||
2441 | mViewManager->clearAllViews(); | ||
2442 | SearchDialog * sd = mDialogManager->getSearchDialog(); | ||
2443 | if ( sd ) { | ||
2444 | KOListView* kol = sd->listview(); | ||
2445 | if ( kol ) | ||
2446 | kol->clearList(); | ||
2447 | } | ||
2448 | } | ||
2435 | void CalendarView::updateView() | 2449 | void CalendarView::updateView() |
2436 | { | 2450 | { |
2437 | DateList tmpList = mNavigator->selectedDates(); | 2451 | DateList tmpList = mNavigator->selectedDates(); |
@@ -3943,6 +3957,7 @@ void CalendarView::takeOverCalendar() | |||
3943 | { | 3957 | { |
3944 | // TODO: Create Calendar::allIncidences() function and use it here | 3958 | // TODO: Create Calendar::allIncidences() function and use it here |
3945 | 3959 | ||
3960 | clearAllViews(); | ||
3946 | QPtrList<Event> events = mCalendar->events(); | 3961 | QPtrList<Event> events = mCalendar->events(); |
3947 | for(uint i=0; i<events.count(); ++i) { | 3962 | for(uint i=0; i<events.count(); ++i) { |
3948 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3963 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 084b6db..4600090 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -331,6 +331,7 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
331 | 331 | ||
332 | void updateView(const QDate &start, const QDate &end); | 332 | void updateView(const QDate &start, const QDate &end); |
333 | void updateView(); | 333 | void updateView(); |
334 | void clearAllViews(); | ||
334 | 335 | ||
335 | /** Full update of visible todo views */ | 336 | /** Full update of visible todo views */ |
336 | void updateTodoViews(); | 337 | void updateTodoViews(); |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index fd9bf29..1320a2e 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -1331,6 +1331,13 @@ void KOAgendaView::clearView() | |||
1331 | mAllDayAgenda->clear(); | 1331 | mAllDayAgenda->clear(); |
1332 | mAgenda->clear(); | 1332 | mAgenda->clear(); |
1333 | } | 1333 | } |
1334 | void KOAgendaView::clearList() | ||
1335 | { | ||
1336 | // kdDebug() << "ClearView" << endl; | ||
1337 | clearView(); | ||
1338 | mAllDayAgenda->hideUnused(); | ||
1339 | mAgenda->hideUnused(); | ||
1340 | } | ||
1334 | 1341 | ||
1335 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 1342 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
1336 | const QDate &td) | 1343 | const QDate &td) |
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index c6e6602..cc953fc 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -166,6 +166,7 @@ class KOAgendaView : public KOEventView { | |||
166 | 166 | ||
167 | /** Remove all events from view */ | 167 | /** Remove all events from view */ |
168 | void clearView(); | 168 | void clearView(); |
169 | void clearList(); | ||
169 | KOAgenda *agenda() { return mAgenda;} | 170 | KOAgenda *agenda() { return mAgenda;} |
170 | virtual void printPreview(CalPrinter *calPrinter, | 171 | virtual void printPreview(CalPrinter *calPrinter, |
171 | const QDate &, const QDate &); | 172 | const QDate &, const QDate &); |
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index 6e6a939..bc16037 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp | |||
@@ -78,6 +78,10 @@ void KOJournalView::flushView() | |||
78 | mEntry->flushEntry(); | 78 | mEntry->flushEntry(); |
79 | } | 79 | } |
80 | 80 | ||
81 | void KOJournalView::clearList() | ||
82 | { | ||
83 | mEntry->clear(); | ||
84 | } | ||
81 | void KOJournalView::showDates(const QDate &start, const QDate &) | 85 | void KOJournalView::showDates(const QDate &start, const QDate &) |
82 | { | 86 | { |
83 | // kdDebug() << "KOJournalView::selectDates()" << endl; | 87 | // kdDebug() << "KOJournalView::selectDates()" << endl; |
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h index 1c0be82..445f940 100644 --- a/korganizer/kojournalview.h +++ b/korganizer/kojournalview.h | |||
@@ -43,6 +43,7 @@ class KOJournalView : public KOrg::BaseView | |||
43 | ~KOJournalView(); | 43 | ~KOJournalView(); |
44 | 44 | ||
45 | virtual int currentDateCount(); | 45 | virtual int currentDateCount(); |
46 | void clearList(); | ||
46 | virtual QPtrList<Incidence> selectedIncidences(); | 47 | virtual QPtrList<Incidence> selectedIncidences(); |
47 | DateList selectedDates() | 48 | DateList selectedDates() |
48 | {DateList q; | 49 | {DateList q; |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 5f32e79..bc52281 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -363,6 +363,10 @@ void KOListView::updateList() | |||
363 | 363 | ||
364 | } | 364 | } |
365 | 365 | ||
366 | void KOListView::clearList() | ||
367 | { | ||
368 | clear (); | ||
369 | } | ||
366 | void KOListView::addCat( ) | 370 | void KOListView::addCat( ) |
367 | { | 371 | { |
368 | setCategories( false ); | 372 | setCategories( false ); |
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index dee69f6..f4d6879 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h | |||
@@ -257,6 +257,7 @@ class KOListView : public KOEventView | |||
257 | void readSettings(KConfig *config, QString setting = "KOListView Layout"); | 257 | void readSettings(KConfig *config, QString setting = "KOListView Layout"); |
258 | void writeSettings(KConfig *config, QString setting = "KOListView Layout"); | 258 | void writeSettings(KConfig *config, QString setting = "KOListView Layout"); |
259 | void updateList(); | 259 | void updateList(); |
260 | void clearList(); | ||
260 | void setStartDate(const QDate &start); | 261 | void setStartDate(const QDate &start); |
261 | int count(); | 262 | int count(); |
262 | QString getWhatsThisText(QPoint p); | 263 | QString getWhatsThisText(QPoint p); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 8ee1363..678cab6 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -1415,6 +1415,16 @@ void KOMonthView::updateDayLabels() | |||
1415 | 1415 | ||
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | void KOMonthView::clearList() | ||
1419 | { | ||
1420 | unsigned int i; | ||
1421 | for( i = 0; i < mCells.size(); ++i ) { | ||
1422 | mCells[i]->clear(); | ||
1423 | } | ||
1424 | for( i = 0; i < mCellsW.size(); ++i ) { | ||
1425 | mCellsW[i]->clear(); | ||
1426 | } | ||
1427 | } | ||
1418 | void KOMonthView::showDates(const QDate &start, const QDate &) | 1428 | void KOMonthView::showDates(const QDate &start, const QDate &) |
1419 | { | 1429 | { |
1420 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; | 1430 | // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index de5c014..65b5e77 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -256,6 +256,7 @@ class KOMonthView: public KOEventView | |||
256 | MonthViewCell * selectedCell(); | 256 | MonthViewCell * selectedCell(); |
257 | bool skipResize; | 257 | bool skipResize; |
258 | NavigatorBar* navigatorBar() { return mNavigatorBar ;} | 258 | NavigatorBar* navigatorBar() { return mNavigatorBar ;} |
259 | void clearList(); | ||
259 | public slots: | 260 | public slots: |
260 | void nextCell(); | 261 | void nextCell(); |
261 | void prevCell(); | 262 | void prevCell(); |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index fb4de37..5d9af6d 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -358,6 +358,18 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | |||
358 | 358 | ||
359 | } | 359 | } |
360 | 360 | ||
361 | void KOViewManager::clearAllViews() | ||
362 | { | ||
363 | |||
364 | if ( mTodoView ) mTodoView->clearList(); | ||
365 | if ( mListView ) mListView->clearList(); | ||
366 | |||
367 | if ( mAgendaView ) mAgendaView->clearList(); | ||
368 | if ( mMonthView ) mMonthView->clearList(); | ||
369 | if ( mWhatsNextView ) mWhatsNextView->clearList(); | ||
370 | if ( mJournalView ) mJournalView->clearList(); | ||
371 | |||
372 | } | ||
361 | void KOViewManager::updateView() | 373 | void KOViewManager::updateView() |
362 | { | 374 | { |
363 | // qDebug("KOViewManager::updateView() "); | 375 | // qDebug("KOViewManager::updateView() "); |
@@ -832,7 +844,6 @@ void KOViewManager::addView(KOrg::BaseView *view) | |||
832 | void KOViewManager::setDocumentId( const QString &id ) | 844 | void KOViewManager::setDocumentId( const QString &id ) |
833 | { | 845 | { |
834 | if (mTodoView) { | 846 | if (mTodoView) { |
835 | mTodoView->clearList(); | ||
836 | mTodoView->setDocumentId( id ); | 847 | mTodoView->setDocumentId( id ); |
837 | } | 848 | } |
838 | } | 849 | } |
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index 8dc03e0..838583b 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h | |||
@@ -67,6 +67,7 @@ class KOViewManager : public QObject | |||
67 | void setDocumentId( const QString & ); | 67 | void setDocumentId( const QString & ); |
68 | 68 | ||
69 | void updateView( const QDate &start, const QDate &end ); | 69 | void updateView( const QDate &start, const QDate &end ); |
70 | void clearAllViews(); | ||
70 | 71 | ||
71 | void raiseCurrentView( bool fullScreen = false , bool updateView = false); | 72 | void raiseCurrentView( bool fullScreen = false , bool updateView = false); |
72 | 73 | ||
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 65d8ac3..62d7ede 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -139,6 +139,11 @@ int KOWhatsNextView::currentDateCount() | |||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | void KOWhatsNextView::clearList() | ||
143 | { | ||
144 | mTimer->stop(); | ||
145 | mView->setText(" "); | ||
146 | } | ||
142 | QPtrList<Incidence> KOWhatsNextView::selectedIncidences() | 147 | QPtrList<Incidence> KOWhatsNextView::selectedIncidences() |
143 | { | 148 | { |
144 | QPtrList<Incidence> eventList; | 149 | QPtrList<Incidence> eventList; |
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h index d6727ac..93574ef 100644 --- a/korganizer/kowhatsnextview.h +++ b/korganizer/kowhatsnextview.h | |||
@@ -59,6 +59,7 @@ class KOWhatsNextView : public KOrg::BaseView | |||
59 | virtual int currentDateCount(); | 59 | virtual int currentDateCount(); |
60 | void setEventViewer(KOEventViewerDialog* v ); | 60 | void setEventViewer(KOEventViewerDialog* v ); |
61 | virtual QPtrList<Incidence> selectedIncidences(); | 61 | virtual QPtrList<Incidence> selectedIncidences(); |
62 | void clearList(); | ||
62 | DateList selectedDates() | 63 | DateList selectedDates() |
63 | {DateList q; | 64 | {DateList q; |
64 | return q;} | 65 | return q;} |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 63053a5..d959a7a 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1670,6 +1670,7 @@ void MainWindow::enableIncidenceActions( bool enabled ) | |||
1670 | void MainWindow::importOL() | 1670 | void MainWindow::importOL() |
1671 | { | 1671 | { |
1672 | #ifdef _OL_IMPORT_ | 1672 | #ifdef _OL_IMPORT_ |
1673 | mView->clearAllViews(); | ||
1673 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1674 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1674 | id->exec(); | 1675 | id->exec(); |
1675 | delete id; | 1676 | delete id; |