summaryrefslogtreecommitdiffstats
path: root/korganizer/timelabels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'korganizer/timelabels.cpp')
-rw-r--r--korganizer/timelabels.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/korganizer/timelabels.cpp b/korganizer/timelabels.cpp
index 0c4956bd..81b53c1f 100644
--- a/korganizer/timelabels.cpp
+++ b/korganizer/timelabels.cpp
@@ -47,6 +47,7 @@ TimeLabels::TimeLabels(int rows,TQWidget *parent,const char *name,WFlags f) :
{
mRows = rows;
mMiniWidth = 0;
+ mAgenda = 0;
mCellHeight = KOPrefs::instance()->mHourSize*4;
@@ -204,16 +205,19 @@ void TimeLabels::updateConfig()
// If the agenda is zoomed out so that more then 24 would be shown,
// the agenda only shows 24 hours, so we need to take the cell height
// from the agenda, which is larger than the configured one!
- if ( mCellHeight < 4*mAgenda->gridSpacingY() )
+ if ( mAgenda && mCellHeight < 4*mAgenda->gridSpacingY() ) {
mCellHeight = 4*mAgenda->gridSpacingY();
+ }
resizeContents( mMiniWidth, int(mRows * mCellHeight+1) );
}
/** update time label positions */
void TimeLabels::positionChanged()
{
- int adjustment = mAgenda->contentsY();
- setContentsPos(0, adjustment);
+ if ( mAgenda ) {
+ int adjustment = mAgenda->contentsY();
+ setContentsPos( 0, adjustment );
+ }
}
void TimeLabels::positionChanged( int pos )
@@ -222,7 +226,7 @@ void TimeLabels::positionChanged( int pos )
}
/** */
-void TimeLabels::setAgenda(KOAgenda* agenda)
+void TimeLabels::setAgenda( KOAgenda* agenda )
{
mAgenda = agenda;