GUI: update whole program analysis
This commit is contained in:
parent
ea905c9a36
commit
6f2480fb4d
|
@ -25,7 +25,8 @@
|
|||
CheckThread::CheckThread(ThreadResult &result) :
|
||||
mState(Ready),
|
||||
mResult(result),
|
||||
mCppcheck(result, true)
|
||||
mCppcheck(result, true),
|
||||
mAnalyseWholeProgram(false)
|
||||
{
|
||||
//ctor
|
||||
}
|
||||
|
@ -45,6 +46,7 @@ void CheckThread::Check(const Settings &settings)
|
|||
void CheckThread::AnalyseWholeProgram(const QStringList &files)
|
||||
{
|
||||
mFiles = files;
|
||||
mAnalyseWholeProgram = true;
|
||||
start();
|
||||
}
|
||||
|
||||
|
@ -52,7 +54,8 @@ void CheckThread::run()
|
|||
{
|
||||
mState = Running;
|
||||
|
||||
if (!mFiles.isEmpty()) {
|
||||
if (!mFiles.isEmpty() || mAnalyseWholeProgram) {
|
||||
mAnalyseWholeProgram = false;
|
||||
qDebug() << "Whole program analysis";
|
||||
const std::string &buildDir = mCppcheck.settings().buildDir;
|
||||
if (!buildDir.empty()) {
|
||||
|
|
|
@ -100,6 +100,7 @@ protected:
|
|||
|
||||
private:
|
||||
QStringList mFiles;
|
||||
bool mAnalyseWholeProgram;
|
||||
};
|
||||
/// @}
|
||||
#endif // CHECKTHREAD_H
|
||||
|
|
|
@ -388,6 +388,11 @@ void MainWindow::DoCheckProject(ImportProject p)
|
|||
if (mProject)
|
||||
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
|
||||
|
||||
if (!checkSettings.buildDir.empty()) {
|
||||
std::list<std::string> sourcefiles;
|
||||
AnalyzerInformation::writeFilesTxt(checkSettings.buildDir, sourcefiles, p.fileSettings);
|
||||
}
|
||||
|
||||
//mThread->SetCheckProject(true);
|
||||
mThread->SetProject(p);
|
||||
mThread->Check(checkSettings, true);
|
||||
|
@ -439,17 +444,10 @@ void MainWindow::DoCheckFiles(const QStringList &files)
|
|||
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
|
||||
|
||||
if (!checkSettings.buildDir.empty()) {
|
||||
QString s = QString::fromStdString(checkSettings.buildDir);
|
||||
if (!s.endsWith('/'))
|
||||
s += '/';
|
||||
s += "files.txt";
|
||||
|
||||
std::ofstream fout(s.toStdString());
|
||||
if (fout.is_open()) {
|
||||
foreach (QString f, fileNames) {
|
||||
fout << f.toStdString() << '\n';
|
||||
}
|
||||
}
|
||||
std::list<std::string> sourcefiles;
|
||||
foreach (QString s, fileNames)
|
||||
sourcefiles.push_back(s.toStdString());
|
||||
AnalyzerInformation::writeFilesTxt(checkSettings.buildDir, sourcefiles, checkSettings.project.fileSettings);
|
||||
}
|
||||
|
||||
mThread->SetCheckFiles(true);
|
||||
|
|
Loading…
Reference in New Issue