Skip to content

Commit

Permalink
Merge pull request #11229 from CaptainSifff/2.3
Browse files Browse the repository at this point in the history
 Fix: Preferences: Incomplete version check in 2.3 and update #9709
  • Loading branch information
daschuer authored Jan 30, 2023
2 parents d02fdc0 + 6248bb5 commit 7e4b25d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ if(MSVC)
add_compile_options(/UTF8)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# Target architecture is x64 -> x64 has alsways SSE and SSE2 instruction sets
message(STATUS "x64 Enabling SS2 CPU optimizations (>= Pentium 4)")
message(STATUS "x64 Enabling SSE2 CPU optimizations (>= Pentium 4)")
# Define gcc/clang style defines for SSE and SSE2 for compatibility
add_compile_definitions("__SSE__" "__SSE2__")
endif()
Expand Down Expand Up @@ -283,7 +283,7 @@ if(MSVC)
if(OPTIMIZE STREQUAL "portable")
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
# Target architecture is x86 with SSE and SSE2
message(STATUS "x86 Enabling SS2 CPU optimizations (>= Pentium 4)")
message(STATUS "x86 Enabling SSE2 CPU optimizations (>= Pentium 4)")
# Define gcc/clang style defines for SSE and SSE2 for compatibility
add_compile_definitions("__SSE__" "__SSE2__")
# Set compiler option for SSE/SSE2
Expand All @@ -293,7 +293,7 @@ if(MSVC)
message("Enabling optimizations for native system, specified by user")
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
# Target architecture is x86 with SSE and SSE2
message(STATUS "x86 Enabling SS2 CPU optimizations (>= Pentium 4)")
message(STATUS "x86 Enabling SSE2 CPU optimizations (>= Pentium 4)")
# Define gcc/clang style defines for SSE and SSE2 for compatibility
add_compile_definitions("__SSE__" "__SSE2__")
endif()
Expand Down Expand Up @@ -355,7 +355,7 @@ elseif(GNU_GCC OR LLVM_CLANG)
if(OPTIMIZE STREQUAL "portable")
# portable: sse2 CPU (>= Pentium 4)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3456]86|x86|x64|x86_64|AMD64)$")
message(STATUS "Enabling SS2 CPU optimizations (>= Pentium 4)")
message(STATUS "Enabling SSE2 CPU optimizations (>= Pentium 4)")
add_compile_options(-mtune=generic)
# -mtune=generic picks the most common, but compatible options.
# on arm platforms equivalent to -march=arch
Expand Down
9 changes: 6 additions & 3 deletions src/preferences/upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <QPushButton>
#include <QScopedPointer>
#include <QTranslator>
#include <QVersionNumber>

#include "config.h"
#include "controllers/defs_controllers.h"
Expand Down Expand Up @@ -431,9 +432,11 @@ UserSettingsPointer Upgrade::versionUpgrade(const QString& settingsPath) {
}
}

if (configVersion.startsWith("1.12") ||
configVersion.startsWith("2.0") ||
configVersion.startsWith("2.1.0")) {
const auto configFileVersion = QVersionNumber::fromString(configVersion);

// This variable indicates the first known version that requires no changes.
const QVersionNumber cleanVersion(1, 12, 0);
if (configFileVersion >= cleanVersion) {
// No special upgrade required, just update the value.
configVersion = VersionStore::version();
config->set(ConfigKey("[Config]", "Version"), ConfigValue(VersionStore::version()));
Expand Down

0 comments on commit 7e4b25d

Please sign in to comment.