-rw-r--r-- | korganizer/calendarview.cpp | 17 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 |
3 files changed, 16 insertions, 4 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index fecc7e2..687943e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -1525,7 +1525,16 @@ bool CalendarView::openCalendar(QString filename, bool merge) // have become partially populated. Clear it out. - if ( !merge ) mCalendar->close(); + if ( !merge ) { + mCalendar->close(); + mViewManager->setDocumentId( filename ); + mDialogManager->setDocumentId( filename ); + mTodoList->setDocumentId( filename ); + } - KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); + //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); + QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); globalFlagBlockAgenda = 2; + mCalendar->reInitAlarmSettings(); + setSyncEventsReadOnly(); + updateUnmanagedViews(); updateView(); @@ -1534,2 +1543,6 @@ bool CalendarView::openCalendar(QString filename, bool merge) } +void CalendarView::showOpenError() +{ + KMessageBox::error(this,i18n("Couldn't load calendar\n.")); +} void CalendarView::setLoadedFileVersion(QDateTime dt) diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 355bb84..cd54685 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -174,2 +174,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser public slots: + void showOpenError(); void watchSavedFile(); diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 43ee2d7..7b666d1 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -146,3 +146,2 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : mView->readSettings(); - bool oldOpened = false; bool newFile = false; @@ -172,3 +171,2 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : QTime neededSaveTime = QDateTime::currentDateTime().time(); - if ( ! oldOpened ) mView->openCalendar( defaultFileName() ); |