m_tabsForFiles(false),
m_assureVisibleCurrentIndex(false),
m_isFolderWritable(true),
+ m_dragging(false),
m_url(url),
m_mode(DolphinView::IconsView),
m_additionalInfoList(),
}
KItemListView* view = controller->view();
+ view->installEventFilter(this);
connect(view, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
this, SLOT(slotSortOrderChangedByHeader(Qt::SortOrder,Qt::SortOrder)));
connect(view, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
}
break;
+ case QEvent::GraphicsSceneDragEnter:
+ if (watched == m_container->controller()->view()) {
+ m_dragging = true;
+ }
+ break;
+
+ case QEvent::GraphicsSceneDragLeave:
+ if (watched == m_container->controller()->view()) {
+ m_dragging = false;
+ }
+ break;
+
+ case QEvent::GraphicsSceneDrop:
+ if (watched == m_container->controller()->view()) {
+ m_dragging = false;
+ }
default:
break;
}
{
const KFileItem item = fileItemModel()->fileItem(index);
- if (GeneralSettings::showToolTips() && hasFocus() && QApplication::mouseButtons() == Qt::NoButton) {
+ if (GeneralSettings::showToolTips() && !m_dragging) {
QRectF itemRect = m_container->controller()->view()->itemContextRect(index);
const QPoint pos = m_container->mapToGlobal(itemRect.topLeft().toPoint());
itemRect.moveTo(pos);
static QString fileSizeText(KIO::filesize_t fileSize);
private:
- bool m_active : 1;
- bool m_tabsForFiles : 1;
- bool m_assureVisibleCurrentIndex : 1;
- bool m_isFolderWritable : 1;
+ bool m_active;
+ bool m_tabsForFiles;
+ bool m_assureVisibleCurrentIndex;
+ bool m_isFolderWritable;
+ bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
+ // tooltip may be shown when hovering an item.
KUrl m_url;
Mode m_mode;