|
QtPass 2.0.0
Developer documentation
|
State machine for MainWindow's content-search (grep) mode. More...
#include <grepsearchcontroller.h>
Classes | |
| struct | FinishOutcome |
| Outcome of a search-completion transition. More... | |
Public Member Functions | |
| auto | inGrepMode () const -> bool |
| Whether content-search mode is currently active. | |
| void | enterGrepMode () |
| Enter content-search mode (search button toggled on). | |
| auto | leaveGrepMode () -> bool |
| Leave content-search mode (search button toggled off). | |
| void | clearGrepMode () |
| Drop the mode flag only, without touching busy/cancelled state. | |
| auto | beginSearch () -> bool |
| Begin a search for a non-empty query. | |
| auto | cancelSearch () -> bool |
| Cancel the current search (e.g. query cleared). | |
| auto | finishSearch () -> FinishOutcome |
| Record that a search finished and report required side effects. | |
Private Attributes | |
| bool | m_mode = false |
| Content-search mode active. | |
| bool | m_busy = false |
| A grep subprocess is in flight. | |
| bool | m_cancelled = false |
| Pending results should be discarded. | |
State machine for MainWindow's content-search (grep) mode.
Extracted from MainWindow, where the search state lived in three loose booleans (mode / busy / cancelled) poked from six different slots. This owns those flags behind intent-named transitions so the slots no longer introspect raw booleans; each transition returns what UI side effect the caller still has to perform (wait-cursor handling, discarding stale results). It holds no widgets — MainWindow keeps those and reacts to the returned outcomes.
Definition at line 24 of file grepsearchcontroller.h.
|
inline |
Begin a search for a non-empty query.
Definition at line 73 of file grepsearchcontroller.h.
|
inline |
Cancel the current search (e.g. query cleared).
Definition at line 86 of file grepsearchcontroller.h.
|
inline |
Drop the mode flag only, without touching busy/cancelled state.
Used when the panel is cleared and the search UI is reset in place.
Definition at line 67 of file grepsearchcontroller.h.
|
inline |
Enter content-search mode (search button toggled on).
Definition at line 43 of file grepsearchcontroller.h.
|
inline |
Record that a search finished and report required side effects.
Definition at line 100 of file grepsearchcontroller.h.
|
inline |
Whether content-search mode is currently active.
Definition at line 38 of file grepsearchcontroller.h.
|
inline |
Leave content-search mode (search button toggled off).
If a search was in flight it is marked cancelled so its pending results are discarded when they arrive.
Definition at line 52 of file grepsearchcontroller.h.
|
private |
A grep subprocess is in flight.
Definition at line 109 of file grepsearchcontroller.h.
|
private |
Pending results should be discarded.
Definition at line 110 of file grepsearchcontroller.h.
|
private |
Content-search mode active.
Definition at line 108 of file grepsearchcontroller.h.