diff --git a/gui/applicationlist.cpp b/gui/applicationlist.cpp index dde03718f..80efbddbb 100644 --- a/gui/applicationlist.cpp +++ b/gui/applicationlist.cpp @@ -185,7 +185,7 @@ void ApplicationList::clear() 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; app.setName(name); app.setPath("\"" + appPath + "\""); diff --git a/gui/codeeditstyledialog.cpp b/gui/codeeditstyledialog.cpp index 3b98a9282..fe159fc30 100644 --- a/gui/codeeditstyledialog.cpp +++ b/gui/codeeditstyledialog.cpp @@ -172,38 +172,38 @@ StyleEditDialog::StyleEditDialog(const CodeEditorStyle& newStyle, this, SLOT(setStyleDefaultLight())); connect(mBtnDefaultDark, SIGNAL(clicked()), this, SLOT(setStyleDefaultDark())); - connect(mBtnWidgetColorFG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedWidgetFG(const QColor&))); - connect(mBtnWidgetColorBG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedWidgetBG(const QColor&))); - connect(mBtnHighlightBG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedHighlightBG(const QColor&))); - connect(mBtnLineNumFG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedLineNumFG(const QColor&))); - connect(mBtnLineNumBG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedLineNumBG(const QColor&))); - connect(mBtnKeywordFG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedKeywordFG(const QColor&))); - connect(mCBKeywordWeight, SIGNAL(weightChanged(const QFont::Weight&)), - this, SLOT(weightChangedKeyword(const QFont::Weight&))); - connect(mBtnClassFG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedClassFG(const QColor&))); - connect(mCBClassWeight, SIGNAL(weightChanged(const QFont::Weight&)), - this, SLOT(weightChangedClass(const QFont::Weight&))); - connect(mBtnQuoteFG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedQuoteFG(const QColor&))); - connect(mCBQuoteWeight, SIGNAL(weightChanged(const QFont::Weight&)), - this, SLOT(weightChangedQuote(const QFont::Weight&))); - connect(mBtnCommentFG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedCommentFG(const QColor&))); - connect(mCBCommentWeight, SIGNAL(weightChanged(const QFont::Weight&)), - this, SLOT(weightChangedComment(const QFont::Weight&))); - connect(mBtnSymbolFG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedSymbolFG(const QColor&))); - connect(mBtnSymbolBG, SIGNAL(colorChanged(const QColor&)), - this, SLOT(colorChangedSymbolBG(const QColor&))); - connect(mCBSymbolWeight, SIGNAL(weightChanged(const QFont::Weight&)), - this, SLOT(weightChangedSymbol(const QFont::Weight&))); + connect(mBtnWidgetColorFG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedWidgetFG(QColor))); + connect(mBtnWidgetColorBG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedWidgetBG(QColor))); + connect(mBtnHighlightBG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedHighlightBG(QColor))); + connect(mBtnLineNumFG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedLineNumFG(QColor))); + connect(mBtnLineNumBG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedLineNumBG(QColor))); + connect(mBtnKeywordFG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedKeywordFG(QColor))); + connect(mCBKeywordWeight, SIGNAL(weightChanged(QFont::Weight)), + this, SLOT(weightChangedKeyword(QFont::Weight))); + connect(mBtnClassFG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedClassFG(QColor))); + connect(mCBClassWeight, SIGNAL(weightChanged(QFont::Weight)), + this, SLOT(weightChangedClass(QFont::Weight))); + connect(mBtnQuoteFG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedQuoteFG(QColor))); + connect(mCBQuoteWeight, SIGNAL(weightChanged(QFont::Weight)), + this, SLOT(weightChangedQuote(QFont::Weight))); + connect(mBtnCommentFG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedCommentFG(QColor))); + connect(mCBCommentWeight, SIGNAL(weightChanged(QFont::Weight)), + this, SLOT(weightChangedComment(QFont::Weight))); + connect(mBtnSymbolFG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedSymbolFG(QColor))); + connect(mBtnSymbolBG, SIGNAL(colorChanged(QColor)), + this, SLOT(colorChangedSymbolBG(QColor))); + connect(mCBSymbolWeight, SIGNAL(weightChanged(QFont::Weight)), + this, SLOT(weightChangedSymbol(QFont::Weight))); } void StyleEditDialog::updateControls() diff --git a/gui/common.cpp b/gui/common.cpp index 68b202178..a1547538d 100644 --- a/gui/common.cpp +++ b/gui/common.cpp @@ -79,7 +79,7 @@ QString getDataDir() if (!dataDir.isEmpty()) return dataDir; const QString appPath = QFileInfo(QCoreApplication::applicationFilePath()).canonicalPath(); - if (QFileInfo(appPath + "/std.cfg").exists()) + if (QFileInfo::exists(appPath + "/std.cfg")) return appPath; if (appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) > 0) return appPath.left(appPath.indexOf("/cppcheck/", 0, Qt::CaseInsensitive) + 9); diff --git a/gui/helpdialog.cpp b/gui/helpdialog.cpp index 80f7d900f..bb9e5d5f6 100644 --- a/gui/helpdialog.cpp +++ b/gui/helpdialog.cpp @@ -66,7 +66,7 @@ static QString getHelpFile() #endif for (const QString &p: paths) { QString filename = p + "/online-help.qhc"; - if (QFileInfo(filename).exists()) + if (QFileInfo::exists(filename)) return filename; } return QString(); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index fd5dc6dff..aa377098b 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -137,7 +137,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) : mLineEditFilter->setPlaceholderText(tr("Quick Filter:")); mLineEditFilter->setClearButtonEnabled(true); 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(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 ThreadResult result; result.setFiles(QStringList(filename)); - connect(&result, SIGNAL(progress(int,const QString&)), - mUI->mResults, SLOT(progress(int,const QString&))); - connect(&result, SIGNAL(error(const ErrorItem&)), - mUI->mResults, SLOT(error(const ErrorItem&))); - connect(&result, SIGNAL(log(const QString&)), - mUI->mResults, SLOT(log(const QString&))); - connect(&result, SIGNAL(debugError(const ErrorItem&)), - mUI->mResults, SLOT(debugError(const ErrorItem&))); + connect(&result, SIGNAL(progress(int,QString)), + mUI->mResults, SLOT(progress(int,QString))); + connect(&result, SIGNAL(error(ErrorItem)), + mUI->mResults, SLOT(error(ErrorItem))); + connect(&result, SIGNAL(log(QString)), + mUI->mResults, SLOT(log(QString))); + connect(&result, SIGNAL(debugError(ErrorItem)), + mUI->mResults, SLOT(debugError(ErrorItem))); // Create CppCheck instance CppCheck cppcheck(result, true, nullptr); @@ -1649,7 +1649,7 @@ bool MainWindow::loadLastResults() const QString &lastResults = getLastResults(); if (lastResults.isEmpty()) return false; - if (!QFileInfo(lastResults).exists()) + if (!QFileInfo::exists(lastResults)) return false; mUI->mResults->readErrorsXml(lastResults); 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 int removed = projects.removeDuplicates(); for (int i = projects.size() - 1; i >= 0; i--) { - if (!QFileInfo(projects[i]).exists()) { + if (!QFileInfo::exists(projects[i])) { projects.removeAt(i); removed++; } diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 946437f96..3870fd64c 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -861,7 +861,7 @@ QString ResultsTree::askFileDir(const QString &file) return QString(); // User selected root path - if (QFileInfo(dir + '/' + file).exists()) + if (QFileInfo::exists(dir + '/' + file)) mCheckPath = dir; // user selected checked folder @@ -870,7 +870,7 @@ QString ResultsTree::askFileDir(const QString &file) QString folderName = file.mid(0, file.indexOf('/')); if (dir.indexOf('/' + folderName + '/')) dir = dir.mid(0, dir.lastIndexOf('/' + folderName + '/')); - if (QFileInfo(dir + '/' + file).exists()) + if (QFileInfo::exists(dir + '/' + file)) mCheckPath = dir; } @@ -1018,7 +1018,6 @@ void ResultsTree::suppressSelectedIds() if (!mSelectionModel) return; - QModelIndexList selectedRows = mSelectionModel->selectedRows(); QSet selectedIds; for (QModelIndex index : mSelectionModel->selectedRows()) { QStandardItem *item = mModel.itemFromIndex(index); diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 6c57e8c15..b26d22be4 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -383,7 +383,7 @@ void ResultsView::readErrorsXml(const QString &filename) QString dir; if (!errors.isEmpty() && !errors[0].errorPath.isEmpty()) { 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; } @@ -432,7 +432,7 @@ void ResultsView::updateDetails(const QModelIndex &index) const int lineNumber = data["line"].toInt(); 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; QStringList symbols; diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 1e8d13a44..72569b9f9 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -92,7 +92,7 @@ SettingsDialog::SettingsDialog(ApplicationList *list, mCurrentStyle = new CodeEditorStyle(CodeEditorStyle::loadSettings(&settings)); manageStyleControls(); - connect(mUI->mEditPythonPath, SIGNAL(textEdited(const QString&)), + connect(mUI->mEditPythonPath, SIGNAL(textEdited(QString)), this, SLOT(validateEditPythonPath())); connect(mUI->mButtons, &QDialogButtonBox::accepted, this, &SettingsDialog::ok);