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());
|
mUI.mResults->CheckingStarted(p.fileSettings.size());
|
||||||
|
|
||||||
mThread->SetProject(p);
|
|
||||||
QDir inf(mCurrentDirectory);
|
QDir inf(mCurrentDirectory);
|
||||||
const QString checkPath = inf.canonicalPath();
|
const QString checkPath = inf.canonicalPath();
|
||||||
SetPath(SETTINGS_LAST_CHECK_PATH, checkPath);
|
SetPath(SETTINGS_LAST_CHECK_PATH, checkPath);
|
||||||
|
@ -384,10 +383,14 @@ void MainWindow::DoCheckProject(ImportProject p)
|
||||||
Settings checkSettings = GetCppcheckSettings();
|
Settings checkSettings = GetCppcheckSettings();
|
||||||
checkSettings.force = false;
|
checkSettings.force = false;
|
||||||
|
|
||||||
|
if (checkSettings.isWindowsPlatform())
|
||||||
|
p.ignoreOtherPlatforms(checkSettings.platformType);
|
||||||
|
|
||||||
if (mProject)
|
if (mProject)
|
||||||
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
|
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
|
||||||
|
|
||||||
//mThread->SetCheckProject(true);
|
//mThread->SetCheckProject(true);
|
||||||
|
mThread->SetProject(p);
|
||||||
mThread->Check(checkSettings, true);
|
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)
|
void ImportProject::FileSettings::setDefines(std::string defs)
|
||||||
{
|
{
|
||||||
while (defs.find(";%(") != std::string::npos) {
|
while (defs.find(";%(") != std::string::npos) {
|
||||||
|
|
|
@ -52,6 +52,7 @@ public:
|
||||||
std::list<FileSettings> fileSettings;
|
std::list<FileSettings> fileSettings;
|
||||||
|
|
||||||
void ignorePaths(std::vector<std::string> &ipaths);
|
void ignorePaths(std::vector<std::string> &ipaths);
|
||||||
|
void ignoreOtherPlatforms(cppcheck::Platform::PlatformType platformType);
|
||||||
|
|
||||||
void import(const std::string &filename);
|
void import(const std::string &filename);
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue