summaryrefslogtreecommitdiffabout
path: root/korganizer/kolistview.cpp
Unidiff
Diffstat (limited to 'korganizer/kolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 4fc1194..b378330 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1264,65 +1264,66 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1264 break; 1264 break;
1265 case Qt::Key_Return: 1265 case Qt::Key_Return:
1266 case Qt::Key_Enter: 1266 case Qt::Key_Enter:
1267 { 1267 {
1268 QListViewItem* cn; 1268 QListViewItem* cn;
1269 cn = currentItem(); 1269 cn = currentItem();
1270 if ( cn ) { 1270 if ( cn ) {
1271 KOListViewItem* ci = (KOListViewItem*)( cn ); 1271 KOListViewItem* ci = (KOListViewItem*)( cn );
1272 if ( ci ){ 1272 if ( ci ){
1273 if ( e->state() == ShiftButton ) 1273 if ( e->state() == ShiftButton )
1274 ci->setSelected( false ); 1274 ci->setSelected( false );
1275 else 1275 else
1276 ci->setSelected( true ); 1276 ci->setSelected( true );
1277 cn = cn->nextSibling(); 1277 cn = cn->nextSibling();
1278 if ( cn ) { 1278 if ( cn ) {
1279 setCurrentItem ( cn ); 1279 setCurrentItem ( cn );
1280 ensureItemVisible ( cn ); 1280 ensureItemVisible ( cn );
1281 } else { 1281 } else {
1282 emit currentChanged( ci ); 1282 emit currentChanged( ci );
1283 } 1283 }
1284 } 1284 }
1285 } 1285 }
1286 e->accept(); 1286 e->accept();
1287 } 1287 }
1288 break; 1288 break;
1289 default: 1289 default:
1290 e->ignore(); 1290 e->ignore();
1291 } 1291 }
1292} 1292}
1293KOListViewListView::KOListViewListView(KOListView * lv ) 1293KOListViewListView::KOListViewListView(KOListView * lv )
1294 : KListView( lv, "kolistlistview", false ) 1294 : KListView( lv, "kolistlistview", false )
1295{ 1295{
1296 mYMousePos = 0; 1296 mYMousePos = 0;
1297 setAllColumnsShowFocus( true );
1297 mPopupTimer = new QTimer(this); 1298 mPopupTimer = new QTimer(this);
1298 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); 1299 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
1299#ifndef DESKTOP_VERSION 1300#ifndef DESKTOP_VERSION
1300 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 1301 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
1301#endif 1302#endif
1302 setSelectionMode( QListView::Multi ); 1303 setSelectionMode( QListView::Multi );
1303 setMultiSelection( true); 1304 setMultiSelection( true);
1304} 1305}
1305bool KOListViewListView::hasMultiSelection(QListViewItem* item) 1306bool KOListViewListView::hasMultiSelection(QListViewItem* item)
1306{ 1307{
1307 QListViewItem *qitem = firstChild (); 1308 QListViewItem *qitem = firstChild ();
1308 while ( qitem ) { 1309 while ( qitem ) {
1309 if ( qitem->isSelected() && item != qitem ) 1310 if ( qitem->isSelected() && item != qitem )
1310 return true; 1311 return true;
1311 qitem = qitem->nextSibling(); 1312 qitem = qitem->nextSibling();
1312 } 1313 }
1313 return false; 1314 return false;
1314} 1315}
1315void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1316void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1316{ 1317{
1317 if (!e) return; 1318 if (!e) return;
1318 QPoint vp = contentsToViewport(e->pos()); 1319 QPoint vp = contentsToViewport(e->pos());
1319 QListViewItem *item = itemAt(vp); 1320 QListViewItem *item = itemAt(vp);
1320 if (!item) { 1321 if (!item) {
1321 emit newEvent(); 1322 emit newEvent();
1322 return; 1323 return;
1323 } 1324 }
1324 KListView::contentsMouseDoubleClickEvent(e); 1325 KListView::contentsMouseDoubleClickEvent(e);
1325} 1326}
1326#if 0 1327#if 0
1327void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1328void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
1328{ 1329{