Tweaks to use summaries in GUI
This commit is contained in:
parent
c9881bb445
commit
a493e17a6a
|
@ -901,7 +901,7 @@ int CppCheckExecutor::check_internal(CppCheck& cppcheck, int /*argc*/, const cha
|
|||
std::list<std::string> fileNames;
|
||||
for (std::map<std::string, std::size_t>::const_iterator i = mFiles.begin(); i != mFiles.end(); ++i)
|
||||
fileNames.emplace_back(i->first);
|
||||
AnalyzerInformation::writeFilesTxt(settings.buildDir, fileNames, settings.project.fileSettings);
|
||||
AnalyzerInformation::writeFilesTxt(settings.buildDir, fileNames, settings.userDefines, settings.project.fileSettings);
|
||||
}
|
||||
|
||||
unsigned int returnValue = 0;
|
||||
|
|
|
@ -444,8 +444,9 @@ void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLibrary, cons
|
|||
qDebug() << "Checking project file" << mProjectFile->getFilename();
|
||||
|
||||
if (!checkSettings.buildDir.empty()) {
|
||||
checkSettings.loadSummaries();
|
||||
std::list<std::string> sourcefiles;
|
||||
AnalyzerInformation::writeFilesTxt(checkSettings.buildDir, sourcefiles, p.fileSettings);
|
||||
AnalyzerInformation::writeFilesTxt(checkSettings.buildDir, sourcefiles, checkSettings.userDefines, p.fileSettings);
|
||||
}
|
||||
|
||||
//mThread->SetanalyzeProject(true);
|
||||
|
@ -510,10 +511,11 @@ void MainWindow::doAnalyzeFiles(const QStringList &files, const bool checkLibrar
|
|||
qDebug() << "Checking project file" << mProjectFile->getFilename();
|
||||
|
||||
if (!checkSettings.buildDir.empty()) {
|
||||
checkSettings.loadSummaries();
|
||||
std::list<std::string> sourcefiles;
|
||||
foreach (QString s, fileNames)
|
||||
sourcefiles.push_back(s.toStdString());
|
||||
AnalyzerInformation::writeFilesTxt(checkSettings.buildDir, sourcefiles, checkSettings.project.fileSettings);
|
||||
AnalyzerInformation::writeFilesTxt(checkSettings.buildDir, sourcefiles, checkSettings.userDefines, checkSettings.project.fileSettings);
|
||||
}
|
||||
|
||||
mThread->setCheckFiles(true);
|
||||
|
@ -1175,6 +1177,7 @@ void MainWindow::clearResults()
|
|||
if (mProjectFile && !mProjectFile->getBuildDir().isEmpty()) {
|
||||
QDir dir(QFileInfo(mProjectFile->getFilename()).absolutePath() + '/' + mProjectFile->getBuildDir());
|
||||
for (const QString& f: dir.entryList(QDir::Files)) {
|
||||
if (!f.endsWith("files.txt") && !QRegExp(".*.s[0-9]+$").exactMatch(f))
|
||||
dir.remove(f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ static std::string getFilename(const std::string &fullpath)
|
|||
return fullpath.substr(pos1,pos2);
|
||||
}
|
||||
|
||||
void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std::list<std::string> &sourcefiles, const std::list<ImportProject::FileSettings> &fileSettings)
|
||||
void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std::list<std::string> &sourcefiles, const std::string &userDefines, const std::list<ImportProject::FileSettings> &fileSettings)
|
||||
{
|
||||
std::map<std::string, unsigned int> fileCount;
|
||||
|
||||
|
@ -53,6 +53,8 @@ void AnalyzerInformation::writeFilesTxt(const std::string &buildDir, const std::
|
|||
for (const std::string &f : sourcefiles) {
|
||||
const std::string afile = getFilename(f);
|
||||
fout << afile << ".a" << (++fileCount[afile]) << "::" << Path::simplifyPath(Path::fromNativeSeparators(f)) << '\n';
|
||||
if (!userDefines.empty())
|
||||
fout << afile << ".a" << (++fileCount[afile]) << ":" << userDefines << ":" << Path::simplifyPath(Path::fromNativeSeparators(f)) << '\n';
|
||||
}
|
||||
|
||||
for (const ImportProject::FileSettings &fs : fileSettings) {
|
||||
|
|
|
@ -50,7 +50,7 @@ class CPPCHECKLIB AnalyzerInformation {
|
|||
public:
|
||||
~AnalyzerInformation();
|
||||
|
||||
static void writeFilesTxt(const std::string &buildDir, const std::list<std::string> &sourcefiles, const std::list<ImportProject::FileSettings> &fileSettings);
|
||||
static void writeFilesTxt(const std::string &buildDir, const std::list<std::string> &sourcefiles, const std::string &userDefines, const std::list<ImportProject::FileSettings> &fileSettings);
|
||||
|
||||
/** Close current TU.analyzerinfo file */
|
||||
void close();
|
||||
|
|
Loading…
Reference in New Issue