-rw-r--r-- | korganizer/koagendaview.cpp | 10 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 7 |
3 files changed, 18 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 0d36946..13d8398 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -1533,6 +1533,16 @@ void KOAgendaView::setStartHour( int h ) mAgenda->setStartHour( h ); } +void KOAgendaView::setInitStartHour() +{ + + if ( KOPrefs::instance()->mCenterOnCurrentTime ) + setStartHour( QTime::currentTime ().hour() ); + else + setStartHour( KOPrefs::instance()->mDayBegins ); + +} + void KOAgendaView::updateTodo( Todo * t, int ) { diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 4a058ce..8b8bac0 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h @@ -177,6 +177,7 @@ class KOAgendaView : public KOEventView { void deleteSelectedDateTime(); void repaintAgenda(); public slots: + void setInitStartHour(); virtual void updateView(); virtual void updateConfig(); virtual void showDates(const QDate &start, const QDate &end); diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index b0f26d1..f8f6c1d 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -94,7 +94,14 @@ void KOViewManager::readSettings(KConfig *config) else if (view == "TimeSpan") showTimeSpanView(); else if (view == "Todo") showTodoView(); else { + config->setGroup( "Views" ); + int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); + mCurrentAgendaView = dateCount; showAgendaView(); + mCurrentAgendaView = dateCount; +#ifdef DESKTOP_VERSION + QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); +#endif } } |