summaryrefslogtreecommitdiffabout
path: root/korganizer/datenavigatorcontainer.cpp
Unidiff
Diffstat (limited to 'korganizer/datenavigatorcontainer.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 548c364..d1caff3 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -41,24 +41,26 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
41 mHorizontalCount( 1 ), mVerticalCount( 1 ) 41 mHorizontalCount( 1 ), mVerticalCount( 1 )
42{ 42{
43 mExtraViews.setAutoDelete( true ); 43 mExtraViews.setAutoDelete( true );
44 44
45 mNavigatorView = new KDateNavigator( this, name ); 45 mNavigatorView = new KDateNavigator( this, name );
46 46
47 connectNavigatorView( mNavigatorView ); 47 connectNavigatorView( mNavigatorView );
48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
49 mLastDisplayedDN = 0; 49 mLastDisplayedDN = 0;
50 mUpdateTimer; 50 mUpdateTimer;
51 mUpdateTimer = new QTimer( this ); 51 mUpdateTimer = new QTimer( this );
52 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); 52 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
53 mFirstSelectedDate = QDate::currentDate();
54 mSelectedDateCount = 1;
53} 55}
54 56
55DateNavigatorContainer::~DateNavigatorContainer() 57DateNavigatorContainer::~DateNavigatorContainer()
56{ 58{
57} 59}
58 60
59void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) 61void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
60{ 62{
61 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), 63 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ),
62 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 64 SIGNAL( datesSelected( const KCal::DateList & ) ) );
63#if 0 65#if 0
64 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), 66 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ),
@@ -131,33 +133,33 @@ void DateNavigatorContainer::slotMonthSelected( int month )
131} 133}
132void DateNavigatorContainer::setCalendar( Calendar *cal ) 134void DateNavigatorContainer::setCalendar( Calendar *cal )
133{ 135{
134 mCalendar = cal; 136 mCalendar = cal;
135 mNavigatorView->setCalendar( cal ); 137 mNavigatorView->setCalendar( cal );
136 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 138 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
137 KDateNavigator *n = mExtraViews.at( i ); 139 KDateNavigator *n = mExtraViews.at( i );
138 n->setCalendar( cal ); 140 n->setCalendar( cal );
139 } 141 }
140} 142}
141void DateNavigatorContainer::checkUpdateDayMatrixDates() 143void DateNavigatorContainer::checkUpdateDayMatrixDates()
142{ 144{
143 qDebug("wid %d hei %d ", width(), height()); 145 //qDebug("KODNC: wid %d hei %d ", width(), height());
144 mUpdateTimer->stop(); 146 mUpdateTimer->stop();
145 //return; 147 //return;
146 if ( width() < 3 || height() < 3 ) 148 if ( width() < 3 || height() < 3 )
147 return; 149 return;
148 static int lastWid = 0; 150 static int lastWid = 0;
149 static int lastHei = 0; 151 static int lastHei = 0;
150 if ( lastWid == width() && height() == lastHei ) { 152 if ( lastWid == width() && height() == lastHei ) {
151 qDebug("no layout computing needed. "); 153 qDebug("KODNC: No layout computing needed. ");
152 } else { 154 } else {
153 lastWid = width(); 155 lastWid = width();
154 lastHei = height(); 156 lastHei = height();
155 157
156 QSize minSize = mNavigatorView->yourSizeHint(); 158 QSize minSize = mNavigatorView->yourSizeHint();
157 159
158 int verticalCount = size().height() / minSize.height(); 160 int verticalCount = size().height() / minSize.height();
159 int horizontalCount = size().width() / minSize.width(); 161 int horizontalCount = size().width() / minSize.width();
160 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); 162 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
161 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); 163 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
162 bool fontchange = false; 164 bool fontchange = false;
163 if ( horizontalCount == 1) 165 if ( horizontalCount == 1)