summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore 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
@@ -1143,8 +1143,9 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
int take;
Event* eventL;
Event* eventRSync;
Event* eventLSync;
+ clearAllViews();
QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
bool fullDateRange = false;
local->resetTempSyncStat();
@@ -1835,10 +1836,10 @@ bool CalendarView::openCalendar(QString filename, bool merge)
return false;
}
globalFlagBlockAgenda = 1;
+ clearAllViews();
if (!merge) {
- mTodoList->clearList();
mViewManager->setDocumentId( filename );
mCalendar->close();
}
mStorage->setFileName( filename );
@@ -1947,9 +1948,10 @@ bool CalendarView::checkFileVersion(QString fn)
mSyncManager->mWriteBackExistingOnly = false;
mSyncManager->mShowSyncSummary = false;
syncCalendar( fn, 3 );
Event * e = getLastSyncEvent();
- mCalendar->deleteEvent ( e );
+ if ( e )
+ deleteEvent ( e );
updateView();
return true;
}
@@ -1980,8 +1982,9 @@ bool CalendarView::saveCalendar( QString filename )
void CalendarView::closeCalendar()
{
// child windows no longer valid
+ clearAllViews();
emit closingDown();
mCalendar->close();
setModified(false);
@@ -2431,8 +2434,19 @@ void CalendarView::updateView(const QDate &start, const QDate &end)
mViewManager->updateView(start, end);
//mDateNavigator->updateView();
}
+void CalendarView::clearAllViews()
+{
+ mTodoList->clearList();
+ mViewManager->clearAllViews();
+ SearchDialog * sd = mDialogManager->getSearchDialog();
+ if ( sd ) {
+ KOListView* kol = sd->listview();
+ if ( kol )
+ kol->clearList();
+ }
+}
void CalendarView::updateView()
{
DateList tmpList = mNavigator->selectedDates();
@@ -3942,8 +3956,9 @@ void CalendarView::takeOverEvent()
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) {
events.at(i)->setOrganizer(KOPrefs::instance()->email());
events.at(i)->recreate();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 084b6db..4600090 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -330,8 +330,9 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void todoDeleted();
void updateView(const QDate &start, const QDate &end);
void updateView();
+ void clearAllViews();
/** Full update of visible todo views */
void updateTodoViews();
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index fd9bf29..1320a2e 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1330,8 +1330,15 @@ void KOAgendaView::clearView()
// kdDebug() << "ClearView" << endl;
mAllDayAgenda->clear();
mAgenda->clear();
}
+void KOAgendaView::clearList()
+{
+ // kdDebug() << "ClearView" << endl;
+ clearView();
+ mAllDayAgenda->hideUnused();
+ mAgenda->hideUnused();
+}
void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd,
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
@@ -165,8 +165,9 @@ class KOAgendaView : public KOEventView {
virtual DateList selectedDates();
/** Remove all events from view */
void clearView();
+ void clearList();
KOAgenda *agenda() { return mAgenda;}
virtual void printPreview(CalPrinter *calPrinter,
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
@@ -77,8 +77,12 @@ void KOJournalView::flushView()
{
mEntry->flushEntry();
}
+void KOJournalView::clearList()
+{
+ mEntry->clear();
+}
void KOJournalView::showDates(const QDate &start, const QDate &)
{
// 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
@@ -42,8 +42,9 @@ class KOJournalView : public KOrg::BaseView
const char *name = 0);
~KOJournalView();
virtual int currentDateCount();
+ void clearList();
virtual QPtrList<Incidence> selectedIncidences();
DateList selectedDates()
{DateList q;
return q;};
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 5f32e79..bc52281 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -362,8 +362,12 @@ void KOListView::updateList()
// qDebug(" KOListView::updateList() ");
}
+void KOListView::clearList()
+{
+ clear ();
+}
void KOListView::addCat( )
{
setCategories( false );
}
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index dee69f6..f4d6879 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -256,8 +256,9 @@ class KOListView : public KOEventView
void readSettings(KConfig *config, QString setting = "KOListView Layout");
void writeSettings(KConfig *config, QString setting = "KOListView Layout");
void updateList();
+ void clearList();
void setStartDate(const QDate &start);
int count();
QString getWhatsThisText(QPoint p);
signals:
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 8ee1363..678cab6 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1414,8 +1414,18 @@ 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 &)
{
// 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
@@ -255,8 +255,9 @@ class KOMonthView: public KOEventView
MonthViewCell * selectedCell();
bool skipResize;
NavigatorBar* navigatorBar() { return mNavigatorBar ;}
+ void clearList();
public slots:
void nextCell();
void prevCell();
virtual void updateView();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index fb4de37..5d9af6d 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -357,8 +357,20 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
//qDebug("raiseCurrentView ende ");
}
+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()
{
// qDebug("KOViewManager::updateView() ");
// if we are updating mTodoView, we get endless recursion
@@ -831,8 +843,7 @@ void KOViewManager::addView(KOrg::BaseView *view)
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
@@ -66,8 +66,9 @@ class KOViewManager : public QObject
void setDocumentId( const QString & );
void updateView( const QDate &start, const QDate &end );
+ void clearAllViews();
void raiseCurrentView( bool fullScreen = false , bool updateView = false);
void addView(KOrg::BaseView *);
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 65d8ac3..62d7ede 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -138,8 +138,13 @@ int KOWhatsNextView::currentDateCount()
{
return 0;
}
+void KOWhatsNextView::clearList()
+{
+ mTimer->stop();
+ mView->setText(" ");
+}
QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
{
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
@@ -58,8 +58,9 @@ class KOWhatsNextView : public KOrg::BaseView
virtual int maxDatesHint();
virtual int currentDateCount();
void setEventViewer(KOEventViewerDialog* v );
virtual QPtrList<Incidence> selectedIncidences();
+ void clearList();
DateList selectedDates()
{DateList q;
return q;}
virtual void printPreview(CalPrinter *calPrinter,
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 63053a5..d959a7a 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1669,8 +1669,9 @@ void MainWindow::enableIncidenceActions( bool enabled )
void MainWindow::importOL()
{
#ifdef _OL_IMPORT_
+ mView->clearAllViews();
KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
id->exec();
delete id;
mView->updateView();