From 4afdcfcac216b428ada79f4750cf7447e3175333 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 21 Jan 2005 15:38:31 +0000 Subject: some fixes --- (limited to 'microkde/kdeui') diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index 6859d36..154cd02 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp @@ -1909,9 +1909,17 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i) void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) { - // qDebug("KListView::emitContextMenu col"); - emit contextRequest( i, p, col ); - emit contextMenu (this, i, p); + QListViewItem* item = i; + int c = col; + // do not trust the values for QListViewItem* i and int col; + // qDebug("KListView::emitContextMenu col"); + if ( col == -1 ) { + QPoint pp = viewport()->mapFromGlobal(p); + item = itemAt( pp); + c = header()->sectionAt(pp.x() ); + } + emit contextRequest( item, p, c ); + emit contextMenu (this, item, p); } void KListView::setAcceptDrops (bool val) -- cgit v0.9.0.2