summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp4
-rw-r--r--korganizer/koviewmanager.cpp1
-rw-r--r--libkcal/calendarlocal.cpp1
3 files changed, 2 insertions, 4 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 6646b98..4cff23a 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -587,69 +587,68 @@ void MonthViewCell::finishUpdateCell()
void MonthViewCell::updateCell()
{
if ( !mMonthView->isUpdatePossible() )
return;
startUpdateCell();
//mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
Event *event;
for( event = events.first(); event; event = events.next() ) { // for event
insertEvent(event);
}
// insert due todos
QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
Todo *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
insertTodo( todo );
}
finishUpdateCell();
// if ( isVisible())
//qApp->processEvents();
}
void MonthViewCell::updateConfig()
{
- qDebug("MonthViewCell::updateConfig() ");
setFont( KOPrefs::instance()->mMonthViewFont );
QFontMetrics fm( font() );
mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
mHolidayPalette = mStandardPalette;
mPrimaryPalette = mStandardPalette;
mNonPrimaryPalette = mStandardPalette;
if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
}
- updateCell();
+ //updateCell();
}
void MonthViewCell::enableScrollBars( bool enabled )
{
if ( enabled ) {
mItemList->setVScrollBarMode(QScrollView::Auto);
mItemList->setHScrollBarMode(QScrollView::Auto);
} else {
mItemList->setVScrollBarMode(QScrollView::AlwaysOff);
mItemList->setHScrollBarMode(QScrollView::AlwaysOff);
}
}
Incidence *MonthViewCell::selectedIncidence()
{
int index = mItemList->currentItem();
if ( index < 0 ) return 0;
MonthViewItem *item =
static_cast<MonthViewItem *>( mItemList->item( index ) );
if ( !item ) return 0;
return item->incidence();
@@ -876,48 +875,49 @@ void KOMonthView::updateConfig()
mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
QFontMetrics fontmetric(mDayLabels[0]->font());
mWidthLongDayLabel = 0;
for (int i = 0; i < 7; i++) {
int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
}
bool temp = mShowSatSunComp ;
mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
computeLayout();
updateDayLabels();
//qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
//resizeEvent( 0 );
for (uint i = 0; i < mCells.count(); ++i) {
mCells[i]->updateConfig();
}
#ifdef DESKTOP_VERSION
MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
#endif
+ updateView();
}
void KOMonthView::updateDayLabels()
{
for (int i = 0; i < 7; i++) {
if (mWeekStartsMonday) {
bool show = mShortDayLabels;
if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() )
show = true;
mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
} else {
if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
}
}
}
void KOMonthView::showDates(const QDate &start, const QDate &)
{
// kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index c95917f..db23882 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -98,49 +98,48 @@ void KOViewManager::readSettings(KConfig *config)
}
}
void KOViewManager::showDateView( int view, QDate date)
{
//qDebug("date %d %s", view, date.toString().latin1());
#if 0
mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 );
mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
#endif
if ( view == 3 ) {
mMainView->showDay( date );
} else if (view == 4 ) {
mMainView->dateNavigator()->selectDates( date, 7 );
} else if (view == 5 ) {
mMainView->dateNavigator()->selectDates( date, 14);
} else if (view == 6 ) {
mMainView->dateNavigator()->blockSignals( true );
showMonthView();
- qApp->processEvents();
mMainView->dateNavigator()->selectMonthByDate( date );
mMainView->dateNavigator()->blockSignals( false );
mMainView->dateNavigator()->selectDate( date );
} else if (view == 7 ) {
mMainView->dateNavigator()->selectDate( date );
showJournalView();
} else if (view == 8 ) {
globalFlagBlockAgenda = 1;
if ( mCurrentAgendaView != 3 )
mCurrentAgendaView = -1;
showAgendaView(KOPrefs::instance()->mFullViewMonth);
globalFlagBlockAgenda = 2;
mMainView->dateNavigator()->selectDates( date ,
KOPrefs::instance()->mNextXDays );
mFlagShowNextxDays = true;
mCurrentAgendaView = 3 ;
}
#if 0
dateNavigator()->blockSignals( true );
dateNavigator()->selectDate( d );
dateNavigator()->blockSignals( false );
mViewManager->showDayView();
#endif
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp
index e75154b..0eba6a9 100644
--- a/libkcal/calendarlocal.cpp
+++ b/libkcal/calendarlocal.cpp
@@ -566,49 +566,48 @@ QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted )
return eventList;
}
// kdDebug(5800) << "Sorting events for date\n" << endl;
// now, we have to sort it based on dtStart.time()
QPtrList<Event> eventListSorted;
Event *sortEvent;
for ( event = eventList.first(); event; event = eventList.next() ) {
sortEvent = eventListSorted.first();
int i = 0;
while ( sortEvent && event->dtStart().time()>=sortEvent->dtStart().time() )
{
i++;
sortEvent = eventListSorted.next();
}
eventListSorted.insert( i, event );
}
return eventListSorted;
}
QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end,
bool inclusive )
{
- qDebug("CalendarLocal::rawEvents called ");
Event *event = 0;
QPtrList<Event> eventList;
// Get non-recurring events
for( event = mEventList.first(); event; event = mEventList.next() ) {
if ( event->doesRecur() ) {
QDate rStart = event->dtStart().date();
bool found = false;
if ( inclusive ) {
if ( rStart >= start && rStart <= end ) {
// Start date of event is in range. Now check for end date.
// if duration is negative, event recurs forever, so do not include it.
if ( event->recurrence()->duration() == 0 ) { // End date set
QDate rEnd = event->recurrence()->endDate();
if ( rEnd >= start && rEnd <= end ) { // End date within range
found = true;
}
} else if ( event->recurrence()->duration() > 0 ) { // Duration set
// TODO: Calculate end date from duration. Should be done in Event
// For now exclude all events with a duration.
}
}
} else {