Settings MainWindow::GetCppcheckSettings() { Settings result; bool projectRead = GetCheckProject(); if (projectRead) { ProjectFile *pfile = mProject->GetProjectFile(); QStringList dirs = pfile->GetIncludeDirs(); QString dir; foreach(dir, dirs) { QString incdir; if (!QDir::isAbsolutePath(dir)) incdir = mCurrentDirectory + "/"; incdir += dir; incdir = QDir::cleanPath(incdir); // include paths must end with '/' if (!incdir.endsWith("/")) incdir += "/"; result._includePaths.push_back(incdir.toStdString()); } QStringList defines = pfile->GetDefines(); QString define; foreach(define, defines) { if (!result.userDefines.empty()) result.userDefines += ";"; result.userDefines += define.toStdString(); } }
void StatsDialog::setProject(const Project& project) { ProjectFile *projectFile = project.GetProjectFile(); if (projectFile) { mUI.mProject->setText(projectFile->GetRootPath()); mUI.mPaths->setText(projectFile->GetCheckPaths().join(";")); mUI.mIncludePaths->setText(projectFile->GetIncludeDirs().join(";")); mUI.mDefines->setText(projectFile->GetDefines().join(";")); } else { mUI.mProject->setText(""); mUI.mPaths->setText(""); mUI.mIncludePaths->setText(""); mUI.mDefines->setText(""); } }