-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix #14011 (crash: GUI crash when trying to hide a result from xml file) #7985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
655edf3 to
5b3e23e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a GUI crash (issue #14011) when hiding results from XML files by replacing the QVariant-based data storage approach with a strongly-typed ResultItem class. The refactoring improves type safety and maintainability by using QSharedPointer<ErrorItem> instead of QVariantMap for storing error data in tree items.
Key changes:
- Introduced
ResultItemclass inheriting fromQStandardItemwith type-safe access to error data - Replaced all QVariantMap-based data storage and retrieval with direct ErrorItem access
- Removed unused
ShowTypeToSeverityandVariantToShowTypefunctions - Updated
ErrorItem::samecomparison logic to use hash comparison only when both items have hashes - Added comprehensive tests for multiline results and results in the same file
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| gui/resultitem.h | New ResultItem class with Type enum (file/message/note) and errorItem pointer |
| gui/resultitem.cpp | ResultItem constructor implementation |
| gui/resultstree.h | Updated method signatures to use ResultItem* instead of QStandardItem* |
| gui/resultstree.cpp | Major refactoring replacing QVariantMap with ResultItem, direct ErrorItem access |
| gui/resultsview.h | Changed updateDetails to accept ResultItem* instead of QModelIndex |
| gui/resultsview.cpp | Simplified updateDetails to access ErrorItem fields directly |
| gui/erroritem.h | Added helper methods (getMainLocIndex, getFile, isClangResult, filterMatch) and renamed sameCID to same |
| gui/erroritem.cpp | Updated ErrorItem::same comparison logic and toString format |
| gui/showtypes.h | Removed unused ShowTypeToSeverity and VariantToShowType declarations |
| gui/showtypes.cpp | Removed unused function implementations |
| gui/test/resultstree/testresultstree.h | Added test method declarations for multiline and same-file results |
| gui/test/resultstree/testresultstree.cpp | Implemented comprehensive tests for new functionality |
| gui/test/resultstree/CMakeLists.txt | Added resultitem.h and resultitem.cpp to build |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|



No description provided.