fix: rename internal drag-drop MIME type to RFC 6838 form#1468
Conversation
The internal MIME identifier QtPass uses for drag-and-drop payloads was registered as "application/vnd+qtpass.dragAndDropInfoPasswordStore". The '+' in that form is reserved for structured-syntax suffixes (e.g. "application/atom+xml") in RFC 6838; the vendor-tree separator is '.'. Rename to "application/vnd.qtpass.dragAndDropInfoPasswordStore". Used in exactly 9 places, all inside QtPass: - src/storemodel.cpp: mimeTypes(), mimeData(), canDropMimeData() x2, parseDropData() - tests/auto/model/tst_storemodel.cpp: 4 assertions + makeMimeData() Internal-only identifier (drag/drop happens between QtPass widgets in the same process), so no compatibility break. Also rearrange the test include block — <memory> now sits with the C++ stdlib headers above the Qt headers, matching the stdlib-then-Qt-then-project convention used elsewhere. Build clean, 33/33 storemodel tests pass. Other CodeRabbit nits in tst_util.cpp (DF9 underscore, hoist ASSUMED_MAX_KEY_ID_LENGTH, ScopedUmask RAII) were re-evaluated and still skipped — same rationale as #1467. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR corrects the MIME type string used for StoreModel drag-and-drop from ChangesMIME Type Format Correction
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/auto/model/tst_storemodel.cpp`:
- Around line 104-105: Replace the bare QVERIFY(...) MIME-type existence checks
in tst_storemodel.cpp with QVERIFY2(...) so failures provide descriptive
messages: locate the assertions that call
QVERIFY(types.contains("application/vnd.qtpass.dragAndDropInfoPasswordStore"))
(and the similar one around lines 222-223) and change them to
QVERIFY2(types.contains(...), "<descriptive failure message indicating which
MIME type was expected and the actual contents>")—ensure each message names the
expected MIME string (e.g., "expected
application/vnd.qtpass.dragAndDropInfoPasswordStore in types") so test failures
are diagnosable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 468ab27c-f227-436c-9ab1-3df10589f011
📒 Files selected for processing (2)
src/storemodel.cpptests/auto/model/tst_storemodel.cpp
CodeRabbit nit on #1468 follow-up: bare QVERIFY() on the mimeTypes()/mimeData() assertions doesn't say which MIME string was expected if the test fails. Switch to QVERIFY2 with descriptive messages. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
CodeRabbit flagged that the internal drag-drop MIME identifier
`application/vnd+qtpass.dragAndDropInfoPasswordStore` is malformed per RFC 6838:
Scope
Internal-only identifier — drag/drop happens between QtPass widgets in the same process. No external compatibility concern.
9 occurrences renamed in lockstep:
Also moved `` to live with the C++ stdlib headers above the Qt headers, matching the stdlib-then-Qt-then-project convention.
Test plan
Other CodeRabbit nits in tst_util.cpp (re-evaluated, still skipped)
Same rationale as #1467.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests