fixed some "Parameter can be made pointer/reference to const" Rider warnings (#5516)

This commit is contained in:
Oliver Stöneberg 2023-10-06 09:57:16 +02:00 committed by GitHub
parent 903eccb336
commit 723ba16eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 10 deletions

View File

@ -248,7 +248,7 @@ bool ProjectFile::read(const QString &filename)
return projectTagFound;
}
void ProjectFile::readRootPath(QXmlStreamReader &reader)
void ProjectFile::readRootPath(const QXmlStreamReader &reader)
{
QXmlStreamAttributes attribs = reader.attributes();
QString name = attribs.value(QString(), CppcheckXml::RootPathNameAttrib).toString();

View File

@ -426,7 +426,7 @@ protected:
* @brief Read optional root path from XML.
* @param reader XML stream reader.
*/
void readRootPath(QXmlStreamReader &reader);
void readRootPath(const QXmlStreamReader &reader);
void readBuildDir(QXmlStreamReader &reader);

View File

@ -721,7 +721,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
}
}
void ResultsTree::startApplication(QStandardItem *target, int application)
void ResultsTree::startApplication(const QStandardItem *target, int application)
{
//If there are no applications specified, tell the user about it
if (mApplications->getApplicationCount() == 0) {
@ -1132,7 +1132,7 @@ void ResultsTree::quickStartApplication(const QModelIndex &index)
startApplication(mModel.itemFromIndex(index));
}
QString ResultsTree::getFilePath(QStandardItem *target, bool fullPath)
QString ResultsTree::getFilePath(const QStandardItem *target, bool fullPath)
{
if (target) {
// Make sure we are working with the first column

View File

@ -344,7 +344,7 @@ protected:
* @param application Index of the application to open with. Giving -1
* (default value) will open the default application.
*/
void startApplication(QStandardItem *target, int application = -1);
void startApplication(const QStandardItem *target, int application = -1);
/**
* @brief Helper function returning the filename/full path of the error tree item \a target.
@ -352,7 +352,7 @@ protected:
* @param target The error tree item containing the filename/full path
* @param fullPath Whether or not to retrieve the full path or only the filename.
*/
static QString getFilePath(QStandardItem *target, bool fullPath);
static QString getFilePath(const QStandardItem *target, bool fullPath);
/**
* @brief Context menu event (user right clicked on the tree)

View File

@ -194,7 +194,7 @@ void ThreadHandler::stop()
}
}
void ThreadHandler::initialize(ResultsView *view)
void ThreadHandler::initialize(const ResultsView *view)
{
connect(&mResults, &ThreadResult::progress,
view, &ResultsView::progress);

View File

@ -64,7 +64,7 @@ public:
*
* @param view View to show error results
*/
void initialize(ResultsView *view);
void initialize(const ResultsView *view);
/**
* @brief Load settings

View File

@ -196,7 +196,7 @@ QList<ErrorItem> XmlReportV2::read()
return errors;
}
ErrorItem XmlReportV2::readError(QXmlStreamReader *reader)
ErrorItem XmlReportV2::readError(const QXmlStreamReader *reader)
{
/*
Error example from the core program in xml

View File

@ -79,7 +79,7 @@ protected:
* @brief Read and parse error item from XML stream.
* @param reader XML stream reader to use.
*/
ErrorItem readError(QXmlStreamReader *reader);
ErrorItem readError(const QXmlStreamReader *reader);
private:
/**