author | zautrix <zautrix> | 2005-01-21 15:38:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-21 15:38:31 (UTC) |
commit | 4afdcfcac216b428ada79f4750cf7447e3175333 (patch) (unidiff) | |
tree | 8f70936ac23137c3f6fb00fce33edbfe3d821f59 /microkde | |
parent | 234b9425bebd41b556277cdd94138fafecc32b45 (diff) | |
download | kdepimpi-4afdcfcac216b428ada79f4750cf7447e3175333.zip kdepimpi-4afdcfcac216b428ada79f4750cf7447e3175333.tar.gz kdepimpi-4afdcfcac216b428ada79f4750cf7447e3175333.tar.bz2 |
some fixes
-rw-r--r-- | microkde/kdeui/klistview.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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 | |||
@@ -1900,27 +1900,35 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i) | |||
1900 | // qDebug("KListView::emitContextMenu "); | 1900 | // qDebug("KListView::emitContextMenu "); |
1901 | 1901 | ||
1902 | if (i) | 1902 | if (i) |
1903 | p = viewport()->mapToGlobal(itemRect(i).center()); | 1903 | p = viewport()->mapToGlobal(itemRect(i).center()); |
1904 | else | 1904 | else |
1905 | p = mapToGlobal(rect().center()); | 1905 | p = mapToGlobal(rect().center()); |
1906 | 1906 | ||
1907 | emit contextMenu (this, i, p); | 1907 | emit contextMenu (this, i, p); |
1908 | } | 1908 | } |
1909 | 1909 | ||
1910 | void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) | 1910 | void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) |
1911 | { | 1911 | { |
1912 | // qDebug("KListView::emitContextMenu col"); | 1912 | QListViewItem* item = i; |
1913 | emit contextRequest( i, p, col ); | 1913 | int c = col; |
1914 | emit contextMenu (this, i, p); | 1914 | // do not trust the values for QListViewItem* i and int col; |
1915 | // qDebug("KListView::emitContextMenu col"); | ||
1916 | if ( col == -1 ) { | ||
1917 | QPoint pp = viewport()->mapFromGlobal(p); | ||
1918 | item = itemAt( pp); | ||
1919 | c = header()->sectionAt(pp.x() ); | ||
1920 | } | ||
1921 | emit contextRequest( item, p, c ); | ||
1922 | emit contextMenu (this, item, p); | ||
1915 | } | 1923 | } |
1916 | 1924 | ||
1917 | void KListView::setAcceptDrops (bool val) | 1925 | void KListView::setAcceptDrops (bool val) |
1918 | { | 1926 | { |
1919 | QListView::setAcceptDrops (val); | 1927 | QListView::setAcceptDrops (val); |
1920 | viewport()->setAcceptDrops (val); | 1928 | viewport()->setAcceptDrops (val); |
1921 | } | 1929 | } |
1922 | 1930 | ||
1923 | int KListView::dropVisualizerWidth () const | 1931 | int KListView::dropVisualizerWidth () const |
1924 | { | 1932 | { |
1925 | return d->mDropVisualizerWidth; | 1933 | return d->mDropVisualizerWidth; |
1926 | } | 1934 | } |