From f7be03fcbc14a44b0f0f51fc4938f5376dd9af3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 12 Apr 2019 11:52:28 +0200 Subject: [PATCH] GUI: removed -std=posix and added -std=c++17 --- gui/common.h | 2 +- gui/mainwindow.cpp | 18 ++++++++++-------- gui/mainwindow.ui | 12 ++++++++++-- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/gui/common.h b/gui/common.h index 8eb6e665a..e428c8f74 100644 --- a/gui/common.h +++ b/gui/common.h @@ -62,10 +62,10 @@ #define SETTINGS_STD_CPP03 "Platform CPP03" #define SETTINGS_STD_CPP11 "Platform CPP11" #define SETTINGS_STD_CPP14 "Platform CPP14" +#define SETTINGS_STD_CPP17 "Platform CPP17" #define SETTINGS_STD_C89 "Platform C89" #define SETTINGS_STD_C99 "Platform C99" #define SETTINGS_STD_C11 "Platform C11" -#define SETTINGS_STD_POSIX "Platform Posix" // Language enforcement #define SETTINGS_ENFORCED_LANGUAGE "Enforced language" diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index cab500312..7e1aa6f67 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -207,6 +207,7 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) : mUI.mActionCpp03->setActionGroup(mCppStandardActions); mUI.mActionCpp11->setActionGroup(mCppStandardActions); mUI.mActionCpp14->setActionGroup(mCppStandardActions); + mUI.mActionCpp17->setActionGroup(mCppStandardActions); mUI.mActionEnforceC->setActionGroup(mSelectLanguageActions); mUI.mActionEnforceCpp->setActionGroup(mSelectLanguageActions); @@ -283,18 +284,18 @@ void MainWindow::loadSettings() const bool stdCpp03 = mSettings->value(SETTINGS_STD_CPP03, false).toBool(); mUI.mActionCpp03->setChecked(stdCpp03); - const bool stdCpp11 = mSettings->value(SETTINGS_STD_CPP11, true).toBool(); + const bool stdCpp11 = mSettings->value(SETTINGS_STD_CPP11, false).toBool(); mUI.mActionCpp11->setChecked(stdCpp11 && !stdCpp03); - const bool stdCpp14 = mSettings->value(SETTINGS_STD_CPP14, true).toBool(); + const bool stdCpp14 = mSettings->value(SETTINGS_STD_CPP14, false).toBool(); mUI.mActionCpp14->setChecked(stdCpp14 && !stdCpp03 && !stdCpp11); + const bool stdCpp17 = mSettings->value(SETTINGS_STD_CPP17, true).toBool(); + mUI.mActionCpp17->setChecked(stdCpp17 && !stdCpp03 && !stdCpp11 && !stdCpp14); const bool stdC89 = mSettings->value(SETTINGS_STD_C89, false).toBool(); mUI.mActionC89->setChecked(stdC89); const bool stdC11 = mSettings->value(SETTINGS_STD_C11, false).toBool(); mUI.mActionC11->setChecked(stdC11); const bool stdC99 = mSettings->value(SETTINGS_STD_C99, true).toBool(); mUI.mActionC99->setChecked(stdC99 || (!stdC89 && !stdC11)); - const bool stdPosix = mSettings->value(SETTINGS_STD_POSIX, false).toBool(); - mUI.mActionPosix->setChecked(stdPosix); // Main window settings const bool showMainToolbar = mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool(); @@ -361,10 +362,10 @@ void MainWindow::saveSettings() const mSettings->setValue(SETTINGS_STD_CPP03, mUI.mActionCpp03->isChecked()); mSettings->setValue(SETTINGS_STD_CPP11, mUI.mActionCpp11->isChecked()); mSettings->setValue(SETTINGS_STD_CPP14, mUI.mActionCpp14->isChecked()); + mSettings->setValue(SETTINGS_STD_CPP17, mUI.mActionCpp17->isChecked()); mSettings->setValue(SETTINGS_STD_C89, mUI.mActionC89->isChecked()); mSettings->setValue(SETTINGS_STD_C99, mUI.mActionC99->isChecked()); mSettings->setValue(SETTINGS_STD_C11, mUI.mActionC11->isChecked()); - mSettings->setValue(SETTINGS_STD_POSIX, mUI.mActionPosix->isChecked()); // Main window settings mSettings->setValue(SETTINGS_TOOLBARS_MAIN_SHOW, mUI.mToolBarMain->isVisible()); @@ -829,7 +830,7 @@ Settings MainWindow::getCppcheckSettings() const bool std = tryLoadLibrary(&result.library, "std.cfg"); bool posix = true; - if (result.standards.posix) + if (result.posix()) posix = tryLoadLibrary(&result.library, "posix.cfg"); bool windows = true; if (result.isWindowsPlatform()) @@ -929,10 +930,11 @@ Settings MainWindow::getCppcheckSettings() result.standards.cpp = Standards::CPP03; else if (mSettings->value(SETTINGS_STD_CPP11, false).toBool()) result.standards.cpp = Standards::CPP11; - else if (mSettings->value(SETTINGS_STD_CPP14, true).toBool()) + else if (mSettings->value(SETTINGS_STD_CPP14, false).toBool()) result.standards.cpp = Standards::CPP14; + else if (mSettings->value(SETTINGS_STD_CPP17, true).toBool()) + result.standards.cpp = Standards::CPP17; result.standards.c = mSettings->value(SETTINGS_STD_C99, true).toBool() ? Standards::C99 : (mSettings->value(SETTINGS_STD_C11, false).toBool() ? Standards::C11 : Standards::C89); - result.standards.posix = mSettings->value(SETTINGS_STD_POSIX, false).toBool(); result.enforcedLang = (Settings::Language)mSettings->value(SETTINGS_ENFORCED_LANGUAGE, 0).toInt(); if (result.jobs <= 1) { diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index d61869952..ca0c47c89 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -62,7 +62,7 @@ 0 0 640 - 25 + 28 @@ -137,6 +137,7 @@ + @@ -156,7 +157,6 @@ - @@ -811,6 +811,14 @@ Check configuration (defines, includes) + + + true + + + C++17 + +