summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/komonthview.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp218
1 files changed, 115 insertions, 103 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 85e9166..ca55c43 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -17,22 +17,34 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <qpopupmenu.h>
+#include <q3popupmenu.h>
#include <qfont.h>
#include <qfontmetrics.h>
-#include <qkeycode.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qwidgetstack.h>
+#include <qnamespace.h>
+#include <q3hbox.h>
+#include <q3vbox.h>
+#include <q3widgetstack.h>
#include <qpushbutton.h>
#include <qtooltip.h>
#include <qpainter.h>
#include <qtimer.h>
-#include <qwhatsthis.h>
+#include <q3whatsthis.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QLabel>
+#include <QPixmap>
+#include <QFocusEvent>
+#include <QMouseEvent>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
+#include <Q3Frame>
+#include <Q3PointArray>
+#include <Q3PtrList>
#endif
#include <kdebug.h>
@@ -59,10 +71,10 @@
#ifdef DESKTOP_VERSION
QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
#endif
-class KNOWhatsThis :public QWhatsThis
+class KNOWhatsThis :public Q3WhatsThis
{
public:
- KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { };
+ KNOWhatsThis( KNoScrollListBox* sbox ) : Q3WhatsThis( sbox ), _wid( sbox) { };
//~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); };
protected:
@@ -77,7 +89,7 @@ private:
KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
- : QListBox(parent, name, WRepaintNoErase)
+ : Q3ListBox(parent, name, Qt::WNoAutoErase)
{
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
@@ -85,8 +97,8 @@ KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
mBlockDeselect = false;
mWT = new KNOWhatsThis(this);
resetOnFocusIn = true;
- setVScrollBarMode(QScrollView::AlwaysOff);
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
KNoScrollListBox::~KNoScrollListBox()
{
@@ -100,7 +112,7 @@ KNoScrollListBox::~KNoScrollListBox()
void KNoScrollListBox::focusInEvent ( QFocusEvent * e )
{
- QListBox::focusInEvent ( e );
+ Q3ListBox::focusInEvent ( e );
if ( count() ){
int ci = currentItem();
if ( ci < 0 ) ci = 0;
@@ -112,24 +124,24 @@ void KNoScrollListBox::focusInEvent ( QFocusEvent * e )
resetOnFocusIn = true;
if ( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) {
- QListBoxItem *fi = firstItem ();
+ Q3ListBoxItem *fi = firstItem ();
if (fi ) {
int ihei = fi->height( this );
int hei = numRows () * ihei;
if ( hei < height() - horizontalScrollBar()->height () ) {
- setVScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
}
else
- setVScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
if ( ihei *3 > height() ) {
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
else {
- setHScrollBarMode(QScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
} else {
- setVScrollBarMode(QScrollView::Auto);
- setHScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
}
}
@@ -141,10 +153,10 @@ void KNoScrollListBox::focusOutEvent ( QFocusEvent * e )
if ( i >= 0 ) {
setSelected ( i, false );
}
- QListBox::focusOutEvent ( e );
+ Q3ListBox::focusOutEvent ( e );
}
- setVScrollBarMode(QScrollView::AlwaysOff);
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
if ( ! mBlockDeselect )
emit highlightIncidence( 0, (MonthViewCell*)this, 0 );
mBlockDeselect = false;
@@ -152,7 +164,7 @@ void KNoScrollListBox::focusOutEvent ( QFocusEvent * e )
QString KNoScrollListBox::getWhatsThisText(QPoint p)
{
- QListBoxItem* item = itemAt ( p );
+ Q3ListBoxItem* item = itemAt ( p );
if ( ! item ) {
return i18n("Click in the cell\nto add an event!");
}
@@ -165,7 +177,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
{
//qDebug("KNoScrollListBox::keyPressEvent ");
switch(e->key()) {
- case Key_Right:
+ case Qt::Key_Right:
if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
@@ -173,7 +185,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
}
scrollBy(10,0);
break;
- case Key_Left:
+ case Qt::Key_Left:
if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
@@ -181,7 +193,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
}
scrollBy(-10,0);
break;
- case Key_Up:
+ case Qt::Key_Up:
if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
@@ -201,7 +213,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
}
}
break;
- case Key_Down:
+ case Qt::Key_Down:
if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
@@ -221,12 +233,12 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
}
}
break;
- case Key_I:
+ case Qt::Key_I:
QTimer::singleShot( 1, this, SLOT ( oneDown() ) );
e->ignore();
break;
- case Key_Return:
- case Key_Enter:
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
{
if ( currentItem() >= 0 ) {
emit doubleClicked( item( currentItem() ) );
@@ -236,7 +248,7 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
}
}
break;
- case Key_Shift:
+ case Qt::Key_Shift:
emit shiftDown();
break;
default:
@@ -266,7 +278,7 @@ void KNoScrollListBox::oneDown()
void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
{
switch(e->key()) {
- case Key_Shift:
+ case Qt::Key_Shift:
emit shiftUp();
break;
default:
@@ -276,15 +288,15 @@ void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
{
- QListBox::mousePressEvent(e);
+ Q3ListBox::mousePressEvent(e);
- if(e->button() == RightButton) {
+ if(e->button() == Qt::RightButton) {
emit rightClick();
}
}
MonthViewItem::MonthViewItem( Incidence *incidence, const QString & s)
- : QListBoxItem()
+ : Q3ListBoxItem()
{
mblockRepaint = true;
isWeekItem = KOPrefs::instance()->mMonthViewWeek;
@@ -395,14 +407,14 @@ void MonthViewItem::paint(QPainter *p)
p->setBrush( QBrush( textColor ) );
p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ;
if ( mMultiday == 2 || mMultiday == 3 ) {
- QPointArray pa ( 3 );
+ Q3PointArray pa ( 3 );
pa.setPoint (0, x, yyy );
pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 );
pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 );
p->drawPolygon( pa );
}
if ( mMultiday == 2 || mMultiday == 1 ) {
- QPointArray pa ( 3 );
+ Q3PointArray pa ( 3 );
pa.setPoint (0, x+sizeM +sizeM/2, yyy );
pa.setPoint (1, x+sizeM, yyy+sizeM/2 );
pa.setPoint (2, x+sizeM, yyy-sizeM/2 );
@@ -462,7 +474,7 @@ void MonthViewItem::paint(QPainter *p)
}
}
-int MonthViewItem::height(const QListBox *lb) const
+int MonthViewItem::height(const Q3ListBox *lb) const
{
int ret = 10;
if ( lb )
@@ -470,7 +482,7 @@ int MonthViewItem::height(const QListBox *lb) const
return ret;
}
-int MonthViewItem::width(const QListBox *lb) const
+int MonthViewItem::width(const Q3ListBox *lb) const
{
if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) {
int size = PIXMAP_SIZE;
@@ -514,10 +526,10 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
//mLabel->setLineWidth( 1 );
//mLabel->setAlignment( AlignCenter );
mLabel->setFlat( true );
- mLabel->setFocusPolicy(NoFocus);
+ mLabel->setFocusPolicy(Qt::NoFocus);
//mItemList = new KNoScrollListBox( this );
setMinimumSize( 10, 10 );
- setFrameStyle( QFrame::Panel | QFrame::Plain );
+ setFrameStyle( Q3Frame::Panel | Q3Frame::Plain );
setLineWidth( 1 );
//topLayout->addWidget( mItemList );
mLabel->raise();
@@ -529,13 +541,13 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
updateConfig();
//connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() ));
connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() ));
- connect( this , SIGNAL( doubleClicked( QListBoxItem *) ),
- SLOT( defaultAction( QListBoxItem * ) ) );
- connect( this, SIGNAL( rightButtonPressed( QListBoxItem *,
+ connect( this , SIGNAL( doubleClicked( Q3ListBoxItem *) ),
+ SLOT( defaultAction( Q3ListBoxItem * ) ) );
+ connect( this, SIGNAL( rightButtonPressed( Q3ListBoxItem *,
const QPoint &) ),
- SLOT( contextMenu( QListBoxItem * ) ) );
- connect( this, SIGNAL( highlighted( QListBoxItem *) ),
- SLOT( selection( QListBoxItem * ) ) );
+ SLOT( contextMenu( Q3ListBoxItem * ) ) );
+ connect( this, SIGNAL( highlighted( Q3ListBoxItem *) ),
+ SLOT( selection( Q3ListBoxItem * ) ) );
/*
connect( this, SIGNAL( clicked( QListBoxItem * ) ),
@@ -545,7 +557,7 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
#ifdef DESKTOP_VERSION
QToolTipGroup *MonthViewCell::toolTipGroup()
{
- if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0);
+ /* TODO:hacker: if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); */
return mToolTipGroup;
}
#endif
@@ -637,7 +649,7 @@ void MonthViewCell::startUpdateCell()
{
blockSignals( true );
mdayCount = 0;
- setFocusPolicy(NoFocus);
+ setFocusPolicy(Qt::NoFocus);
if ( !mMonthView->isUpdatePossible() )
return;
MonthViewItem *mitem = (MonthViewItem*) firstItem ();
@@ -692,7 +704,7 @@ int MonthViewCell::insertEvent(Event *event)
useToolTips = false;
#endif
QString mToolTipText;
- setFocusPolicy(WheelFocus);
+ setFocusPolicy(Qt::WheelFocus);
if ( !(event->doesRecur() == Recurrence::rNone) ) {
if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
return mdayCount;
@@ -834,7 +846,7 @@ int MonthViewCell::insertEvent(Event *event)
}
for ( i = pos; i < itcount;++i ) {
// qDebug("i %d mday %u count %d ",i,itcount,mdayCount );
- QListBoxItem* it = this->item ( i );
+ Q3ListBoxItem* it = this->item ( i );
if ( it && text < it->text() ) {
pos = i;
break;
@@ -850,7 +862,7 @@ int MonthViewCell::insertEvent(Event *event)
}
void MonthViewCell::insertTodo(Todo *todo)
{
- setFocusPolicy(WheelFocus);
+ setFocusPolicy(Qt::WheelFocus);
QString text;
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
@@ -922,7 +934,7 @@ void MonthViewCell::finishUpdateCell()
#ifdef DESKTOP_VERSION
if (mToolTip.count() > 0 ) {
mToolTip.sort();
- QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),"");
+ /* TODO: hacker: QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); */
}
#endif
//sort();
@@ -938,13 +950,13 @@ void MonthViewCell::updateCell()
return;
startUpdateCell();
//mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
- QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
+ Q3PtrList<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 );
+ Q3PtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
Todo *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
insertTodo( todo );
@@ -992,28 +1004,28 @@ void MonthViewCell::enableScrollBars( bool enabled )
return;
if ( enabled ) {
- QListBoxItem *fi = firstItem ();
+ Q3ListBoxItem *fi = firstItem ();
if (fi ) {
int ihei = fi->height( this );
int hei = numRows () * ihei;
if ( hei < height() - horizontalScrollBar()->height () ) {
- setVScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
}
else
- setVScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
if ( ihei *3 > height() ) {
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
else {
- setHScrollBarMode(QScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
} else {
- setVScrollBarMode(QScrollView::Auto);
- setHScrollBarMode(QScrollView::Auto);
+ setVScrollBarMode(Q3ScrollView::Auto);
+ setHScrollBarMode(Q3ScrollView::Auto);
}
} else {
- setVScrollBarMode(QScrollView::AlwaysOff);
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setVScrollBarMode(Q3ScrollView::AlwaysOff);
+ setHScrollBarMode(Q3ScrollView::AlwaysOff);
}
}
@@ -1083,7 +1095,7 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e )
KNoScrollListBox::resizeEvent ( e );
}
-void MonthViewCell::defaultAction( QListBoxItem *item )
+void MonthViewCell::defaultAction( Q3ListBoxItem *item )
{
if ( !item ) {
@@ -1105,7 +1117,7 @@ void MonthViewCell::newEvent()
QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
emit newEventSignal( dt );
}
-void MonthViewCell::cellClicked( QListBoxItem *item )
+void MonthViewCell::cellClicked( Q3ListBoxItem *item )
{
mMonthView->setSelectedCell( this );
if ( item == 0 ) {
@@ -1116,7 +1128,7 @@ void MonthViewCell::cellClicked( QListBoxItem *item )
}
-void MonthViewCell::contextMenu( QListBoxItem *item )
+void MonthViewCell::contextMenu( Q3ListBoxItem *item )
{
mMonthView->setPopupCell( this );
if ( !item ) {
@@ -1133,7 +1145,7 @@ void MonthViewCell::contextMenu( QListBoxItem *item )
}
}
-void MonthViewCell::selection( QListBoxItem *item )
+void MonthViewCell::selection( Q3ListBoxItem *item )
{
if ( !item ) {
emit highlightIncidence( 0 , this, 0 );
@@ -1185,8 +1197,8 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
clPending = true;
mPopupCell = 0;
mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" );
- mWidStack = new QWidgetStack( this );
- QVBoxLayout* hb = new QVBoxLayout( this );
+ mWidStack = new Q3WidgetStack( this );
+ Q3VBoxLayout* hb = new Q3VBoxLayout( this );
mMonthView = new QWidget( mWidStack );
mWeekView = new QWidget( mWidStack );
#if QT_VERSION >= 0x030000
@@ -1215,15 +1227,15 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
for( i = 0; i < mDaysPerWeek; i++ ) {
QLabel *label = new QLabel( mMonthView );
label->setFont(bfont);
- label->setFrameStyle(QFrame::Panel|QFrame::Raised);
+ label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
label->setLineWidth(1);
- label->setAlignment(AlignCenter);
+ label->setAlignment(Qt::AlignCenter);
mDayLabels.insert( i, label );
label = new QLabel( mWeekView );
label->setFont(bfont);
- label->setFrameStyle(QFrame::Panel|QFrame::Raised);
+ label->setFrameStyle(Q3Frame::Panel|Q3Frame::Raised);
label->setLineWidth(1);
- label->setAlignment(AlignCenter);
+ label->setAlignment(Qt::AlignCenter);
mDayLabelsW.insert( i, label );
}
@@ -1232,34 +1244,34 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
mWeekLabelsW.resize( 2 );
for( i = 0; i < mNumWeeks+1; i++ ) {
KOWeekButton *label = new KOWeekButton( mMonthView );
- label->setFocusPolicy(NoFocus);
+ label->setFocusPolicy(Qt::NoFocus);
label->setFont(bfont);
connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
label->setFlat(true);
- QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
+ Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
//label->setFrameStyle(QFrame::Panel|QFrame::Raised);
//label->setLineWidth(1);
//label->setAlignment(AlignCenter);
mWeekLabels.insert( i, label );
}
mWeekLabels[mNumWeeks]->setText( i18n("W"));
- mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus);
- QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
+ mWeekLabels[mNumWeeks]->setFocusPolicy(Qt::WheelFocus);
+ Q3WhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
for( i = 0; i < 1+1; i++ ) {
KOWeekButton *label = new KOWeekButton( mWeekView );
- label->setFocusPolicy(NoFocus);
+ label->setFocusPolicy(Qt::NoFocus);
label->setFont(bfont);
connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
label->setFlat(true);
- QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
+ Q3WhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
//label->setFrameStyle(QFrame::Panel|QFrame::Raised);
//label->setLineWidth(1);
//label->setAlignment(AlignCenter);
mWeekLabelsW.insert( i, label );
}
mWeekLabelsW[1]->setText( i18n("W"));
- mWeekLabelsW[1]->setFocusPolicy(WheelFocus);
+ mWeekLabelsW[1]->setFocusPolicy(Qt::WheelFocus);
int row, col;
@@ -1305,13 +1317,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
//connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), SLOT( switchView() ) );
mContextMenu = eventPopup();
- mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mContextMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("New Event..."),this,
SLOT(slotNewEvent()),false);
- mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mContextMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("New Todo..."),this,
SLOT(slotNewTodo()),false);
- mContextMenu->addAdditionalItem(QIconSet(QPixmap()),
+ mContextMenu->addAdditionalItem(QIcon(QPixmap()),
i18n("Journal"),this,
SLOT(slotEditJournal()),false);
@@ -1325,7 +1337,7 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
pathString += "icons16/";
} else
pathString += "iconsmini/";
- mNewItemMenu = new QPopupMenu( this );
+ mNewItemMenu = new Q3PopupMenu( this );
mNewItemMenu->insertItem( SmallIcon( pathString +"newevent" ), i18n("New Event..."),this, SLOT(slotNewEvent()));
mNewItemMenu->insertItem( SmallIcon( pathString +"newtodo" ),i18n("New Todo..."),this,SLOT(slotNewTodo()),false);
mNewItemMenu->insertItem( SmallIcon( pathString +"journal" ),i18n("Journal"),this,SLOT(slotEditJournal()),false);
@@ -1397,7 +1409,7 @@ void KOMonthView::incidenceHighlighted( Incidence * inc , MonthViewCell* mc, int
break;
}
}
- QPtrVector<MonthViewCell> *cells;
+ Q3PtrVector<MonthViewCell> *cells;
if ( weekview )
cells = &mCellsW;
else {
@@ -1495,9 +1507,9 @@ int KOMonthView::currentDateCount()
return mNumCells;
}
-QPtrList<Incidence> KOMonthView::selectedIncidences()
+Q3PtrList<Incidence> KOMonthView::selectedIncidences()
{
- QPtrList<Incidence> selected;
+ Q3PtrList<Incidence> selected;
if ( mSelectedCell ) {
Incidence *incidence = mSelectedCell->selectedIncidence();
@@ -1561,7 +1573,7 @@ void KOMonthView::updateConfig()
mCellsW[i]->updateConfig(KOPrefs::instance()->mMonthViewUsesBigFont);
}
#ifdef DESKTOP_VERSION
- MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
+ /* TODO:hacker: MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); */
#endif
updateView();
}
@@ -1569,7 +1581,7 @@ void KOMonthView::updateConfig()
void KOMonthView::updateDayLabels()
{
- QPtrVector<QLabel> *mDayLabelsT;
+ Q3PtrVector<QLabel> *mDayLabelsT;
mDayLabelsT = &mDayLabelsW;
for (int i = 0; i < 7; i++) {
@@ -1610,9 +1622,9 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
{
// kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
- QPtrVector<MonthViewCell> *cells;
- QPtrVector<QLabel> *dayLabels;
- QPtrVector<KOWeekButton> *weekLabels;
+ Q3PtrVector<MonthViewCell> *cells;
+ Q3PtrVector<QLabel> *dayLabels;
+ Q3PtrVector<KOWeekButton> *weekLabels;
uint weekNum = 6;
mStartDate = start;
if ( mShowWeekView ) {
@@ -1668,7 +1680,7 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
updateView();
}
-void KOMonthView::showEvents(QPtrList<Event>)
+void KOMonthView::showEvents(Q3PtrList<Event>)
{
qDebug("KOMonthView::selectEvents is not implemented yet. ");
}
@@ -1690,7 +1702,7 @@ void KOMonthView::updateView()
//QTime ti;
//ti.start();
clearSelection();
- QPtrVector<MonthViewCell> *cells;
+ Q3PtrVector<MonthViewCell> *cells;
if ( mShowWeekView ) {
cells = &mCellsW;
} else {
@@ -1705,7 +1717,7 @@ void KOMonthView::updateView()
(*cells)[i]->startUpdateCell();
}
- QPtrList<Event> events = calendar()->events();
+ Q3PtrList<Event> events = calendar()->events();
Event *event;
QDateTime dt;
QDate endDate = mStartDate.addDays( timeSpan );
@@ -1769,7 +1781,7 @@ void KOMonthView::updateView()
}
}
// insert due todos
- QPtrList<Todo> todos = calendar()->todos( );
+ Q3PtrList<Todo> todos = calendar()->todos( );
Todo *todo;
for(todo = todos.first(); todo; todo = todos.next()) {
//insertTodo( todo );
@@ -2225,7 +2237,7 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell )
void KOMonthView::processSelectionChange()
{
- QPtrList<Incidence> incidences = selectedIncidences();
+ Q3PtrList<Incidence> incidences = selectedIncidences();
if (incidences.count() > 0) {
emit incidenceSelected( incidences.first() );
} else {
@@ -2261,7 +2273,7 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
if (! e->isAutoRepeat() )
mFlagKeyPressed = true;
switch(e->key()) {
- case Key_Up:
+ case Qt::Key_Up:
{
if ( mShowWeekView ) {
emit selectWeekNum ( currentWeek() - 1 );
@@ -2272,7 +2284,7 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
}
e->accept();
break;
- case Key_Down:
+ case Qt::Key_Down:
{
if ( mShowWeekView ) {
emit selectWeekNum ( currentWeek() +1);
@@ -2284,14 +2296,14 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
}
e->accept();
break;
- case Key_Return:
- case Key_Enter:
+ case Qt::Key_Return:
+ case Qt::Key_Enter:
{
selectInternalWeekNum ( currentWeek() );
}
e->accept();
break;
- case Key_D:
+ case Qt::Key_D:
if ( mSelectedCell ) {
mSelectedCell->showDay();
e->accept();