Fix a few 'const reference' warnings by Cppcheck
This commit is contained in:
parent
697aee143f
commit
db6f4f4a3b
|
@ -321,7 +321,7 @@ void CheckThread::stop()
|
||||||
mCppcheck.terminate();
|
mCppcheck.terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckThread::parseAddonErrors(QString err, QString tool)
|
void CheckThread::parseAddonErrors(QString err, const QString &tool)
|
||||||
{
|
{
|
||||||
Q_UNUSED(tool);
|
Q_UNUSED(tool);
|
||||||
QTextStream in(&err, QIODevice::ReadOnly);
|
QTextStream in(&err, QIODevice::ReadOnly);
|
||||||
|
|
|
@ -144,7 +144,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
void runAddonsAndTools(const ImportProject::FileSettings *fileSettings, const QString &fileName);
|
void runAddonsAndTools(const ImportProject::FileSettings *fileSettings, const QString &fileName);
|
||||||
|
|
||||||
void parseAddonErrors(QString err, QString tool);
|
void parseAddonErrors(QString err, const QString &tool);
|
||||||
void parseClangErrors(const QString &tool, const QString &file0, QString err);
|
void parseClangErrors(const QString &tool, const QString &file0, QString err);
|
||||||
|
|
||||||
QStringList mFiles;
|
QStringList mFiles;
|
||||||
|
|
|
@ -137,7 +137,7 @@ static CppcheckLibraryData::Function::Arg loadFunctionArg(QXmlStreamReader &xmlR
|
||||||
return arg;
|
return arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CppcheckLibraryData::Function loadFunction(QXmlStreamReader &xmlReader, const QString comments)
|
static CppcheckLibraryData::Function loadFunction(QXmlStreamReader &xmlReader, const QString &comments)
|
||||||
{
|
{
|
||||||
CppcheckLibraryData::Function function;
|
CppcheckLibraryData::Function function;
|
||||||
function.comments = comments;
|
function.comments = comments;
|
||||||
|
@ -258,7 +258,7 @@ QString CppcheckLibraryData::open(QIODevice &file)
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void writeContainerFunctions(QXmlStreamWriter &xmlWriter, const QString name, int extra, const QList<struct CppcheckLibraryData::Container::Function> &functions)
|
static void writeContainerFunctions(QXmlStreamWriter &xmlWriter, const QString &name, int extra, const QList<struct CppcheckLibraryData::Container::Function> &functions)
|
||||||
{
|
{
|
||||||
if (functions.isEmpty() && extra < 0)
|
if (functions.isEmpty() && extra < 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -723,7 +723,7 @@ void MainWindow::addIncludeDirs(const QStringList &includeDirs, Settings &result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Library::Error MainWindow::loadLibrary(Library *library, QString filename)
|
Library::Error MainWindow::loadLibrary(Library *library, const QString &filename)
|
||||||
{
|
{
|
||||||
Library::Error ret;
|
Library::Error ret;
|
||||||
|
|
||||||
|
@ -1141,7 +1141,7 @@ void MainWindow::openResults()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadResults(const QString selectedFile)
|
void MainWindow::loadResults(const QString &selectedFile)
|
||||||
{
|
{
|
||||||
if (selectedFile.isEmpty())
|
if (selectedFile.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
@ -1156,7 +1156,7 @@ void MainWindow::loadResults(const QString selectedFile)
|
||||||
formatAndSetTitle(selectedFile);
|
formatAndSetTitle(selectedFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadResults(const QString selectedFile, const QString sourceDirectory)
|
void MainWindow::loadResults(const QString &selectedFile, const QString &sourceDirectory)
|
||||||
{
|
{
|
||||||
loadResults(selectedFile);
|
loadResults(selectedFile);
|
||||||
mUI.mResults->setCheckDirectory(sourceDirectory);
|
mUI.mResults->setCheckDirectory(sourceDirectory);
|
||||||
|
@ -1292,7 +1292,7 @@ void MainWindow::showAuthors()
|
||||||
dlg->exec();
|
dlg->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::performSelectedFilesCheck(QStringList selectedFilesList)
|
void MainWindow::performSelectedFilesCheck(const QStringList &selectedFilesList)
|
||||||
{
|
{
|
||||||
reAnalyzeSelected(selectedFilesList);
|
reAnalyzeSelected(selectedFilesList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ public slots:
|
||||||
* @brief Slot to reanalyze selected files
|
* @brief Slot to reanalyze selected files
|
||||||
* @param selectedFilesList list of selected files
|
* @param selectedFilesList list of selected files
|
||||||
*/
|
*/
|
||||||
void performSelectedFilesCheck(QStringList selectedFilesList);
|
void performSelectedFilesCheck(const QStringList &selectedFilesList);
|
||||||
|
|
||||||
/** @brief Slot to reanalyze modified files */
|
/** @brief Slot to reanalyze modified files */
|
||||||
void reAnalyzeModified();
|
void reAnalyzeModified();
|
||||||
|
@ -349,14 +349,14 @@ private:
|
||||||
* @brief Load XML file to the GUI.
|
* @brief Load XML file to the GUI.
|
||||||
* @param selectedFile Filename (inc. path) of XML file to load.
|
* @param selectedFile Filename (inc. path) of XML file to load.
|
||||||
*/
|
*/
|
||||||
void loadResults(const QString selectedFile);
|
void loadResults(const QString &selectedFile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Load XML file to the GUI.
|
* @brief Load XML file to the GUI.
|
||||||
* @param selectedFile Filename (inc. path) of XML file to load.
|
* @param selectedFile Filename (inc. path) of XML file to load.
|
||||||
* @param sourceDirectory Path to the directory that the results were generated for.
|
* @param sourceDirectory Path to the directory that the results were generated for.
|
||||||
*/
|
*/
|
||||||
void loadResults(const QString selectedFile, const QString sourceDirectory);
|
void loadResults(const QString &selectedFile, const QString &sourceDirectory);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Load last project results to the GUI.
|
* @brief Load last project results to the GUI.
|
||||||
|
@ -376,7 +376,7 @@ private:
|
||||||
* @param filename filename (no path)
|
* @param filename filename (no path)
|
||||||
* @return error code
|
* @return error code
|
||||||
*/
|
*/
|
||||||
Library::Error loadLibrary(Library *library, QString filename);
|
Library::Error loadLibrary(Library *library, const QString &filename);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Tries to load library file, prints message on error
|
* @brief Tries to load library file, prints message on error
|
||||||
|
|
|
@ -72,7 +72,7 @@ public:
|
||||||
*/
|
*/
|
||||||
void saveSettings(QSettings &settings) const;
|
void saveSettings(QSettings &settings) const;
|
||||||
|
|
||||||
void setAddonsAndTools(const QStringList &addonsAndTools, const QString misraFile) {
|
void setAddonsAndTools(const QStringList &addonsAndTools, const QString &misraFile) {
|
||||||
mAddonsAndTools = addonsAndTools;
|
mAddonsAndTools = addonsAndTools;
|
||||||
mMisraFile = misraFile;
|
mMisraFile = misraFile;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue