summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-07 05:09:23 (UTC)
committer zautrix <zautrix>2005-06-07 05:09:23 (UTC)
commit0bbef196163a267722978e34db2ba3daaee76f88 (patch) (side-by-side diff)
treefac0b701aea6348490c5e9585820070b32b35e29
parent790b8c38e1305b2f5ee4485e59a3ecd01e5b6f75 (diff)
downloadkdepimpi-0bbef196163a267722978e34db2ba3daaee76f88.zip
kdepimpi-0bbef196163a267722978e34db2ba3daaee76f88.tar.gz
kdepimpi-0bbef196163a267722978e34db2ba3daaee76f88.tar.bz2
clear view fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp19
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/koagendaview.cpp7
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/kojournalview.cpp4
-rw-r--r--korganizer/kojournalview.h1
-rw-r--r--korganizer/kolistview.cpp4
-rw-r--r--korganizer/kolistview.h1
-rw-r--r--korganizer/komonthview.cpp10
-rw-r--r--korganizer/komonthview.h1
-rw-r--r--korganizer/koviewmanager.cpp13
-rw-r--r--korganizer/koviewmanager.h1
-rw-r--r--korganizer/kowhatsnextview.cpp5
-rw-r--r--korganizer/kowhatsnextview.h1
-rw-r--r--korganizer/mainwindow.cpp1
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
@@ -1145,4 +1145,5 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
Event* eventRSync;
Event* eventLSync;
+ clearAllViews();
QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
@@ -1837,6 +1838,6 @@ bool CalendarView::openCalendar(QString filename, bool merge)
globalFlagBlockAgenda = 1;
+ clearAllViews();
if (!merge) {
- mTodoList->clearList();
mViewManager->setDocumentId( filename );
mCalendar->close();
@@ -1949,5 +1950,6 @@ bool CalendarView::checkFileVersion(QString fn)
syncCalendar( fn, 3 );
Event * e = getLastSyncEvent();
- mCalendar->deleteEvent ( e );
+ if ( e )
+ deleteEvent ( e );
updateView();
return true;
@@ -1982,4 +1984,5 @@ void CalendarView::closeCalendar()
// child windows no longer valid
+ clearAllViews();
emit closingDown();
@@ -2433,4 +2436,15 @@ void CalendarView::updateView(const QDate &start, const QDate &end)
}
+void CalendarView::clearAllViews()
+{
+ mTodoList->clearList();
+ mViewManager->clearAllViews();
+ SearchDialog * sd = mDialogManager->getSearchDialog();
+ if ( sd ) {
+ KOListView* kol = sd->listview();
+ if ( kol )
+ kol->clearList();
+ }
+}
void CalendarView::updateView()
{
@@ -3944,4 +3958,5 @@ void CalendarView::takeOverCalendar()
// TODO: Create Calendar::allIncidences() function and use it here
+ clearAllViews();
QPtrList<Event> events = mCalendar->events();
for(uint i=0; i<events.count(); ++i) {
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 084b6db..4600090 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -332,4 +332,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void updateView(const QDate &start, const QDate &end);
void updateView();
+ void clearAllViews();
/** Full update of visible todo views */
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index fd9bf29..1320a2e 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1332,4 +1332,11 @@ void KOAgendaView::clearView()
mAgenda->clear();
}
+void KOAgendaView::clearList()
+{
+ // kdDebug() << "ClearView" << endl;
+ clearView();
+ mAllDayAgenda->hideUnused();
+ mAgenda->hideUnused();
+}
void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd,
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index c6e6602..cc953fc 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -167,4 +167,5 @@ class KOAgendaView : public KOEventView {
/** Remove all events from view */
void clearView();
+ void clearList();
KOAgenda *agenda() { return mAgenda;}
virtual void printPreview(CalPrinter *calPrinter,
diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp
index 6e6a939..bc16037 100644
--- a/korganizer/kojournalview.cpp
+++ b/korganizer/kojournalview.cpp
@@ -79,4 +79,8 @@ void KOJournalView::flushView()
}
+void KOJournalView::clearList()
+{
+ mEntry->clear();
+}
void KOJournalView::showDates(const QDate &start, const QDate &)
{
diff --git a/korganizer/kojournalview.h b/korganizer/kojournalview.h
index 1c0be82..445f940 100644
--- a/korganizer/kojournalview.h
+++ b/korganizer/kojournalview.h
@@ -44,4 +44,5 @@ class KOJournalView : public KOrg::BaseView
virtual int currentDateCount();
+ void clearList();
virtual QPtrList<Incidence> selectedIncidences();
DateList selectedDates()
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 5f32e79..bc52281 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -364,4 +364,8 @@ void KOListView::updateList()
}
+void KOListView::clearList()
+{
+ clear ();
+}
void KOListView::addCat( )
{
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index dee69f6..f4d6879 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -258,4 +258,5 @@ class KOListView : public KOEventView
void writeSettings(KConfig *config, QString setting = "KOListView Layout");
void updateList();
+ void clearList();
void setStartDate(const QDate &start);
int count();
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 8ee1363..678cab6 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1416,4 +1416,14 @@ void KOMonthView::updateDayLabels()
}
+void KOMonthView::clearList()
+{
+ unsigned int i;
+ for( i = 0; i < mCells.size(); ++i ) {
+ mCells[i]->clear();
+ }
+ for( i = 0; i < mCellsW.size(); ++i ) {
+ mCellsW[i]->clear();
+ }
+}
void KOMonthView::showDates(const QDate &start, const QDate &)
{
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index de5c014..65b5e77 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -257,4 +257,5 @@ class KOMonthView: public KOEventView
bool skipResize;
NavigatorBar* navigatorBar() { return mNavigatorBar ;}
+ void clearList();
public slots:
void nextCell();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index fb4de37..5d9af6d 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -359,4 +359,16 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
}
+void KOViewManager::clearAllViews()
+{
+
+ if ( mTodoView ) mTodoView->clearList();
+ if ( mListView ) mListView->clearList();
+
+ if ( mAgendaView ) mAgendaView->clearList();
+ if ( mMonthView ) mMonthView->clearList();
+ if ( mWhatsNextView ) mWhatsNextView->clearList();
+ if ( mJournalView ) mJournalView->clearList();
+
+}
void KOViewManager::updateView()
{
@@ -833,5 +845,4 @@ void KOViewManager::setDocumentId( const QString &id )
{
if (mTodoView) {
- mTodoView->clearList();
mTodoView->setDocumentId( id );
}
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 8dc03e0..838583b 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -68,4 +68,5 @@ class KOViewManager : public QObject
void updateView( const QDate &start, const QDate &end );
+ void clearAllViews();
void raiseCurrentView( bool fullScreen = false , bool updateView = false);
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 65d8ac3..62d7ede 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -140,4 +140,9 @@ int KOWhatsNextView::currentDateCount()
}
+void KOWhatsNextView::clearList()
+{
+ mTimer->stop();
+ mView->setText(" ");
+}
QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
{
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h
index d6727ac..93574ef 100644
--- a/korganizer/kowhatsnextview.h
+++ b/korganizer/kowhatsnextview.h
@@ -60,4 +60,5 @@ class KOWhatsNextView : public KOrg::BaseView
void setEventViewer(KOEventViewerDialog* v );
virtual QPtrList<Incidence> selectedIncidences();
+ void clearList();
DateList selectedDates()
{DateList q;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 63053a5..d959a7a 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1671,4 +1671,5 @@ void MainWindow::importOL()
{
#ifdef _OL_IMPORT_
+ mView->clearAllViews();
KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
id->exec();