summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp169
1 files changed, 90 insertions, 79 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 1d4d6de..fe59787 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -26,18 +26,29 @@
#ifndef _WIN32_
#define protected public
#include <qwidget.h>
#undef protected
#endif
-#include <qintdict.h>
+#include <q3intdict.h>
#include <qdatetime.h>
#include <qapplication.h>
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
#include <qcursor.h>
#include <qpainter.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QLabel>
+#include <QPixmap>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <Q3MemArray>
+#include <QEvent>
+#include <Q3Frame>
+#include <Q3PtrList>
#include <kdebug.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kglobal.h>
@@ -60,13 +71,13 @@ extern int globalFlagBlockAgendaItemPaint;
extern int globalFlagBlockAgendaItemUpdate;
extern int globalFlagBlockStartup;
////////////////////////////////////////////////////////////////////////////
MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name)
- : QFrame(_agenda->viewport(),name), agenda(_agenda)
+ : Q3Frame(_agenda->viewport(),name), agenda(_agenda)
{
setLineWidth(0);
setMargin(0);
setBackgroundColor(Qt::red);
minutes = new QTimer(this);
connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc()));
@@ -166,14 +177,14 @@ void MarcusBains::updateLocation(bool recalculate)
/*
Create an agenda widget with rows rows and columns columns.
*/
KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
- const char *name,WFlags f) :
- QScrollView(parent,name,f)
+ const char *name,Qt::WFlags f) :
+ Q3ScrollView(parent,name,f)
{
mAllAgendaPopup = 0;
mColumns = columns;
mRows = rows;
mGridSpacingY = rowSize;
@@ -187,14 +198,14 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
}
/*
Create an agenda widget with columns columns and one row. This is used for
all-day events.
*/
-KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) :
- QScrollView(parent,name,f)
+KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,Qt::WFlags f) :
+ Q3ScrollView(parent,name,f)
{
mAllAgendaPopup = 0;
blockResize = false;
mColumns = columns;
mRows = 1;
//qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize);
@@ -228,45 +239,45 @@ QDate KOAgenda::selectedIncidenceDate() const
void KOAgenda::init()
{
mPopupTimer = new QTimer(this);
connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
- mNewItemPopup = new QPopupMenu( this );
+ mNewItemPopup = new Q3PopupMenu( this );
connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
QString pathString = "";
if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
if ( QApplication::desktop()->width() < 480 )
pathString += "icons16/";
} else
pathString += "iconsmini/";
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
mNewItemPopup->insertSeparator ( );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 );
- mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"day" ), i18n("Day view"),3 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next week"),4 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"month" ), i18n("This month"),6 );
+ mNewItemPopup->insertItem ( (QIcon)SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
#ifndef _WIN32_
- int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase
- viewport()->setWFlags ( wflags);
+ Qt::WindowFlags wflags = viewport()-> windowFlags() |Qt::WRepaintNoErase;//WResizeNoErase
+ viewport()->setWindowFlags ( wflags);
#endif
mGridSpacingX = 80;
mResizeBorderWidth = 8;
mScrollBorderWidth = 8;
mScrollDelay = 30;
mScrollOffset = 10;
mPaintPixmap.resize( 20,20);
//enableClipper(true);
// Grab key strokes for keyboard navigation of agenda. Seems to have no
// effect. Has to be fixed.
- setFocusPolicy(WheelFocus);
+ setFocusPolicy(Qt::WheelFocus);
connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp()));
connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown()));
connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize()));
mStartCellX = 0;
@@ -392,17 +403,17 @@ bool KOAgenda::eventFilter ( QObject *object, QEvent *event )
case QEvent::MouseButtonRelease:
case QEvent::MouseMove:
return eventFilter_mouse(object, static_cast<QMouseEvent *>(event));
case (QEvent::Leave):
if (!mActionItem)
- setCursor(arrowCursor);
+ setCursor(Qt::arrowCursor);
return true;
default:
- return QScrollView::eventFilter(object,event);
+ return Q3ScrollView::eventFilter(object,event);
}
}
void KOAgenda::popupMenu()
{
mPopupTimer->stop();
if ( mPopupKind == 1 || mPopupKind == 3 ) {
@@ -502,17 +513,17 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
} else {
viewportPos = me->pos();
}
bool objIsNotViewport = (object != viewport());
bool leftButt = false;
#ifdef DESKTOP_VERSION
- leftButt = (me->button() == LeftButton);
+ leftButt = (me->button() == Qt::LeftButton);
#endif
switch (me->type()) {
case QEvent::MouseButtonPress:
- if (me->button() == LeftButton) {
+ if (me->button() == Qt::LeftButton) {
mPopupTimer->start( 600 );
mLeftMouseDown = true;
}
blockMoving = true;
startX = viewportPos.x();
startY = viewportPos.y();
@@ -575,16 +586,16 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
}
}
}
if ( objIsNotViewport ) {
mPopupItem = (KOAgendaItem *)object;
mPopupKind = 1;
- if (me->button() == RightButton) {
+ if (me->button() == Qt::RightButton) {
mPopupKind = 3;
popupMenu();
- } else if (me->button() == LeftButton) {
+ } else if (me->button() == Qt::LeftButton) {
mActionItem = (KOAgendaItem *)object;
if (mActionItem) {
emit signalClearSelection();
slotClearSelection();
selectItem(mActionItem);
Incidence *incidence = mActionItem->incidence();
@@ -597,62 +608,62 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
}
} else { // ---------- viewport()
mPopupItem = 0;
mPopupKind = 2;
selectItem(0);
mActionItem = 0;
- if (me->button() == RightButton) {
+ if (me->button() == Qt::RightButton) {
int x,y;
viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
int gx,gy;
contentsToGrid(x,y,gx,gy);
mCurrentCellX = gx;
mCurrentCellY = gy;
mStartCellX = gx;
mStartCellY = gy;
mPopupKind = 4;
popupMenu();
- } else if (me->button() == LeftButton) {
- setCursor(arrowCursor);
+ } else if (me->button() == Qt::LeftButton) {
+ setCursor(Qt::arrowCursor);
startSelectAction(viewportPos);
}
}
break;
case QEvent::MouseButtonRelease:
- if (me->button() == LeftButton ) {
+ if (me->button() == Qt::LeftButton ) {
mPopupTimer->stop();
}
if (object != viewport()) {
- if (me->button() == LeftButton && mLeftMouseDown) {
+ if (me->button() == Qt::LeftButton && mLeftMouseDown) {
if (mActionItem) {
QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos));
//qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 );
if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) {
mScrollUpTimer.stop();
mScrollDownTimer.stop();
mActionItem->resetMove();
placeSubCells( mActionItem );
// emit startDragSignal( mActionItem->incidence() );
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
mActionItem = 0;
mActionType = NOP;
mItemMoved = 0;
mLeftMouseDown = false;
return true;
}
endItemAction();
}
}
} else { // ---------- viewport()
- if (me->button() == LeftButton && mLeftMouseDown ) { //left click
+ if (me->button() == Qt::LeftButton && mLeftMouseDown ) { //left click
endSelectAction( true ); // emit new event signal
}
}
- if (me->button() == LeftButton)
+ if (me->button() == Qt::LeftButton)
mLeftMouseDown = false;
break;
case QEvent::MouseMove:
//qDebug("mm ");
@@ -847,38 +858,38 @@ void KOAgenda::startItemAction(QPoint viewportPos)
if (mAllDayMode) {
int gridDistanceX = (x - gx * mGridSpacingX);
if ( allowResize && gridDistanceX < mResizeBorderWidth &&
mActionItem->cellX() == mCurrentCellX) {
mActionType = RESIZELEFT;
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else if ( allowResize && (mGridSpacingX - gridDistanceX) < mResizeBorderWidth &&
mActionItem->cellXWidth() == mCurrentCellX) {
mActionType = RESIZERIGHT;
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else {
mActionType = MOVE;
mActionItem->startMove();
- setCursor(sizeAllCursor);
+ setCursor(Qt::sizeAllCursor);
}
} else {
int gridDistanceY = (y - gy * mGridSpacingY);
if (allowResize && gridDistanceY < mResizeBorderWidth &&
mActionItem->cellYTop() == mCurrentCellY &&
!mActionItem->firstMultiItem()) {
mActionType = RESIZETOP;
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth &&
mActionItem->cellYBottom() == mCurrentCellY &&
!mActionItem->lastMultiItem()) {
mActionType = RESIZEBOTTOM;
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else {
mActionType = MOVE;
mActionItem->startMove();
- setCursor(sizeAllCursor);
+ setCursor(Qt::sizeAllCursor);
}
}
}
void KOAgenda::performItemAction(QPoint viewportPos)
{
@@ -903,33 +914,33 @@ void KOAgenda::performItemAction(QPoint viewportPos)
if ( mActionType == MOVE ) {
mScrollUpTimer.stop();
mScrollDownTimer.stop();
mActionItem->resetMove();
placeSubCells( mActionItem );
// emit startDragSignal( mActionItem->incidence() );
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
mActionItem = 0;
mActionType = NOP;
mItemMoved = 0;
return;
}
} else {
switch ( mActionType ) {
case MOVE:
- setCursor( sizeAllCursor );
+ setCursor( Qt::sizeAllCursor );
break;
case RESIZETOP:
case RESIZEBOTTOM:
- setCursor( sizeVerCursor );
+ setCursor( Qt::sizeVerCursor );
break;
case RESIZELEFT:
case RESIZERIGHT:
- setCursor( sizeHorCursor );
+ setCursor( Qt::sizeHorCursor );
break;
default:
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
}
}
// Scroll if item was moved to upper or lower end of agenda.
if (clipperPos.y() < mScrollBorderWidth) {
mScrollUpTimer.start(mScrollDelay);
@@ -968,13 +979,13 @@ void KOAgenda::performItemAction(QPoint viewportPos)
mActionItem->expandTop(gy - mCurrentCellY);
mActionItem->resize(mActionItem->width(),
mGridSpacingY * mActionItem->cellHeight());
int x,y;
gridToContents(mCurrentCellX,mActionItem->cellYTop(),x,y);
//moveChild(mActionItem,childX(mActionItem),y);
- QScrollView::moveChild( mActionItem,childX(mActionItem),y );
+ Q3ScrollView::moveChild( mActionItem,childX(mActionItem),y );
}
} else if (mActionType == RESIZEBOTTOM) {
if (mCurrentCellY >= mActionItem->cellYTop()) {
mActionItem->expandBottom(gy - mCurrentCellY);
mActionItem->resize(mActionItem->width(),
mGridSpacingY * mActionItem->cellHeight());
@@ -1016,13 +1027,13 @@ void KOAgenda::endItemAction()
}
int type = mActionType;
if ( mAllDayMode )
type = -1;
KOAgendaItem *modifiedItem = placeItem;
//emit itemModified( placeItem, mActionType /*KOGlobals::EVENTEDITED */);
- QPtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems();
+ Q3PtrList<KOAgendaItem> oldconflictItems ;//= placeItem->conflictItems();
KOAgendaItem *item;
if ( placeItem->incidence()->typeID() == todoID ) {
mSelectedItem = 0;
//qDebug("todo %d %d %d ", mCurrentCellX, modifiedItem->cellX() ,modifiedItem->cellXWidth());
modifiedItem->mLastMoveXPos = mCurrentCellX;
@@ -1107,13 +1118,13 @@ void KOAgenda::endItemAction()
}
if ( mActionItem )
emit incidenceSelected( mActionItem->incidence() );
mScrollUpTimer.stop();
mScrollDownTimer.stop();
- setCursor( arrowCursor );
+ setCursor( Qt::arrowCursor );
mActionItem = 0;
mActionType = NOP;
mItemMoved = 0;
}
@@ -1133,31 +1144,31 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos)
// Change cursor to resize cursor if appropriate
if (mAllDayMode) {
int gridDistanceX = (x - gx * mGridSpacingX);
if (gridDistanceX < mResizeBorderWidth &&
moveItem->cellX() == gx) {
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth &&
moveItem->cellXWidth() == gx) {
- setCursor(sizeHorCursor);
+ setCursor(Qt::sizeHorCursor);
} else {
- setCursor(arrowCursor);
+ setCursor(Qt::arrowCursor);
}
} else {
int gridDistanceY = (y - gy * mGridSpacingY);
if (gridDistanceY < mResizeBorderWidth &&
moveItem->cellYTop() == gy &&
!moveItem->firstMultiItem()) {
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else if ((mGridSpacingY - gridDistanceY) < mResizeBorderWidth &&
moveItem->cellYBottom() == gy &&
!moveItem->lastMultiItem()) {
- setCursor(sizeVerCursor);
+ setCursor(Qt::sizeVerCursor);
} else {
- setCursor(arrowCursor);
+ setCursor(Qt::arrowCursor);
}
}
}
/*
@@ -1170,15 +1181,15 @@ void KOAgenda::setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos)
cell, where other items are, which do not overlap in Y with the item to place,
the display gets corrupted, although the corruption looks quite nice.
*/
void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
{
- QPtrList<KOAgendaItem> conflictItems;
+ Q3PtrList<KOAgendaItem> conflictItems;
int maxSubCells = 0;
- QIntDict<KOAgendaItem> subCellDict(7);
+ Q3IntDict<KOAgendaItem> subCellDict(7);
KOAgendaItem *item;
for ( item=mItems.first(); item != 0; item=mItems.next() ) {
if (item != placeItem) {
if (placeItem->cellX() <= item->cellXWidth() &&
placeItem->cellXWidth() >= item->cellX()) {
@@ -1237,13 +1248,13 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
}
// Adjust sub cell geometry of all conflict items of all conflict items
for ( item=conflictItems.first(); item != 0;
item=conflictItems.next() ) {
if ( placeItem != item ) {
KOAgendaItem *item2;
- QPtrList<KOAgendaItem> conflictItems2 = item->conflictItems();
+ Q3PtrList<KOAgendaItem> conflictItems2 = item->conflictItems();
for ( item2=conflictItems2.first(); item2 != 0;
item2=conflictItems2.next() ) {
if ( item2->subCells() != maxSubCells) {
item2->setSubCells(maxSubCells);
int diff = 0;
if (mAllDayMode) {
@@ -1322,15 +1333,15 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
int vxSel, vySel;
contentsToViewport ( selectionX, mSelectionYTop, vxSel,vySel);
int off = mSelectionHeight;
if ( vySel < 0 )
off += vySel;
//qDebug("OFF %d %d %d", off,vySel, vy );
- bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,CopyROP);
+ bitBlt ( pd, vx, vy+off, &mPaintPixmap, cx, cy+off, cw , ch-off ,QPainter::CompositionMode_Source);
} else {
- bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
+ bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source);
}
}
if ( mSelectionHeight > 0 ) {
//qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
@@ -1339,13 +1350,13 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
int hei = mSelectionHeight;
int offset = 0;
while ( hei > 0 ) {
int p_hei = 5;
if ( hei < 5 ) p_hei = hei;
hei -= 5;
- bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
+ bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source);
offset += 5;
}
}
}
p->begin( pd );
} else {
@@ -1362,13 +1373,13 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
int selectionX = KOGlobals::self()->reverseLayout() ?
(mColumns - 1 - mSelectionCellX) * mGridSpacingX :
mSelectionCellX * mGridSpacingX;
contentsToViewport ( cx, cy, vx,vy);
// qDebug(" %d %d %d %d ", cx, cy, cw,ch) ;
if ( !(selectionX == cx && cy == mSelectionYTop && cw ==mGridSpacingX && ch == mSelectionHeight ) )
- bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,CopyROP);
+ bitBlt ( pd, vx, vy, &mPaintPixmap, cx, cy, cw, ch ,QPainter::CompositionMode_Source);
if ( mSelectionHeight > 0 ) {
//qDebug("---- %d %d %d %d ", selectionX, mSelectionYTop, mGridSpacingX, mSelectionHeight );
if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
contentsToViewport ( selectionX, mSelectionYTop, vx,vy);
@@ -1376,13 +1387,13 @@ void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
int hei = mSelectionHeight;
int offset = 0;
while ( hei > 0 ) {
int p_hei = 5;
if ( hei < 5 ) p_hei = hei;
hei -= 5;
- bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,CopyROP);
+ bitBlt ( pd, vx+1, vy+offset, &mHighlightPixmap, 0, 0, mGridSpacingX-1, p_hei ,QPainter::CompositionMode_Source);
offset += 5;
}
}
}
p->begin( pd );
}
@@ -1573,20 +1584,20 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
}
}
// Draw horizontal lines of grid
int y = ((int)(cy/lGridSpacingY))*lGridSpacingY;
if ( lGridSpacingY > 0 ) {
while (y < cy + ch) {
- p->setPen( SolidLine );
+ p->setPen( Qt::SolidLine );
p->drawLine(cx,y,cx+cw,y);
y+=lGridSpacingY;
- p->setPen( DotLine );
+ p->setPen( Qt::DotLine );
p->drawLine(cx,y,cx+cw,y);
y+=lGridSpacingY;
}
- p->setPen( SolidLine );
+ p->setPen( Qt::SolidLine );
}
mPixPainter.end() ;
}
/*
Convert srcollview contents coordinates to agenda grid coordinates.
@@ -1714,13 +1725,13 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
//qDebug("item found ");
item->hide();
item->setCellX(-2, -1 );
item->select(false);
mUnusedItems.append( item );
mItems.remove( item );
- QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
+ Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
KOAgendaItem *itemit;
//globalFlagBlockAgendaItemPaint = 1;
for ( itemit=oldconflictItems.first(); itemit != 0;
itemit=oldconflictItems.next() ) {
if ( itemit != item )
placeSubCells(itemit);
@@ -1744,13 +1755,13 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
return;
}
if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda )
return;
//qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
QDate currentDate = QDate::currentDate();
- bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda );
+ bool overdue = (!todo->isCompleted()) && (todo->dtDue() < (QDateTime)currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda );
QDateTime dt;
if ( todo->hasCompletedDate() )
dt = todo->completed();
else
dt = todo->dtDue();
if ( overdue ) {
@@ -1776,13 +1787,13 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
int startY = endY - 1-hi;
item = insertItem(todo,currentDate,days,startY,endY);
item->show();
}
qApp->processEvents();
globalFlagBlockAgendaItemPaint = 0;
- QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
+ Q3PtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
KOAgendaItem *itemit;
for ( itemit=oldconflictItems.first(); itemit != 0;
itemit=oldconflictItems.next() ) {
globalFlagBlockAgendaItemUpdate = 0;
itemit->repaintMe();
globalFlagBlockAgendaItemUpdate = 1;
@@ -1864,13 +1875,13 @@ void KOAgenda::insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
int cellX,cellYTop,cellYBottom;
QString newtext;
int width = XEnd - XBegin + 1;
int count = 0;
KOAgendaItem *current = 0;
- QPtrList<KOAgendaItem> multiItems;
+ Q3PtrList<KOAgendaItem> multiItems;
for (cellX = XBegin;cellX <= XEnd;++cellX) {
if (cellX == XBegin) cellYTop = YTop;
else cellYTop = 0;
if (cellX == XEnd) cellYBottom = YBottom;
else cellYBottom = rows() - 1;
newtext = QString("(%1/%2): ").arg(++count).arg(width);
@@ -1924,13 +1935,13 @@ void KOAgenda::finishResize ( )
*/
void KOAgenda::resizeEvent ( QResizeEvent *ev )
{
mSelectionHeight = 0;
mResizeTimer.start( 150 , true );
computeSizes();
- QScrollView::resizeEvent( ev );
+ Q3ScrollView::resizeEvent( ev );
return;
}
void KOAgenda::computeSizes()
{
if ( globalFlagBlockStartup )
@@ -2013,13 +2024,13 @@ void KOAgenda::popupAlarm()
if (!mClickedItem) {
qDebug("KOAgenda::popupAlarm() called without having a clicked item ");
return;
}
// TODO: deal correctly with multiple alarms
Alarm* alarm;
- QPtrList<Alarm> list(mClickedItem->incidence()->alarms());
+ Q3PtrList<Alarm> list(mClickedItem->incidence()->alarms());
for(alarm=list.first();alarm;alarm=list.next()) {
alarm->toggleAlarm();
}
emit itemModified( mClickedItem , KOGlobals::EVENTEDITED );
mClickedItem->paintMe( true );
mClickedItem->repaint( false );
@@ -2104,22 +2115,22 @@ void KOAgenda::selectItem(KOAgendaItem *item)
}
// This function seems never be called.
void KOAgenda::keyPressEvent( QKeyEvent *kev )
{
switch(kev->key()) {
- case Key_PageDown:
+ case Qt::Key_PageDown:
verticalScrollBar()->addPage();
break;
- case Key_PageUp:
+ case Qt::Key_PageUp:
verticalScrollBar()->subtractPage();
break;
- case Key_Down:
+ case Qt::Key_Down:
verticalScrollBar()->addLine();
break;
- case Key_Up:
+ case Qt::Key_Up:
verticalScrollBar()->subtractLine();
break;
default:
;
}
}
@@ -2143,13 +2154,13 @@ DateList KOAgenda::dateList() const
void KOAgenda::setDateList(const DateList &selectedDates)
{
mSelectedDates = selectedDates;
}
-void KOAgenda::setHolidayMask(QMemArray<bool> *mask)
+void KOAgenda::setHolidayMask(Q3MemArray<bool> *mask)
{
mHolidayMask = mask;
/*
kdDebug() << "HolidayMask: ";
for(uint i=0;i<mask->count();++i) {
@@ -2159,13 +2170,13 @@ void KOAgenda::setHolidayMask(QMemArray<bool> *mask)
*/
}
void KOAgenda::contentsMousePressEvent ( QMouseEvent *event )
{
- QScrollView::contentsMousePressEvent(event);
+ Q3ScrollView::contentsMousePressEvent(event);
}
void KOAgenda::storePosition()
{
//mContentPosition
int max = mGridSpacingY*4*24;
@@ -2193,19 +2204,19 @@ void KOAgenda::restorePosition()
//qDebug("posY %d hei %d", posY, max);
}
void KOAgenda::moveChild( QWidget *w, int x , int y )
{
++x;
- QScrollView::moveChild( w, x , y );
+ Q3ScrollView::moveChild( w, x , y );
}
#include <qmessagebox.h>
#ifdef DESKTOP_VERSION
#include <qprinter.h>
#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
+#include <q3paintdevicemetrics.h>
#endif
void KOAgenda::printSelection()
{
#ifdef DESKTOP_VERSION
if ( mStartCellY == mCurrentCellY ) {
@@ -2228,13 +2239,13 @@ void KOAgenda::printSelection()
QPrinter* printer = new QPrinter();
if ( !printer->setup()) {
delete printer;
return;
}
QPainter p( printer );
- QPaintDeviceMetrics m = QPaintDeviceMetrics ( printer );
+ Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( printer );
QString date = i18n("Date range: ")+KGlobal::locale()->formatDate( mSelectedDates.first() )+" - "+KGlobal::locale()->formatDate( mSelectedDates.last() );
//date += " --- printing time: " + KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), true );
int hei = p.boundingRect(0,0, 5, 5, Qt::AlignLeft, date ).height();
// p.drawText( 0, 0, date );
int offset = m.width()/8;
// compute the scale