Skip to content

Conversation

@danmar
Copy link
Owner

@danmar danmar commented Nov 25, 2025

No description provided.

@danmar danmar self-assigned this Nov 25, 2025
@danmar danmar force-pushed the fix-14011 branch 2 times, most recently from 655edf3 to 5b3e23e Compare November 25, 2025 18:30
@danmar danmar marked this pull request as ready for review November 26, 2025 14:02
@danmar danmar requested a review from Copilot November 26, 2025 14:03
Copilot finished reviewing on behalf of danmar November 26, 2025 14:08
Copy link

Copilot AI left a 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 ResultItem class inheriting from QStandardItem with type-safe access to error data
  • Replaced all QVariantMap-based data storage and retrieval with direct ErrorItem access
  • Removed unused ShowTypeToSeverity and VariantToShowType functions
  • Updated ErrorItem::same comparison 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.

danmar and others added 6 commits November 26, 2025 18:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

@danmar danmar merged commit f077ec4 into danmar:main Nov 27, 2025
55 checks passed
@danmar danmar deleted the fix-14011 branch November 27, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant