Changeset View
Changeset View
Standalone View
Standalone View
src/search/dolphinsearchbox.cpp
Show First 20 Lines • Show All 213 Lines • ▼ Show 20 Line(s) | 213 | { | |||
---|---|---|---|---|---|
214 | QWidget::keyReleaseEvent(event); | 214 | QWidget::keyReleaseEvent(event); | ||
215 | if (event->key() == Qt::Key_Escape) { | 215 | if (event->key() == Qt::Key_Escape) { | ||
216 | if (m_searchInput->text().isEmpty()) { | 216 | if (m_searchInput->text().isEmpty()) { | ||
217 | emit closeRequest(); | 217 | emit closeRequest(); | ||
218 | } else { | 218 | } else { | ||
219 | m_searchInput->clear(); | 219 | m_searchInput->clear(); | ||
220 | } | 220 | } | ||
221 | } | 221 | } | ||
222 | else if (event->key() == Qt::Key_Down) { | ||||
223 | emit focusViewRequest(); | ||||
ngraham: don't assert; instead check for `m_view` being valid, and if it isn't, just do nothing. | |||||
224 | } | ||||
222 | } | 225 | } | ||
223 | 226 | | |||
224 | bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event) | 227 | bool DolphinSearchBox::eventFilter(QObject* obj, QEvent* event) | ||
225 | { | 228 | { | ||
226 | switch (event->type()) { | 229 | switch (event->type()) { | ||
227 | case QEvent::FocusIn: | 230 | case QEvent::FocusIn: | ||
228 | // #379135: we get the FocusIn event when we close a tab but we don't want to emit | 231 | // #379135: we get the FocusIn event when we close a tab but we don't want to emit | ||
229 | // the activated() signal before the removeTab() call in DolphinTabWidget::closeTab() returns. | 232 | // the activated() signal before the removeTab() call in DolphinTabWidget::closeTab() returns. | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 280 | } else { | |||
278 | m_startSearchTimer->start(); | 281 | m_startSearchTimer->start(); | ||
279 | } | 282 | } | ||
280 | emit searchTextChanged(text); | 283 | emit searchTextChanged(text); | ||
281 | } | 284 | } | ||
282 | 285 | | |||
283 | void DolphinSearchBox::slotReturnPressed() | 286 | void DolphinSearchBox::slotReturnPressed() | ||
284 | { | 287 | { | ||
285 | emitSearchRequest(); | 288 | emitSearchRequest(); | ||
286 | emit returnPressed(); | 289 | emit focusViewRequest(); | ||
287 | } | 290 | } | ||
288 | 291 | | |||
289 | void DolphinSearchBox::slotFacetChanged() | 292 | void DolphinSearchBox::slotFacetChanged() | ||
290 | { | 293 | { | ||
291 | m_startedSearching = true; | 294 | m_startedSearching = true; | ||
292 | m_startSearchTimer->stop(); | 295 | m_startSearchTimer->stop(); | ||
293 | emit searchRequest(); | 296 | emit searchRequest(); | ||
294 | } | 297 | } | ||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |
don't assert; instead check for m_view being valid, and if it isn't, just do nothing.