summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kolistview.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index d3aa650..3d4acb7 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -961,96 +961,97 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
QListViewItem* cn;
cn = currentItem();
if ( cn ) {
KOListViewItem* ci = (KOListViewItem*)( cn );
if ( ci ){
emit showIncidence( ci->data());
cn = cn->nextSibling();
if ( cn ) {
setCurrentItem ( cn );
ensureItemVisible ( cn );
}
}
}
e->accept();
}
break;
case Qt::Key_Return:
case Qt::Key_Enter:
{
QListViewItem* cn;
cn = currentItem();
if ( cn ) {
KOListViewItem* ci = (KOListViewItem*)( cn );
if ( ci ){
if ( e->state() == ShiftButton )
ci->setSelected( false );
else
ci->setSelected( true );
cn = cn->nextSibling();
if ( cn ) {
setCurrentItem ( cn );
ensureItemVisible ( cn );
}
}
}
e->accept();
}
break;
default:
e->ignore();
}
}
KOListViewListView::KOListViewListView(KOListView * lv )
: KListView( lv )
{
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
#endif
+ mYMousePos = -1000;
setSelectionMode( QListView::Multi );
setMultiSelection( true);
mAllowPopupMenu = true;
mMouseDown = false;
}
void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
{
if (!e) return;
QPoint vp = contentsToViewport(e->pos());
QListViewItem *item = itemAt(vp);
if (!item) {
emit newEvent();
return;
}
KListView::contentsMouseDoubleClickEvent(e);
}
void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
{
//qDebug("contentsMousePressEvent++++ ");
if (! mMouseDown ) {
mAllowPopupMenu = true;
mYMousePos = mapToGlobal( (e->pos())).y();
}
if ( e->button() == RightButton && mMouseDown )
return;
if ( e->button() == LeftButton )
mMouseDown = true;
KListView::contentsMousePressEvent( e );
}
void KOListViewListView::contentsMouseReleaseEvent(QMouseEvent *e)
{
//qDebug("contentsMouseReleaseEv---- ");
if ( ! mMouseDown ) {
if ( e->button() == RightButton && ! mAllowPopupMenu )
return;
QListViewItem* ci = currentItem();
if ( ci )
ci->setSelected( true );
KListView::contentsMouseReleaseEvent(e);
return;
}
if ( e->button() == LeftButton )
mMouseDown = false;
if ( e->button() == RightButton && ! mAllowPopupMenu )
return;