fixed some Clazy `level0` warnings (#5344)
Regarding the "normalized signatures" see https://github.com/KDE/clazy/blob/master/docs/checks/README-connect-not-normalized.md and https://doc.qt.io/qt-6/qmetaobject.html#normalizedSignature.
This commit is contained in:
parent
59c3bd22e6
commit
f91df64fec
|
@ -185,7 +185,7 @@ void ApplicationList::clear()
|
||||||
|
|
||||||
bool ApplicationList::checkAndAddApplication(const QString& appPath, const QString& name, const QString& parameters)
|
bool ApplicationList::checkAndAddApplication(const QString& appPath, const QString& name, const QString& parameters)
|
||||||
{
|
{
|
||||||
if (QFileInfo(appPath).exists() && QFileInfo(appPath).isExecutable()) {
|
if (QFileInfo::exists(appPath) && QFileInfo(appPath).isExecutable()) {
|
||||||
Application app;
|
Application app;
|
||||||
app.setName(name);
|
app.setName(name);
|
||||||
app.setPath("\"" + appPath + "\"");
|
app.setPath("\"" + appPath + "\"");
|
||||||
|
|
|
@ -172,38 +172,38 @@ StyleEditDialog::StyleEditDialog(const CodeEditorStyle& newStyle,
|
||||||
this, SLOT(setStyleDefaultLight()));
|
this, SLOT(setStyleDefaultLight()));
|
||||||
connect(mBtnDefaultDark, SIGNAL(clicked()),
|
connect(mBtnDefaultDark, SIGNAL(clicked()),
|
||||||
this, SLOT(setStyleDefaultDark()));
|
this, SLOT(setStyleDefaultDark()));
|
||||||
connect(mBtnWidgetColorFG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnWidgetColorFG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedWidgetFG(const QColor&)));
|
this, SLOT(colorChangedWidgetFG(QColor)));
|
||||||
connect(mBtnWidgetColorBG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnWidgetColorBG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedWidgetBG(const QColor&)));
|
this, SLOT(colorChangedWidgetBG(QColor)));
|
||||||
connect(mBtnHighlightBG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnHighlightBG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedHighlightBG(const QColor&)));
|
this, SLOT(colorChangedHighlightBG(QColor)));
|
||||||
connect(mBtnLineNumFG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnLineNumFG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedLineNumFG(const QColor&)));
|
this, SLOT(colorChangedLineNumFG(QColor)));
|
||||||
connect(mBtnLineNumBG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnLineNumBG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedLineNumBG(const QColor&)));
|
this, SLOT(colorChangedLineNumBG(QColor)));
|
||||||
connect(mBtnKeywordFG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnKeywordFG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedKeywordFG(const QColor&)));
|
this, SLOT(colorChangedKeywordFG(QColor)));
|
||||||
connect(mCBKeywordWeight, SIGNAL(weightChanged(const QFont::Weight&)),
|
connect(mCBKeywordWeight, SIGNAL(weightChanged(QFont::Weight)),
|
||||||
this, SLOT(weightChangedKeyword(const QFont::Weight&)));
|
this, SLOT(weightChangedKeyword(QFont::Weight)));
|
||||||
connect(mBtnClassFG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnClassFG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedClassFG(const QColor&)));
|
this, SLOT(colorChangedClassFG(QColor)));
|
||||||
connect(mCBClassWeight, SIGNAL(weightChanged(const QFont::Weight&)),
|
connect(mCBClassWeight, SIGNAL(weightChanged(QFont::Weight)),
|
||||||
this, SLOT(weightChangedClass(const QFont::Weight&)));
|
this, SLOT(weightChangedClass(QFont::Weight)));
|
||||||
connect(mBtnQuoteFG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnQuoteFG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedQuoteFG(const QColor&)));
|
this, SLOT(colorChangedQuoteFG(QColor)));
|
||||||
connect(mCBQuoteWeight, SIGNAL(weightChanged(const QFont::Weight&)),
|
connect(mCBQuoteWeight, SIGNAL(weightChanged(QFont::Weight)),
|
||||||
this, SLOT(weightChangedQuote(const QFont::Weight&)));
|
this, SLOT(weightChangedQuote(QFont::Weight)));
|
||||||
connect(mBtnCommentFG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnCommentFG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedCommentFG(const QColor&)));
|
this, SLOT(colorChangedCommentFG(QColor)));
|
||||||
connect(mCBCommentWeight, SIGNAL(weightChanged(const QFont::Weight&)),
|
connect(mCBCommentWeight, SIGNAL(weightChanged(QFont::Weight)),
|
||||||
this, SLOT(weightChangedComment(const QFont::Weight&)));
|
this, SLOT(weightChangedComment(QFont::Weight)));
|
||||||
connect(mBtnSymbolFG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnSymbolFG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedSymbolFG(const QColor&)));
|
this, SLOT(colorChangedSymbolFG(QColor)));
|
||||||
connect(mBtnSymbolBG, SIGNAL(colorChanged(const QColor&)),
|
connect(mBtnSymbolBG, SIGNAL(colorChanged(QColor)),
|
||||||
this, SLOT(colorChangedSymbolBG(const QColor&)));
|
this, SLOT(colorChangedSymbolBG(QColor)));
|
||||||
connect(mCBSymbolWeight, SIGNAL(weightChanged(const QFont::Weight&)),
|
connect(mCBSymbolWeight, SIGNAL(weightChanged(QFont::Weight)),
|
||||||
this, SLOT(weightChangedSymbol(const QFont::Weight&)));
|
this, SLOT(weightChangedSymbol(QFont::Weight)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void StyleEditDialog::updateControls()
|
void StyleEditDialog::updateControls()
|
||||||
|
|
|
@ -79,7 +79,7 @@ QString getDataDir()
|
||||||
if (!dataDir.isEmpty())
|
if (!dataDir.isEmpty())
|
||||||
return dataDir;
|
return dataDir;
|
||||||
const QString appPath = QFileInfo(QCoreApplication::applicationFilePath()).canonicalPath();
|
const QString appPath = QFileInfo(QCoreApplication::applicationFilePath()).canonicalPath();
|
||||||
if (QFileInfo(appPath + "/std.cfg").exists())
|
if (QFileInfo::exists(appPath + "/std.cfg"))
|
||||||
return appPath;
|
return appPath;
|
||||||
if (appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) > 0)
|
if (appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) > 0)
|
||||||
return appPath.left(appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) + 9);
|
return appPath.left(appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) + 9);
|
||||||
|
|
|
@ -66,7 +66,7 @@ static QString getHelpFile()
|
||||||
#endif
|
#endif
|
||||||
for (const QString &p: paths) {
|
for (const QString &p: paths) {
|
||||||
QString filename = p + "/online-help.qhc";
|
QString filename = p + "/online-help.qhc";
|
||||||
if (QFileInfo(filename).exists())
|
if (QFileInfo::exists(filename))
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
|
|
|
@ -137,7 +137,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
|
||||||
mLineEditFilter->setPlaceholderText(tr("Quick Filter:"));
|
mLineEditFilter->setPlaceholderText(tr("Quick Filter:"));
|
||||||
mLineEditFilter->setClearButtonEnabled(true);
|
mLineEditFilter->setClearButtonEnabled(true);
|
||||||
mUI->mToolBarFilter->addWidget(mLineEditFilter);
|
mUI->mToolBarFilter->addWidget(mLineEditFilter);
|
||||||
connect(mLineEditFilter, SIGNAL(textChanged(const QString&)), mFilterTimer, SLOT(start()));
|
connect(mLineEditFilter, SIGNAL(textChanged(QString)), mFilterTimer, SLOT(start()));
|
||||||
connect(mLineEditFilter, &QLineEdit::returnPressed, this, &MainWindow::filterResults);
|
connect(mLineEditFilter, &QLineEdit::returnPressed, this, &MainWindow::filterResults);
|
||||||
|
|
||||||
connect(mUI->mActionPrint, SIGNAL(triggered()), mUI->mResults, SLOT(print()));
|
connect(mUI->mActionPrint, SIGNAL(triggered()), mUI->mResults, SLOT(print()));
|
||||||
|
@ -610,14 +610,14 @@ void MainWindow::analyzeCode(const QString& code, const QString& filename)
|
||||||
// Initialize dummy ThreadResult as ErrorLogger
|
// Initialize dummy ThreadResult as ErrorLogger
|
||||||
ThreadResult result;
|
ThreadResult result;
|
||||||
result.setFiles(QStringList(filename));
|
result.setFiles(QStringList(filename));
|
||||||
connect(&result, SIGNAL(progress(int,const QString&)),
|
connect(&result, SIGNAL(progress(int,QString)),
|
||||||
mUI->mResults, SLOT(progress(int,const QString&)));
|
mUI->mResults, SLOT(progress(int,QString)));
|
||||||
connect(&result, SIGNAL(error(const ErrorItem&)),
|
connect(&result, SIGNAL(error(ErrorItem)),
|
||||||
mUI->mResults, SLOT(error(const ErrorItem&)));
|
mUI->mResults, SLOT(error(ErrorItem)));
|
||||||
connect(&result, SIGNAL(log(const QString&)),
|
connect(&result, SIGNAL(log(QString)),
|
||||||
mUI->mResults, SLOT(log(const QString&)));
|
mUI->mResults, SLOT(log(QString)));
|
||||||
connect(&result, SIGNAL(debugError(const ErrorItem&)),
|
connect(&result, SIGNAL(debugError(ErrorItem)),
|
||||||
mUI->mResults, SLOT(debugError(const ErrorItem&)));
|
mUI->mResults, SLOT(debugError(ErrorItem)));
|
||||||
|
|
||||||
// Create CppCheck instance
|
// Create CppCheck instance
|
||||||
CppCheck cppcheck(result, true, nullptr);
|
CppCheck cppcheck(result, true, nullptr);
|
||||||
|
@ -1649,7 +1649,7 @@ bool MainWindow::loadLastResults()
|
||||||
const QString &lastResults = getLastResults();
|
const QString &lastResults = getLastResults();
|
||||||
if (lastResults.isEmpty())
|
if (lastResults.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
if (!QFileInfo(lastResults).exists())
|
if (!QFileInfo::exists(lastResults))
|
||||||
return false;
|
return false;
|
||||||
mUI->mResults->readErrorsXml(lastResults);
|
mUI->mResults->readErrorsXml(lastResults);
|
||||||
mUI->mResults->setCheckDirectory(mSettings->value(SETTINGS_LAST_CHECK_PATH,QString()).toString());
|
mUI->mResults->setCheckDirectory(mSettings->value(SETTINGS_LAST_CHECK_PATH,QString()).toString());
|
||||||
|
@ -1916,7 +1916,7 @@ void MainWindow::updateMRUMenuItems()
|
||||||
// Do a sanity check - remove duplicates and non-existing projects
|
// Do a sanity check - remove duplicates and non-existing projects
|
||||||
int removed = projects.removeDuplicates();
|
int removed = projects.removeDuplicates();
|
||||||
for (int i = projects.size() - 1; i >= 0; i--) {
|
for (int i = projects.size() - 1; i >= 0; i--) {
|
||||||
if (!QFileInfo(projects[i]).exists()) {
|
if (!QFileInfo::exists(projects[i])) {
|
||||||
projects.removeAt(i);
|
projects.removeAt(i);
|
||||||
removed++;
|
removed++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -861,7 +861,7 @@ QString ResultsTree::askFileDir(const QString &file)
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
// User selected root path
|
// User selected root path
|
||||||
if (QFileInfo(dir + '/' + file).exists())
|
if (QFileInfo::exists(dir + '/' + file))
|
||||||
mCheckPath = dir;
|
mCheckPath = dir;
|
||||||
|
|
||||||
// user selected checked folder
|
// user selected checked folder
|
||||||
|
@ -870,7 +870,7 @@ QString ResultsTree::askFileDir(const QString &file)
|
||||||
QString folderName = file.mid(0, file.indexOf('/'));
|
QString folderName = file.mid(0, file.indexOf('/'));
|
||||||
if (dir.indexOf('/' + folderName + '/'))
|
if (dir.indexOf('/' + folderName + '/'))
|
||||||
dir = dir.mid(0, dir.lastIndexOf('/' + folderName + '/'));
|
dir = dir.mid(0, dir.lastIndexOf('/' + folderName + '/'));
|
||||||
if (QFileInfo(dir + '/' + file).exists())
|
if (QFileInfo::exists(dir + '/' + file))
|
||||||
mCheckPath = dir;
|
mCheckPath = dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1018,7 +1018,6 @@ void ResultsTree::suppressSelectedIds()
|
||||||
if (!mSelectionModel)
|
if (!mSelectionModel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QModelIndexList selectedRows = mSelectionModel->selectedRows();
|
|
||||||
QSet<QString> selectedIds;
|
QSet<QString> selectedIds;
|
||||||
for (QModelIndex index : mSelectionModel->selectedRows()) {
|
for (QModelIndex index : mSelectionModel->selectedRows()) {
|
||||||
QStandardItem *item = mModel.itemFromIndex(index);
|
QStandardItem *item = mModel.itemFromIndex(index);
|
||||||
|
|
|
@ -383,7 +383,7 @@ void ResultsView::readErrorsXml(const QString &filename)
|
||||||
QString dir;
|
QString dir;
|
||||||
if (!errors.isEmpty() && !errors[0].errorPath.isEmpty()) {
|
if (!errors.isEmpty() && !errors[0].errorPath.isEmpty()) {
|
||||||
QString relativePath = QFileInfo(filename).canonicalPath();
|
QString relativePath = QFileInfo(filename).canonicalPath();
|
||||||
if (QFileInfo(relativePath + '/' + errors[0].errorPath[0].file).exists())
|
if (QFileInfo::exists(relativePath + '/' + errors[0].errorPath[0].file))
|
||||||
dir = relativePath;
|
dir = relativePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ void ResultsView::updateDetails(const QModelIndex &index)
|
||||||
const int lineNumber = data["line"].toInt();
|
const int lineNumber = data["line"].toInt();
|
||||||
|
|
||||||
QString filepath = data["file"].toString();
|
QString filepath = data["file"].toString();
|
||||||
if (!QFileInfo(filepath).exists() && QFileInfo(mUI->mTree->getCheckDirectory() + '/' + filepath).exists())
|
if (!QFileInfo::exists(filepath) && QFileInfo::exists(mUI->mTree->getCheckDirectory() + '/' + filepath))
|
||||||
filepath = mUI->mTree->getCheckDirectory() + '/' + filepath;
|
filepath = mUI->mTree->getCheckDirectory() + '/' + filepath;
|
||||||
|
|
||||||
QStringList symbols;
|
QStringList symbols;
|
||||||
|
|
|
@ -92,7 +92,7 @@ SettingsDialog::SettingsDialog(ApplicationList *list,
|
||||||
mCurrentStyle = new CodeEditorStyle(CodeEditorStyle::loadSettings(&settings));
|
mCurrentStyle = new CodeEditorStyle(CodeEditorStyle::loadSettings(&settings));
|
||||||
manageStyleControls();
|
manageStyleControls();
|
||||||
|
|
||||||
connect(mUI->mEditPythonPath, SIGNAL(textEdited(const QString&)),
|
connect(mUI->mEditPythonPath, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(validateEditPythonPath()));
|
this, SLOT(validateEditPythonPath()));
|
||||||
|
|
||||||
connect(mUI->mButtons, &QDialogButtonBox::accepted, this, &SettingsDialog::ok);
|
connect(mUI->mButtons, &QDialogButtonBox::accepted, this, &SettingsDialog::ok);
|
||||||
|
|
Loading…
Reference in New Issue