summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-31 09:21:57 (UTC)
committer zautrix <zautrix>2005-01-31 09:21:57 (UTC)
commit1c5f4d993bf5eeb4a21bacf61671a1a08ed1f3cd (patch) (side-by-side diff)
treedd55b89fd37ffb8a880c175c5237f5ca57ca6d4c /korganizer
parent9b13105b4cc0ede4ca2d01a3d998fdb90bf67b58 (diff)
downloadkdepimpi-1c5f4d993bf5eeb4a21bacf61671a1a08ed1f3cd.zip
kdepimpi-1c5f4d993bf5eeb4a21bacf61671a1a08ed1f3cd.tar.gz
kdepimpi-1c5f4d993bf5eeb4a21bacf61671a1a08ed1f3cd.tar.bz2
fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp18
-rw-r--r--korganizer/kotodoviewitem.cpp4
2 files changed, 13 insertions, 9 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 9812321..ca896b5 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -191,57 +191,57 @@ void KODayMatrix::setSelectedDaysFrom(const QDate& start, const QDate& end)
void KODayMatrix::recalculateToday()
{
today = -1;
for (int i=0; i<NUMDAYS; i++) {
events[i] = 0;
days[i] = startdate.addDays(i);
daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] ));
// if today is in the currently displayed month, hilight today
if (days[i].year() == QDate::currentDate().year() &&
days[i].month() == QDate::currentDate().month() &&
days[i].day() == QDate::currentDate().day()) {
today = i;
}
}
// qDebug(QString("Today is visible at %1.").arg(today));
}
void KODayMatrix::updateView()
{
updateView(startdate);
}
void KODayMatrix::repaintViewTimed()
{
- //qDebug("KODayMatrix::repaintViewTimed ");
+ qDebug("KODayMatrix::repaintViewTimed ");
mRepaintTimer->stop();
repaint(false);
}
void KODayMatrix::updateViewTimed()
{
mUpdateTimer->stop();
- //qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii );
+ qDebug("KODayMatrix::updateView(QDate actdate)");
for(int i = 0; i < NUMDAYS; i++) {
// if events are set for the day then remember to draw it bold
QPtrList<Event> eventlist = mCalendar->events(days[i]);
Event *event;
int numEvents = eventlist.count();
for(event=eventlist.first();event != 0;event=eventlist.next()) {
ushort recurType = event->recurrence()->doesRecur();
if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
(recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
numEvents--;
}
}
events[i] = numEvents;
//if it is a holy day then draw it red. Sundays are consider holidays, too
#ifndef KORG_NOPLUGINS
QString holiStr = KOCore::self()->holiday(days[i]);
#else
QString holiStr = QString::null;
#endif
if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) ||
@@ -267,58 +267,58 @@ void KODayMatrix::updateView(QDate actdate)
//flag to indicate if the starting day of the matrix has changed by this call
//mDayChanged = false;
// if a new startdate is to be set then apply Cornelius's calculation
// of the first day to be shown
if (actdate != startdate) {
// reset index of selection according to shift of starting date from startdate to actdate
if (mSelStart != NOSELECTION) {
int tmp = actdate.daysTo(startdate);
//kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl;
// shift selection if new one would be visible at least partly !
if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) {
// nested if is required for next X display pushed from a different month - correction required
// otherwise, for month forward and backward, it must be avoided
if( mSelStart > NUMDAYS || mSelStart < 0 )
mSelStart = mSelStart + tmp;
if( mSelEnd > NUMDAYS || mSelEnd < 0 )
mSelEnd = mSelEnd + tmp;
}
}
startdate = actdate;
mDayChanged = true;
recalculateToday();
}
- //qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
+ qDebug("restart Timer %d vis: %d", mDayChanged, isVisible() );
if ( !isVisible() ) {
mPendingUpdateBeforeRepaint = true;
} else {
#ifdef DESKTOP_VERSION
- mRepaintTimer->start( 250 );
- mUpdateTimer->start( 2000 );
+ //mRepaintTimer->start( 250 );
+ mUpdateTimer->start( 250 );
#else
- mRepaintTimer->start( 350 );
- mUpdateTimer->start( 4000 );
+ mRepaintTimer->start( 350 );
+ mUpdateTimer->start( 2000 );
#endif
}
}
const QDate& KODayMatrix::getDate(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
qDebug("Wrong offset2 ");
return days[0];
}
return days[offset];
}
QString KODayMatrix::getHolidayLabel(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
qDebug("Wrong offset1 ");
return 0;
}
return mHolidays[offset];
}
int KODayMatrix::getDayIndexFrom(int x, int y)
{
@@ -468,50 +468,50 @@ void KODayMatrix::dropEvent(QDropEvent *e)
start.setDate(days[idx]);
end.setDate(days[idx].addDays(duration));
event->setDtStart(start);
event->setDtEnd(end);
mCalendar->addEvent(event);
emit eventDropped(event);
} else {
// kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl;
e->ignore();
}
#endif
}
// ----------------------------------------------------------------------------
// P A I N T E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
void KODayMatrix::paintEvent(QPaintEvent * pevent)
{
//kdDebug() << "KODayMatrix::paintEvent() BEGIN" << endl;
if ( mPendingUpdateBeforeRepaint ) {
- updateViewTimed();
- mPendingUpdateBeforeRepaint = false;
+ updateViewTimed();
+ mPendingUpdateBeforeRepaint = false;
}
QPainter p(this);
QRect sz = frameRect();
int dheight = daysize.height();
int dwidth = daysize.width();
int row,col;
int selw, selh;
bool isRTL = KOGlobals::self()->reverseLayout();
// draw background and topleft frame
p.fillRect(pevent->rect(), mDefaultBackColor);
p.setPen(mDefaultTextColor);
p.drawRect(0, 0, sz.width()+1, sz.height()+1);
// draw selected days with highlighted background color
if (mSelStart != NOSELECTION) {
row = mSelStart/7;
col = mSelStart -row*7;
QColor selcol = KOPrefs::instance()->mHighlightColor;
if (row == mSelEnd/7) {
// Single row selection
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 1edddac..6bdee18 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -187,48 +187,52 @@ void KOTodoViewItem::setMyPixmap()
pixi.resize(size, pixSize+size);
pPix.fill( Qt::red );
p.begin( &pixi );
p. drawPixmap ( 0, pixSize, pPix);
p.end();
pixSize += size;
}
// }
if ( pixi.width() > 1 ) {
setPixmap ( 0,pixi ) ;
} else {
setPixmap ( 0,QPixmap() ) ;
}
}
void KOTodoViewItem::stateChange(bool state)
{
// qDebug("KOTodoViewItem::stateChange ");
// do not change setting on startup
if ( m_init ) return;
if (isOn()!=state) {
setOn(state);
//qDebug("SETON ");
return;
}
+ if ( mTodo->isCompleted() == state ) {
+ //qDebug("STATECHANGE:nothing to do ");
+ return;
+ }
QString keyd = "==";
QString keyt = "==";
//qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1());
mTodo->setCompleted(state);
if (state) mTodo->setCompleted(QDateTime::currentDateTime());
if (mTodo->hasDueDate()) {
setText(3, mTodo->dtDueDateStr());
QDate d = mTodo->dtDue().date();
keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
setSortKey(3,keyd);
if (mTodo->doesFloat()) {
setText(4,"");
}
else {
setText(4,mTodo->dtDueTimeStr());
QTime t = mTodo->dtDue().time();
keyt.sprintf("%02d%02d",t.hour(),t.minute());
setSortKey(4,keyt);
}
}
if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt);
else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);