Skip to content

Commit 92c089d

Browse files
authored
fixed some "Parameter can be made pointer/reference to const" Rider warnings (#5680)
1 parent cd21918 commit 92c089d

8 files changed

Lines changed: 9 additions & 9 deletions

File tree

gui/codeeditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void CodeEditor::highlightErrorLine()
420420
setExtraSelections(extraSelections);
421421
}
422422

423-
void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
423+
void CodeEditor::lineNumberAreaPaintEvent(const QPaintEvent *event)
424424
{
425425
QPainter painter(mLineNumberArea);
426426
painter.fillRect(event->rect(), mWidgetStyle->lineNumBGColor);

gui/codeeditor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class CodeEditor : public QPlainTextEdit {
9191
CodeEditor &operator=(const CodeEditor &) = delete;
9292
~CodeEditor() override;
9393

94-
void lineNumberAreaPaintEvent(QPaintEvent *event);
94+
void lineNumberAreaPaintEvent(const QPaintEvent *event);
9595
int lineNumberAreaWidth();
9696
void setStyle(const CodeEditorStyle& newStyle);
9797

gui/cppchecklibrarydata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static CppcheckLibraryData::Markup loadMarkup(QXmlStreamReader &xmlReader)
453453
return markup;
454454
}
455455

456-
static CppcheckLibraryData::Entrypoint loadEntrypoint(QXmlStreamReader &xmlReader)
456+
static CppcheckLibraryData::Entrypoint loadEntrypoint(const QXmlStreamReader &xmlReader)
457457
{
458458
CppcheckLibraryData::Entrypoint entrypoint;
459459
entrypoint.name = xmlReader.attributes().value("name").toString();

gui/settingsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void SettingsDialog::saveSettingValues() const
214214
CodeEditorStyle::saveSettings(&settings, *mCurrentStyle);
215215
}
216216

217-
void SettingsDialog::saveCheckboxValue(QSettings *settings, QCheckBox *box,
217+
void SettingsDialog::saveCheckboxValue(QSettings *settings, const QCheckBox *box,
218218
const QString &name)
219219
{
220220
settings->setValue(name, checkStateToBool(box->checkState()));

gui/settingsdialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected slots:
185185
* @param box checkbox to save
186186
* @param name name for QSettings to store the value
187187
*/
188-
static void saveCheckboxValue(QSettings *settings, QCheckBox *box, const QString &name);
188+
static void saveCheckboxValue(QSettings *settings, const QCheckBox *box, const QString &name);
189189

190190
/**
191191
* @brief Convert bool to Qt::CheckState

tools/triage/mainwindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ bool MainWindow::unpackArchive(const QString &archiveName)
285285
return runProcess("tar", args);
286286
}
287287

288-
void MainWindow::showResult(QListWidgetItem *item)
288+
void MainWindow::showResult(const QListWidgetItem *item)
289289
{
290290
ui->statusBar->clearMessage();
291291
const bool local = item->text().startsWith(DACA2_PACKAGES);

tools/triage/mainwindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public slots:
4747
void loadFile();
4848
void loadFromClipboard();
4949
void filter(const QString& filter);
50-
void showResult(QListWidgetItem *item);
50+
void showResult(const QListWidgetItem *item);
5151
void refreshResults();
5252
void fileTreeFilter(const QString &str);
5353
void findInFilesClicked();

tools/triage/mainwindow.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
<sender>results</sender>
451451
<signal>itemDoubleClicked(QListWidgetItem*)</signal>
452452
<receiver>MainWindow</receiver>
453-
<slot>showResult(QListWidgetItem*)</slot>
453+
<slot>showResult(const QListWidgetItem*)</slot>
454454
<hints>
455455
<hint type="sourcelabel">
456456
<x>28</x>
@@ -481,7 +481,7 @@
481481
</connections>
482482
<slots>
483483
<slot>loadFile()</slot>
484-
<slot>showResult(QListWidgetItem*)</slot>
484+
<slot>showResult(const QListWidgetItem*)</slot>
485485
<slot>loadFromClipboard()</slot>
486486
<slot>filter(QString)</slot>
487487
<slot>refreshResults()</slot>

0 commit comments

Comments
 (0)