Browse Source

Compatibilty Fixes for Windows build

Disabling translation unit for Qt versions < 5.15
Felix Turo 3 years ago
parent
commit
72edd66220
5 changed files with 978 additions and 9 deletions
  1. 14 8
      CMakeLists.txt
  2. 321 0
      l10n/openpilotlog_de.ts
  3. 321 0
      l10n/openpilotlog_en.ts
  4. 321 0
      l10n/openpilotlog_es.ts
  5. 1 1
      src/classes/astyle.cpp

+ 14 - 8
CMakeLists.txt

@@ -122,14 +122,20 @@ set(PROJECT_SOURCES
 # https://bugreports.qt.io/browse/QTBUG-76410
 # Before working on the translations themselves, check for updates and consider not updating for
 # every build due to danger of loss of translations...
-set(TS_FILES
-    l10n/openpilotlog_en.ts
-    l10n/openpilotlog_de.ts
-    l10n/openpilotlog_es.ts
-)
-set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "l10n")
-qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
-
+if (Qt5Widgets_FOUND)
+    if (Qt5Widgets_VERSION VERSION_LESS 5.15.0)
+        message("Translations are available for Qt5 version >= 5.15")
+    else()
+        message("Qt > 5.15 detected. Enabling translations.")
+        set(TS_FILES
+            l10n/openpilotlog_en.ts
+            l10n/openpilotlog_de.ts
+            l10n/openpilotlog_es.ts
+        )
+        set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "l10n")
+        qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
+    endif(Qt5Widgets_VERSION VERSION_LESS 5.15.0)
+endif(Qt5Widgets_FOUND)
 
 if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
     qt_add_executable(openPilotLog

File diff suppressed because it is too large
+ 321 - 0
l10n/openpilotlog_de.ts


File diff suppressed because it is too large
+ 321 - 0
l10n/openpilotlog_en.ts


File diff suppressed because it is too large
+ 321 - 0
l10n/openpilotlog_es.ts


+ 1 - 1
src/classes/astyle.cpp

@@ -51,7 +51,7 @@ void AStyle::setup()
         QFont font(ASettings::read(ASettings::Main::Font).toString());
         font.setPointSize(ASettings::read(ASettings::Main::FontSize).toUInt());
         qApp->setFont(font);
-        LOG << "Application Font set: " << font.toString().splitRef(',').first();
+        LOG << "Application Font set: " << font.toString().split(',').first();
     }
     // Set style, stylesheet or palette
     QString style_setting = ASettings::read(ASettings::Main::Style).toString();

Some files were not shown because too many files changed in this diff