Commit be323998 authored by Sergio Martins's avatar Sergio Martins
Browse files

Fix side-by-side view.

Agendas weren't being created because it wasn't listening to
signals about them being checked or unchecked.

Still not happy about it, somethings weird with the default
sizes for the all day agenda, it appears too big at first.

CCBUG: 326095
parent 8fec0cca
......@@ -214,6 +214,13 @@ void MultiAgendaView::setCalendar( const Akonadi::ETMCalendar::Ptr &cal )
Q_FOREACH ( KCheckableProxyModel *const i, d->mCollectionSelectionModels ) {
i->setSourceModel( cal->entityTreeModel() );
}
disconnect( 0, SIGNAL(selectionChanged(Akonadi::Collection::List,Akonadi::Collection::List)),
this, SLOT(forceRecreateViews()));
connect( collectionSelection(), SIGNAL(selectionChanged(Akonadi::Collection::List,Akonadi::Collection::List)),
SLOT(forceRecreateViews()) );
recreateViews();
}
......@@ -260,7 +267,12 @@ void MultiAgendaView::recreateViews()
QTimer::singleShot( 0, this, SLOT(setupScrollBar()) );
d->mTimeLabelsZone->updateTimeLabelsPosition();
}
void MultiAgendaView::forceRecreateViews()
{
d->mPendingChanges = true;
recreateViews();
}
void MultiAgendaView::Private::deleteViews()
......
......@@ -97,6 +97,7 @@ class EVENTVIEWS_EXPORT MultiAgendaView : public EventView
void zoomView( const int delta, const QPoint &pos, const Qt::Orientation ori );
void slotResizeScrollView();
void recreateViews();
void forceRecreateViews();
private:
class Private;
......
......@@ -508,9 +508,9 @@ void KOViewManager::showAgendaView()
if ( showSideBySide ) {
if ( !mAgendaSideBySideView ) {
mAgendaSideBySideView = new MultiAgendaView( parent );
mAgendaSideBySideView->setCalendar( mMainView->calendar() );
mAgendaSideBySideView->setIdentifier( "DefaultAgendaSideBySideView" );
addView( mAgendaSideBySideView, showBoth );
mAgendaSideBySideView->setCalendar( mMainView->calendar() );
/*
connect( mAgendaSideBySideView,SIGNAL(zoomViewHorizontally(QDate,int)),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment