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

This commit is contained in:
Oliver Stöneberg 2023-11-20 07:23:45 +01:00 committed by GitHub
parent cd21918520
commit 92c089d4ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 9 deletions

View File

@ -420,7 +420,7 @@ void CodeEditor::highlightErrorLine()
setExtraSelections(extraSelections);
}
void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
void CodeEditor::lineNumberAreaPaintEvent(const QPaintEvent *event)
{
QPainter painter(mLineNumberArea);
painter.fillRect(event->rect(), mWidgetStyle->lineNumBGColor);

View File

@ -91,7 +91,7 @@ public:
CodeEditor &operator=(const CodeEditor &) = delete;
~CodeEditor() override;
void lineNumberAreaPaintEvent(QPaintEvent *event);
void lineNumberAreaPaintEvent(const QPaintEvent *event);
int lineNumberAreaWidth();
void setStyle(const CodeEditorStyle& newStyle);

View File

@ -453,7 +453,7 @@ static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
return markup;
}
static CppcheckLibraryData::Entrypoint loadEntrypoint(QXmlStreamReader &xmlReader)
static CppcheckLibraryData::Entrypoint loadEntrypoint(const QXmlStreamReader &xmlReader)
{
CppcheckLibraryData::Entrypoint entrypoint;
entrypoint.name = xmlReader.attributes().value("name").toString();

View File

@ -214,7 +214,7 @@ void SettingsDialog::saveSettingValues() const
CodeEditorStyle::saveSettings(&settings, *mCurrentStyle);
}
void SettingsDialog::saveCheckboxValue(QSettings *settings, QCheckBox *box,
void SettingsDialog::saveCheckboxValue(QSettings *settings, const QCheckBox *box,
const QString &name)
{
settings->setValue(name, checkStateToBool(box->checkState()));

View File

@ -185,7 +185,7 @@ protected:
* @param box checkbox to save
* @param name name for QSettings to store the value
*/
static void saveCheckboxValue(QSettings *settings, QCheckBox *box, const QString &name);
static void saveCheckboxValue(QSettings *settings, const QCheckBox *box, const QString &name);
/**
* @brief Convert bool to Qt::CheckState

View File

@ -285,7 +285,7 @@ bool MainWindow::unpackArchive(const QString &archiveName)
return runProcess("tar", args);
}
void MainWindow::showResult(QListWidgetItem *item)
void MainWindow::showResult(const QListWidgetItem *item)
{
ui->statusBar->clearMessage();
const bool local = item->text().startsWith(DACA2_PACKAGES);

View File

@ -47,7 +47,7 @@ public slots:
void loadFile();
void loadFromClipboard();
void filter(const QString& filter);
void showResult(QListWidgetItem *item);
void showResult(const QListWidgetItem *item);
void refreshResults();
void fileTreeFilter(const QString &str);
void findInFilesClicked();

View File

@ -450,7 +450,7 @@
<sender>results</sender>
<signal>itemDoubleClicked(QListWidgetItem*)</signal>
<receiver>MainWindow</receiver>
<slot>showResult(QListWidgetItem*)</slot>
<slot>showResult(const QListWidgetItem*)</slot>
<hints>
<hint type="sourcelabel">
<x>28</x>
@ -481,7 +481,7 @@
</connections>
<slots>
<slot>loadFile()</slot>
<slot>showResult(QListWidgetItem*)</slot>
<slot>showResult(const QListWidgetItem*)</slot>
<slot>loadFromClipboard()</slot>
<slot>filter(QString)</slot>
<slot>refreshResults()</slot>