• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IJHack / QtPass / 24613312963

18 Apr 2026 08:32PM UTC coverage: 22.627% (+0.7%) from 21.908%
24613312963

push

github

web-flow
feat: implement pass grep content search (#109) (#1037)

* feat: implement pass grep content search (#109)

Add full content search (pass grep) for both RealPass and ImitatePass
backends, with a UI toggle button and results panel in the main window.

**RealPass** delegates to `pass grep [-i] <pattern>` and parses the
ANSI-coloured output: entry headers are identified by the `\x1B[94m`
blue-colour escape before stripping ANSI, giving reliable detection
regardless of locale.

**ImitatePass** runs a `QThread::create` background worker that
iterates every `.gpg` file under the store with `QDirIterator`,
decrypts each with `Executor::executeBlocking`, and applies a
`QRegularExpression` to the plaintext. Results are marshalled back
to the main thread via `QMetaObject::invokeMethod(Qt::QueuedConnection)`.
A `QPointer<ImitatePass>` guards against use-after-free if the object
is destroyed while the thread is running.

**UI changes**
- A checkable `grepButton` (QToolButton, `*`) sits next to the search
  field; toggling it switches between filename-filter mode and content-
  search mode and updates the placeholder text.
- `on_lineEdit_textChanged` skips the proxy-model filter in grep mode.
- `on_lineEdit_returnPressed` calls `Pass::Grep()` in grep mode.
- `onGrepFinished` populates a `QTreeWidget` (`grepResultsList`) with
  entry names as top-level items and matching lines as children.
- Clicking a result navigates the treeView to the corresponding entry
  and triggers the normal show-password flow.

Closes #109

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: address code review findings for pass grep feature

- enums.h: move PASS_OTP_GENERATE and PASS_GREP before the sentinel
  values PROCESS_COUNT/INVALID so the count remains correct
- pass.cpp: handle PASS_GREP exit code 1 (no matches) as empty results
  instead of routing through processErrorExit; exit codes > 1 are still
  errors
- realpass.cpp: add '--' before the search pattern so patt... (continued)

81 of 243 new or added lines in 7 files covered. (33.33%)

347 existing lines in 7 files now uncovered.

1304 of 5763 relevant lines covered (22.63%)

8.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.94
/src/moc_pass.cpp


Source Not Available

The file "src/moc_pass.cpp" isn't available on github. Either it's been removed, or the repo root directory needs to be updated.

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc