diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 885e6feb4..61de1f863 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -358,31 +358,6 @@ void MainWindow::CheckDirectory() DoCheckFiles(SelectFilesToCheck(QFileDialog::DirectoryOnly)); } -bool MainWindow::GetCheckProject() -{ - // We have successfully loaded project earlier and use that project - if (mProject) - return true; - - if (!mCurrentDirectory.isEmpty()) - { - // Format project filename (directory name + .cppcheck) and load - // the project file if it is found. - QStringList parts = mCurrentDirectory.split("/"); - const QString filename = parts[parts.count() - 1] + ".cppcheck";; - const QString projfile = mCurrentDirectory + "/" + filename; - if (QFile::exists(projfile)) - { - qDebug() << "Opening project file: " << projfile; - mProject = new Project(); - mProject->SetFilename(projfile); - FormatAndSetTitle(tr("Project: ") + QString(" ") + filename); - return mProject->Open(); - } - } - return false; -} - void MainWindow::AddIncludeDirs(const QStringList &includeDirs, Settings &result) { QString dir; @@ -412,8 +387,8 @@ Settings MainWindow::GetCppcheckSettings() AddIncludeDirs(includes, result); } - bool projectRead = GetCheckProject(); - if (projectRead) + // If project file loaded, read settings from it + if (mProject) { ProjectFile *pfile = mProject->GetProjectFile(); QStringList dirs = pfile->GetIncludeDirs(); diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 62ed4d807..8ea309e84 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -321,15 +321,6 @@ protected: */ void DoCheckFiles(const QStringList &files); - /** - * @brief Check if we have a project for the checked directory. - * This method checks if there is open project for the directory. If no open - * project then we check if there is project file in the directory and load - * it. - * @return true if we have project, false if no project. - */ - bool GetCheckProject(); - /** * @brief Get our default cppcheck settings and read project file. *