Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Preferences: Incomplete version check in 2.3 and update #9709 #11229

Merged
merged 9 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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