Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinview.cpp
Context not available. | |||||
744 | break; | 744 | break; | ||
---|---|---|---|---|---|
745 | 745 | | |||
746 | case QEvent::KeyPress: | 746 | case QEvent::KeyPress: | ||
747 | hideToolTipInstantly(); | ||||
747 | if (GeneralSettings::useTabForSwitchingSplitView()) { | 748 | if (GeneralSettings::useTabForSwitchingSplitView()) { | ||
748 | QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event); | 749 | QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event); | ||
749 | if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) { | 750 | if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) { | ||
Context not available. | |||||
1423 | #endif | 1424 | #endif | ||
1424 | } | 1425 | } | ||
1425 | 1426 | | |||
1427 | void DolphinView::hideToolTipInstantly() | ||||
1428 | { | ||||
1429 | #ifdef HAVE_BALOO | ||||
1430 | if (GeneralSettings::showToolTips()) { | ||||
1431 | m_toolTipManager->hideToolTip(true); | ||||
1432 | } | ||||
1433 | #endif | ||||
1434 | } | ||||
1435 | | ||||
elvisangelaccio: I don't like this duplicate function. We could just add the bool parameter to `DolphinView… | |||||
broulik: or rather some flag :) | |||||
Of course a single function was my initial version. connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip); connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, &DolphinView::hideToolTip); error: static assertion failed: Signal and slot arguments are not compatible. Tried solving this with SLOT(), default argument, separate overloaded function with no arguments. It seems that will require QOverload in every connect() call: connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, QOverload<>::of(&DolphinView::hideToolTip)); connect(m_container->verticalScrollBar(), &QScrollBar::valueChanged, this, QOverload<>::of(&DolphinView::hideToolTip)); Are you OK with this? pdabrowski: Of course a single function was my initial version.
But then I got errors for connect()s:
```… | |||||
To be precise: pdabrowski: To be precise:
QOverload plus still a separate overloaded DolphinView::hideToolTip() function… | |||||
We can fix this issue by using a lamba ;) connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, [=] { hideToolTip(); }); elvisangelaccio: We can fix this issue by using a lamba ;)
```
connect(m_container->horizontalScrollBar()… | |||||
Have you tried to use this lambda in order to bring back the approach of https://phabricator.kde.org/D22512?id=62021 ? (which I prefer because we avoid to duplicate DolphinView::hideToolTip()) elvisangelaccio: Have you tried to use this lambda in order to bring back the approach of https://phabricator. | |||||
1426 | void DolphinView::calculateItemCount(int& fileCount, | 1436 | void DolphinView::calculateItemCount(int& fileCount, | ||
1427 | int& folderCount, | 1437 | int& folderCount, | ||
1428 | KIO::filesize_t& totalFileSize) const | 1438 | KIO::filesize_t& totalFileSize) const | ||
Context not available. |
I don't like this duplicate function. We could just add the bool parameter to DolphinView::hideToolTip().