summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kolistview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index e560ce4..b236c2d 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -1240,96 +1240,98 @@ void KOListViewListView::keyPressEvent ( QKeyEvent *e)
1240 if ( ! cn ) 1240 if ( ! cn )
1241 return; 1241 return;
1242 if ( jump == 0 ) 1242 if ( jump == 0 )
1243 jump = 1; 1243 jump = 1;
1244 while ( jump && cn->itemAbove ()) { 1244 while ( jump && cn->itemAbove ()) {
1245 cn = cn->itemAbove (); 1245 cn = cn->itemAbove ();
1246 --jump; 1246 --jump;
1247 } 1247 }
1248 setCurrentItem ( cn ); 1248 setCurrentItem ( cn );
1249 ensureItemVisible ( cn ); 1249 ensureItemVisible ( cn );
1250 } else 1250 } else
1251 QListView::keyPressEvent ( e ) ; 1251 QListView::keyPressEvent ( e ) ;
1252 e->accept(); 1252 e->accept();
1253 break; 1253 break;
1254 case Qt::Key_I: { 1254 case Qt::Key_I: {
1255 QListViewItem* cn; 1255 QListViewItem* cn;
1256 cn = currentItem(); 1256 cn = currentItem();
1257 if ( cn ) { 1257 if ( cn ) {
1258 KOListViewItem* ci = (KOListViewItem*)( cn ); 1258 KOListViewItem* ci = (KOListViewItem*)( cn );
1259 if ( ci ){ 1259 if ( ci ){
1260 //emit showIncidence( ci->data()); 1260 //emit showIncidence( ci->data());
1261 cn = cn->nextSibling(); 1261 cn = cn->nextSibling();
1262 if ( cn ) { 1262 if ( cn ) {
1263 setCurrentItem ( cn ); 1263 setCurrentItem ( cn );
1264 ensureItemVisible ( cn ); 1264 ensureItemVisible ( cn );
1265 } 1265 }
1266 emit showIncidence( ci->data()); 1266 emit showIncidence( ci->data());
1267 } 1267 }
1268 } 1268 }
1269 e->accept(); 1269 e->accept();
1270 } 1270 }
1271 break; 1271 break;
1272 case Qt::Key_Return: 1272 case Qt::Key_Return:
1273 case Qt::Key_Enter: 1273 case Qt::Key_Enter:
1274 { 1274 {
1275 QListViewItem* cn; 1275 QListViewItem* cn;
1276 cn = currentItem(); 1276 cn = currentItem();
1277 if ( cn ) { 1277 if ( cn ) {
1278 KOListViewItem* ci = (KOListViewItem*)( cn ); 1278 KOListViewItem* ci = (KOListViewItem*)( cn );
1279 if ( ci ){ 1279 if ( ci ){
1280 if ( e->state() == ShiftButton ) 1280 if ( e->state() == ShiftButton )
1281 ci->setSelected( false ); 1281 ci->setSelected( false );
1282 else 1282 else
1283 ci->setSelected( true ); 1283 ci->setSelected( true );
1284 cn = cn->nextSibling(); 1284 cn = cn->nextSibling();
1285 if ( cn ) { 1285 if ( cn ) {
1286 setCurrentItem ( cn ); 1286 setCurrentItem ( cn );
1287 ensureItemVisible ( cn ); 1287 ensureItemVisible ( cn );
1288 } else {
1289 emit currentChanged( ci );
1288 } 1290 }
1289 } 1291 }
1290 } 1292 }
1291 e->accept(); 1293 e->accept();
1292 } 1294 }
1293 break; 1295 break;
1294 default: 1296 default:
1295 e->ignore(); 1297 e->ignore();
1296 } 1298 }
1297} 1299}
1298KOListViewListView::KOListViewListView(KOListView * lv ) 1300KOListViewListView::KOListViewListView(KOListView * lv )
1299 : KListView( lv, "kolistlistview", false ) 1301 : KListView( lv, "kolistlistview", false )
1300{ 1302{
1301 mYMousePos = 0; 1303 mYMousePos = 0;
1302 mPopupTimer = new QTimer(this); 1304 mPopupTimer = new QTimer(this);
1303 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); 1305 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
1304#ifndef DESKTOP_VERSION 1306#ifndef DESKTOP_VERSION
1305 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 1307 //QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
1306#endif 1308#endif
1307 setSelectionMode( QListView::Multi ); 1309 setSelectionMode( QListView::Multi );
1308 setMultiSelection( true); 1310 setMultiSelection( true);
1309} 1311}
1310bool KOListViewListView::hasMultiSelection(QListViewItem* item) 1312bool KOListViewListView::hasMultiSelection(QListViewItem* item)
1311{ 1313{
1312 QListViewItem *qitem = firstChild (); 1314 QListViewItem *qitem = firstChild ();
1313 while ( qitem ) { 1315 while ( qitem ) {
1314 if ( qitem->isSelected() && item != qitem ) 1316 if ( qitem->isSelected() && item != qitem )
1315 return true; 1317 return true;
1316 qitem = qitem->nextSibling(); 1318 qitem = qitem->nextSibling();
1317 } 1319 }
1318 return false; 1320 return false;
1319} 1321}
1320void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 1322void KOListViewListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
1321{ 1323{
1322 if (!e) return; 1324 if (!e) return;
1323 QPoint vp = contentsToViewport(e->pos()); 1325 QPoint vp = contentsToViewport(e->pos());
1324 QListViewItem *item = itemAt(vp); 1326 QListViewItem *item = itemAt(vp);
1325 if (!item) { 1327 if (!item) {
1326 emit newEvent(); 1328 emit newEvent();
1327 return; 1329 return;
1328 } 1330 }
1329 KListView::contentsMouseDoubleClickEvent(e); 1331 KListView::contentsMouseDoubleClickEvent(e);
1330} 1332}
1331#if 0 1333#if 0
1332void KOListViewListView::contentsMousePressEvent(QMouseEvent *e) 1334void KOListViewListView::contentsMousePressEvent(QMouseEvent *e)
1333{ 1335{
1334 //qDebug("contentsMousePressEvent++++ "); 1336 //qDebug("contentsMousePressEvent++++ ");
1335 KListView::contentsMousePressEvent( e ); 1337 KListView::contentsMousePressEvent( e );