Fixed bug with incorrect platform used for check if check is run from UI and platform settings is taken from xml file. (#1434)

This commit is contained in:
Alexander 2018-10-17 13:44:41 +03:00 committed by Daniel Marjamäki
parent 58d1de5814
commit ee2cea026a
1 changed files with 1 additions and 2 deletions

View File

@ -870,8 +870,7 @@ Settings MainWindow::getCppcheckSettings()
const QString platform = mProjectFile->getPlatform(); const QString platform = mProjectFile->getPlatform();
if (platform.endsWith(".xml")) { if (platform.endsWith(".xml")) {
const QString applicationFilePath = QCoreApplication::applicationFilePath(); const QString applicationFilePath = QCoreApplication::applicationFilePath();
const QString appPath = QFileInfo(applicationFilePath).canonicalPath(); result.loadPlatformFile(applicationFilePath.toStdString().c_str(), platform.toStdString());
result.loadPlatformFile(appPath.toStdString().c_str(), platform.toStdString());
} else { } else {
for (int i = cppcheck::Platform::Native; i <= cppcheck::Platform::Unix64; i++) { for (int i = cppcheck::Platform::Native; i <= cppcheck::Platform::Unix64; i++) {
const cppcheck::Platform::PlatformType p = (cppcheck::Platform::PlatformType)i; const cppcheck::Platform::PlatformType p = (cppcheck::Platform::PlatformType)i;