26 #include <QStandardItemModel>
28 #include <QStringList>
37 class QItemSelectionModel;
39 class QContextMenuEvent;
75 void clear(
const QString &filename);
121 void updateSettings(
bool showFullPath,
bool saveFullPath,
bool saveAllErrors,
bool showErrorId,
bool showInconclusive);
299 void currentChanged(
const QModelIndex ¤t,
const QModelIndex &previous)
override;
323 QString
stripPath(
const QString &path,
bool saving)
const;
355 static QString
getFilePath(
const QStandardItem *target,
bool fullPath);
378 bool childOfMessage);
444 QStandardItem *
ensureFileItem(
const QString &fullpath,
const QString &file0,
bool hide);
List of applications user has specified to open errors with.
A class containing error data for one error.
A class containing error data for one shown error line.
A base class for reports.
Cppcheck's results are shown in this tree.
void hideResult()
Slot for context menu item to hide the current error message.
bool mSaveFullPath
Should full path of files be saved.
void updateFromOldReport(const QString &filename)
Update items from old report (tag, sinceDate)
void treeSelectionChanged(const QModelIndex ¤t)
Signal for selection change in result tree.
static QString severityToIcon(Severity severity)
Convert a severity string to a icon filename.
void hideAllIdResult()
Slot for context menu item to hide all messages with the current message Id.
QString stripPath(const QString &path, bool saving) const
Removes checking directory from given path if mShowFullPath is false.
QString mFilter
A string used to filter the results for display.
void openContainingFolder()
Slot for context menu item to open the folder containing the current file.
void suppressSelectedIds()
Slot for context menu item to suppress all messages with the current message id.
QStandardItem * addBacktraceFiles(QStandardItem *parent, const ErrorLine &item, const bool hide, const QString &icon, bool childOfMessage)
Add a new error item beneath a file or a backtrace item beneath an error.
void tagSelectedItems(const QString &tag)
tag selected items
void showHiddenResults()
Function to show results that were previous hidden with HideResult()
void updateSettings(bool showFullPath, bool saveFullPath, bool saveAllErrors, bool showErrorId, bool showInconclusive)
Update tree settings.
void resultsHidden(bool hidden)
Signal that results have been hidden or shown.
void clearRecheckFile(const QString &filename)
Clear errors of a file selected for recheck.
void clear()
Clear all errors from the tree.
static QStandardItem * createCheckboxItem(bool checked)
Create new normal item.
void showClangResults(bool show)
Show/hide clang-tidy/clang-analyzer errors.
bool showIdColumn() const
Returns true if column "Id" is shown.
ShowTypes mShowSeverities
GUI severities.
static QStandardItem * createLineNumberItem(const QString &linenumber)
Create new line number item.
bool mVisibleErrors
Are there any visible errors.
void saveSettings() const
Save all settings Column widths.
static QString getFilePath(const QStandardItem *target, bool fullPath)
Helper function returning the filename/full path of the error tree item target.
bool hasVisibleResults() const
Check if there are any visible results in view.
void checkSelected(QStringList selectedItems)
Signal to perform selected files recheck.
void translate()
Change all visible texts language.
QSettings * mSettings
Program settings.
void loadSettings()
Load all settings Column widths.
void refreshTree()
Refresh tree by checking which of the items should be shown and which should be hidden.
bool addErrorItem(const ErrorItem &item)
Add a new item to the tree.
QStandardItemModel mModel
Item model for tree.
void filterResults(const QString &filter)
Function to filter the displayed list of errors.
void readErrorItem(const QStandardItem *error, ErrorItem *item) const
Convert GUI error item into data error item.
QString mCheckPath
Path we are currently checking.
bool mShowErrorId
true if optional column "Id" is shown
ApplicationList * mApplications
List of applications to open errors with.
void refreshFilePaths()
Hides/shows full file path on all error file items according to mShowFullPath.
ResultsTree(QWidget *parent=nullptr)
void suppressHash()
Slot for context menu item to suppress message with hash.
bool mShowFullPath
Should full path of files be shown (true) or relative (false)
QStandardItem * findFileItem(const QString &name) const
Finds a file item.
void saveResults(Report *report) const
Save results to a text stream.
QStandardItem * ensureFileItem(const QString &fullpath, const QString &file0, bool hide)
Ensures there's a item in the model for the specified file.
bool mSaveAllErrors
Save all errors (true) or only visible (false)
void recheckSelectedFiles()
Slot for rechecking selected files.
void suppressIds(QStringList ids)
Suppress Ids.
QStringList mHiddenMessageId
bool hasResults() const
Do we have results from check?
void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override
Slot for selection change in the results tree.
void startApplication(const QStandardItem *target, int application=-1)
Helper function to open an error within target with application*.
void initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler)
QString askFileDir(const QString &file)
Ask directory where file is located.
void saveErrors(Report *report, const QStandardItem *fileItem) const
Save all errors under specified item.
QItemSelectionModel * mSelectionModel
void showResults(ShowTypes::ShowType type, bool show)
Function to show/hide certain type of errors Refreshes the tree.
QStandardItem * mContextItem
Right clicked item (used by context menu slots)
static QStandardItem * createNormalItem(const QString &name)
Create new normal item.
void context(int application)
Slot for context menu item to open an error with specified application.
void keyPressEvent(QKeyEvent *event) override
void copy()
Slot for context menu item to copy selection to clipboard.
static QString severityToTranslatedString(Severity severity)
Convert Severity to translated string for GUI.
void showInconclusiveColumn(bool show)
Show optional column "Inconclusve".
void showCppcheckResults(bool show)
Show/hide cppcheck errors.
void setCheckDirectory(const QString &dir)
Set the directory we are checking.
void quickStartApplication(const QModelIndex &index)
Slot to quickstart an error with default application.
const QString & getCheckDirectory()
Get the directory we are checking.
void contextMenuEvent(QContextMenuEvent *e) override
Context menu event (user right clicked on the tree)
A class for different show types we have.
ShowType
Show types we have (i.e.
This class handles creating threadresult and starting threads.
Severity
enum class for severity.
@ error
Programming error.