diff --git a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake index d94ed8af05..994aca31b4 100644 --- a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake +++ b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake @@ -24,11 +24,7 @@ macro(InitializeFreeCADBuildOptions) option(INSTALL_TO_SITEPACKAGES "If ON the freecad root namespace (python) is installed into python's site-packages" ON) option(INSTALL_PREFER_SYMLINKS "If ON then fc_copy_sources macro will create symlinks instead of copying files" OFF) option(OCCT_CMAKE_FALLBACK "disable usage of occt-config files" OFF) - if (WIN32 OR APPLE) - option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF) - else() - option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON) - endif() + option(FREECAD_USE_QT_DIALOGS "Use Qt's dialogs instead of the native one." OFF) # == Win32 is default behaviour use the LibPack copied in Source tree ========== if(MSVC) diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index 0b2d57427d..8791a8b745 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -1512,8 +1512,8 @@ if(FREECAD_USE_PCH) PROPERTIES SKIP_PRECOMPILE_HEADERS TRUE) endif(FREECAD_USE_PCH) -if (FREECAD_USE_QT_FILEDIALOG) - set_source_files_properties(FileDialog.cpp PROPERTIES COMPILE_FLAGS -DUSE_QT_FILEDIALOG) +if (FREECAD_USE_QT_DIALOGS) + set_source_files_properties(FileDialog.cpp PROPERTIES COMPILE_FLAGS -DUSE_QT_DIALOGS) endif() # Suppress some very long Eigen3 warnings of older versions and diff --git a/src/Gui/FileDialog.cpp b/src/Gui/FileDialog.cpp index 2970408871..4a320d7ddb 100644 --- a/src/Gui/FileDialog.cpp +++ b/src/Gui/FileDialog.cpp @@ -53,23 +53,28 @@ using namespace Gui; bool DialogOptions::dontUseNativeFileDialog() { -#if defined(USE_QT_FILEDIALOG) - bool notNativeDialog = true; +#if defined(USE_QT_DIALOGS) + constexpr bool notNativeDialog = true; #else - bool notNativeDialog = false; + constexpr bool notNativeDialog = false; #endif ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Dialog"); - notNativeDialog = group->GetBool("DontUseNativeDialog", notNativeDialog); - return notNativeDialog; + return group->GetBool("DontUseNativeDialog", notNativeDialog); } bool DialogOptions::dontUseNativeColorDialog() { +#if defined(USE_QT_DIALOGS) + constexpr bool notNativeDialog = true; +#else + constexpr bool notNativeDialog = false; +#endif + ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Dialog"); - return group->GetBool("DontUseNativeColorDialog", true); + return group->GetBool("DontUseNativeColorDialog", notNativeDialog); } /* TRANSLATOR Gui::FileDialog */