diff --git a/assets/android/src/io/emeric/utils/QGpsUtils.java b/assets/android/src/io/emeric/utils/QGpsUtils.java index 4218d55..28054d9 100644 --- a/assets/android/src/io/emeric/utils/QGpsUtils.java +++ b/assets/android/src/io/emeric/utils/QGpsUtils.java @@ -66,7 +66,7 @@ public static boolean checkGpsEnabled(final Context context) { final int locationMode; try { - // This constant was deprecated in API level 28. + // This constant was deprecated in API level 28. locationMode = Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE); } catch (Settings.SettingNotFoundException e) { diff --git a/thirdparty/AppUtils/AppUtils.pri b/thirdparty/AppUtils/AppUtils.pri new file mode 100644 index 0000000..a0194f7 --- /dev/null +++ b/thirdparty/AppUtils/AppUtils.pri @@ -0,0 +1,107 @@ + +# Optional stuff (for macOS) +#CONFIG += UTILS_DOCK_ENABLED + +# Optional stuff (for iOS) +#CONFIG += UTILS_WIFI_ENABLED +#CONFIG += UTILS_NOTIFICATIONS_ENABLED + +# Generic utils +SOURCES += $${PWD}/utils_app.cpp \ + $${PWD}/utils_bits.cpp \ + $${PWD}/utils_clipboard.cpp \ + $${PWD}/utils_fpsmonitor.cpp \ + $${PWD}/utils_language.cpp \ + $${PWD}/utils_log.cpp \ + $${PWD}/utils_maths.cpp \ + $${PWD}/utils_screen.cpp \ + $${PWD}/utils_sysinfo.cpp \ + $${PWD}/utils_wifi.cpp + +HEADERS += $${PWD}/utils_app.h \ + $${PWD}/utils_bits.h \ + $${PWD}/utils_clipboard.h \ + $${PWD}/utils_fpsmonitor.h \ + $${PWD}/utils_language.h \ + $${PWD}/utils_log.h \ + $${PWD}/utils_maths.h \ + $${PWD}/utils_screen.h \ + $${PWD}/utils_sysinfo.h \ + $${PWD}/utils_versionchecker.h \ + $${PWD}/utils_wifi.h + +INCLUDEPATH += $${PWD} + +versionAtLeast(QT_VERSION, 6.6) { + QT += gui-private # to get RHI info +} + +# Linux OS utils +linux:!android { + QT += dbus + + SOURCES += $${PWD}/utils_os_linux.cpp + HEADERS += $${PWD}/utils_os_linux.h +} + +# macOS utils +macx { + LIBS += -framework IOKit + SOURCES += $${PWD}/utils_os_macos.mm + HEADERS += $${PWD}/utils_os_macos.h + + # macOS dock click handler (optional) + UTILS_DOCK_ENABLED { + DEFINES += UTILS_DOCK_ENABLED + LIBS += -framework AppKit + SOURCES += $${PWD}/utils_os_macos_dock.mm + HEADERS += $${PWD}/utils_os_macos_dock.h + } +} + +# Windows OS utils +win32 { + DEFINES += _USE_MATH_DEFINES + SOURCES += $${PWD}/utils_os_windows.cpp + HEADERS += $${PWD}/utils_os_windows.h +} + +# Android OS utils +android { + DEFINES += UTILS_NOTIFICATIONS_ENABLED UTILS_WIFI_ENABLED + + versionAtLeast(QT_VERSION, 6.0) { + QT += core-private + + SOURCES += $${PWD}/utils_os_android_qt6.cpp + HEADERS += $${PWD}/utils_os_android.h + } else { + QT += androidextras + + SOURCES += $${PWD}/utils_os_android_qt5.cpp + HEADERS += $${PWD}/utils_os_android.h + } +} + +# iOS utils +ios { + LIBS += -framework UIKit + SOURCES += $${PWD}/utils_os_ios.mm + HEADERS += $${PWD}/utils_os_ios.h + + # iOS notifications (optional) + UTILS_NOTIFICATIONS_ENABLED { + DEFINES += UTILS_NOTIFICATIONS_ENABLED + LIBS += -framework UserNotifications + SOURCES += $${PWD}/utils_os_ios_notif.mm + HEADERS += $${PWD}/utils_os_ios_notif.h + } + + # iOS WiFi SSID (optional) + UTILS_WIFI_ENABLED { + DEFINES += UTILS_WIFI_ENABLED + LIBS += -framework SystemConfiguration + SOURCES += $${PWD}/utils_os_ios_wifi.mm + HEADERS += $${PWD}/utils_os_ios_wifi.h + } +} diff --git a/thirdparty/AppUtils/CMakeLists.txt b/thirdparty/AppUtils/CMakeLists.txt index ae9b2f4..5564621 100644 --- a/thirdparty/AppUtils/CMakeLists.txt +++ b/thirdparty/AppUtils/CMakeLists.txt @@ -5,7 +5,10 @@ set(CMAKE_AUTOMOC ON) ################################################################################ +# Optional stuff (for macOS) #set(UTILS_DOCK_ENABLED true) + +# Optional stuff (for iOS) #set(UTILS_WIFI_ENABLED true) #set(UTILS_NOTIFICATIONS_ENABLED true) @@ -28,6 +31,8 @@ set(CORE_SOURCES utils_app.h utils_bits.cpp utils_bits.h + utils_clipboard.cpp + utils_clipboard.h utils_fpsmonitor.cpp utils_fpsmonitor.h utils_language.cpp diff --git a/thirdparty/AppUtils/utils_wifi.h b/thirdparty/AppUtils/utils_wifi.h index bce6c25..9d3afeb 100644 --- a/thirdparty/AppUtils/utils_wifi.h +++ b/thirdparty/AppUtils/utils_wifi.h @@ -43,10 +43,8 @@ class UtilsWiFi: public QObject Q_PROPERTY(bool permissionOS READ hasPermissionOS NOTIFY permissionsChanged) QString m_currentSSID; - QString getCurrentSSID() { return m_currentSSID; } bool m_permOS = false; - bool hasPermissionOS() const { return m_permOS; } void refreshWiFi_internal(); @@ -65,10 +63,12 @@ private slots: public: static UtilsWiFi *getInstance(); + Q_INVOKABLE void refreshWiFi(); + QString getCurrentSSID() { return m_currentSSID; } + Q_INVOKABLE bool checkLocationPermissions(); Q_INVOKABLE void requestLocationPermissions(); - - Q_INVOKABLE void refreshWiFi(); + bool hasPermissionOS() const { return m_permOS; } }; /* ************************************************************************** */ diff --git a/thirdparty/ComponentLibrary/CMakeLists.txt b/thirdparty/ComponentLibrary/CMakeLists.txt index 5c8bf45..a95bdfd 100644 --- a/thirdparty/ComponentLibrary/CMakeLists.txt +++ b/thirdparty/ComponentLibrary/CMakeLists.txt @@ -143,7 +143,7 @@ if (TARGET Qt::Location) maps/MapScale.qml ) else() - message(NOTICE "Skipping the mapping components from ComponentLibrary as Qt6::Location is not used.") + message(STATUS "Skipping the mapping components from ComponentLibrary as Qt6::Location is not used.") endif() list(APPEND MODULE_QML_FILES