GUI: Only check current platform when checking sln/vcxproj file
This commit is contained in:
parent
9cced993aa
commit
fe2fa4d343
|
@ -373,7 +373,6 @@ void MainWindow::DoCheckProject(ImportProject p)
|
|||
|
||||
mUI.mResults->CheckingStarted(p.fileSettings.size());
|
||||
|
||||
mThread->SetProject(p);
|
||||
QDir inf(mCurrentDirectory);
|
||||
const QString checkPath = inf.canonicalPath();
|
||||
SetPath(SETTINGS_LAST_CHECK_PATH, checkPath);
|
||||
|
@ -384,10 +383,14 @@ void MainWindow::DoCheckProject(ImportProject p)
|
|||
Settings checkSettings = GetCppcheckSettings();
|
||||
checkSettings.force = false;
|
||||
|
||||
if (checkSettings.isWindowsPlatform())
|
||||
p.ignoreOtherPlatforms(checkSettings.platformType);
|
||||
|
||||
if (mProject)
|
||||
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
|
||||
|
||||
//mThread->SetCheckProject(true);
|
||||
mThread->SetProject(p);
|
||||
mThread->Check(checkSettings, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,16 @@ void ImportProject::ignorePaths(std::vector<std::string> &ipaths)
|
|||
}
|
||||
}
|
||||
|
||||
void ImportProject::ignoreOtherPlatforms(cppcheck::Platform::PlatformType platformType)
|
||||
{
|
||||
for (std::list<FileSettings>::iterator it = fileSettings.begin(); it != fileSettings.end();) {
|
||||
if (it->platformType != cppcheck::Platform::Unspecified && it->platformType != platformType)
|
||||
fileSettings.erase(it++);
|
||||
else
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
void ImportProject::FileSettings::setDefines(std::string defs)
|
||||
{
|
||||
while (defs.find(";%(") != std::string::npos) {
|
||||
|
|
|
@ -52,6 +52,7 @@ public:
|
|||
std::list<FileSettings> fileSettings;
|
||||
|
||||
void ignorePaths(std::vector<std::string> &ipaths);
|
||||
void ignoreOtherPlatforms(cppcheck::Platform::PlatformType platformType);
|
||||
|
||||
void import(const std::string &filename);
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue