diff --git a/CMakeLists.txt b/CMakeLists.txt index 296b8b856..6b3644bfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,6 +277,7 @@ set(INSTALL_PLUGINSSRV_DIR "${INSTALL_LIB_DIR}/pluginssrv") if(ANDROID) set(PLUGINS_PREFIX "sdrangel_plugins_") set(PLUGINSSRV_PREFIX "sdrangel_pluginssrv_") + set(ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/android/qt6 CACHE INTERNAL "") else() set(PLUGINS_PREFIX "") set(PLUGINSSRV_PREFIX "") @@ -428,7 +429,7 @@ elseif (WIN32) elseif(ANDROID) set(EXTERNAL_LIBRARY_FOLDER "${CMAKE_SOURCE_DIR}/external/android") - set(Boost_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/ndk_21_boost_1.72.0/include" CACHE INTERNAL "") + set(Boost_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/ndk_26b_boost_1.83.0/include" CACHE INTERNAL "") set(FFTW3F_FOUND ON CACHE INTERNAL "") set(FFTW3F_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/fftw-3/include" CACHE INTERNAL "") @@ -485,6 +486,14 @@ elseif(ANDROID) set(SWSCALE_INCLUDE_DIRS "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/include" CACHE INTERNAL "") set(SWSCALE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libswscale.so" CACHE INTERNAL "") + set(GGMORSE_FOUND ON CACHE INTERNAL "") + set(GGMORSE_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ggmorse/include/" CACHE INTERNAL "") + set(GGMORSE_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ggmorse/lib/static/libggmorse.a" CACHE INTERNAL "") + + set(FLAC_FOUND ON CACHE INTERNAL "") + set(FLAC_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/flac/include/" CACHE INTERNAL "") + set(FLAC_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/flac/lib/libFLAC.so" CACHE INTERNAL "") + set(LIBUSB_FOUND ON CACHE INTERNAL "") set(LIBUSB_INCLUDE_DIR "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/include/" CACHE INTERNAL "") set(LIBUSB_LIBRARIES "${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/lib/libusb1.0.so" CACHE INTERNAL "") @@ -507,11 +516,6 @@ elseif(ANDROID) if (ENABLE_QT6) set(ANDROID_EXTRA_LIBS - ${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6Charts_arm64-v8a.so - ${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6Concurrent_arm64-v8a.so - ${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6MultimediaWidgets_arm64-v8a.so - ${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6SerialPort_arm64-v8a.so - ${Qt6_DIR}/../../../android_arm64_v8a/lib/libQt6TextToSpeech_arm64-v8a.so ${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libssl_1_1.so ${EXTERNAL_LIBRARY_FOLDER}/android_openssl/latest/arm64/libcrypto_1_1.so ${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/ffmpeg/lib/libavcodec.so @@ -526,6 +530,7 @@ elseif(ANDROID) ${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/dsdcc/lib/libdsdcc.so ${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/lib/libunrooted_android.so ${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/libusb/lib/libusb1.0.so + ${EXTERNAL_LIBRARY_FOLDER}/${ANDROID_ABI}/flac/lib/libFLAC.so CACHE INTERNAL "" ) else() @@ -576,6 +581,7 @@ elseif(ANDROID) ${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/dsdcc/lib/libdsdcc.so ${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/libusb/lib/libunrooted_android.so ${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/libusb/lib/libusb1.0.so + ${EXTERNAL_LIBRARY_FOLDER}/arm64-v8a/flac/lib/libFLAC.so ${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavcodec.so ${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavdevice.so ${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/ffmpeg/lib/libavfilter.so @@ -588,6 +594,7 @@ elseif(ANDROID) ${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/dsdcc/lib/libdsdcc.so ${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/libusb/lib/libunrooted_android.so ${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/libusb/lib/libusb1.0.so + ${EXTERNAL_LIBRARY_FOLDER}/armeabi-v7a/flac/lib/libFLAC.so CACHE INTERNAL "" ) endif() @@ -650,8 +657,7 @@ if(ENABLE_QT6) MultimediaWidgets Positioning Charts - SerialPort - Core5Compat) + SerialPort) else() find_package(Qt5 5.15 REQUIRED COMPONENTS @@ -679,7 +685,8 @@ if (BUILD_GUI) QuickWidgets TextToSpeech Svg - SvgWidgets) + SvgWidgets + StateMachine) else() find_package(Qt5 REQUIRED COMPONENTS diff --git a/app/main.cpp b/app/main.cpp index 4421a4478..b79e7fe15 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -22,7 +22,6 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include #include #include @@ -48,10 +47,6 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *logger) { -/* - QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8")); - QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -*/ QCoreApplication::setOrganizationName(COMPANY); QCoreApplication::setApplicationName(APPLICATION_NAME); QCoreApplication::setApplicationVersion(SDRANGEL_VERSION); diff --git a/plugins/channelrx/demodpager/pagerdemodgui.cpp b/plugins/channelrx/demodpager/pagerdemodgui.cpp index 7d05b1a28..a561c3776 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.cpp +++ b/plugins/channelrx/demodpager/pagerdemodgui.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -433,15 +433,15 @@ void PagerDemodGUI::filterRow(int row) bool hidden = false; if (m_settings.m_filterAddress != "") { - QRegExp re(m_settings.m_filterAddress); + QRegularExpression re(QRegularExpression::anchoredPattern(m_settings.m_filterAddress)); QTableWidgetItem *fromItem = ui->messages->item(row, PagerDemodSettings::MESSAGE_COL_ADDRESS); - if (!re.exactMatch(fromItem->text())) { + QRegularExpressionMatch match = re.match(fromItem->text()); + if (!match.hasMatch()) { hidden = true; } } ui->messages->setRowHidden(row, hidden); } - void PagerDemodGUI::filter() { for (int i = 0; i < ui->messages->rowCount(); i++) { diff --git a/plugins/feature/antennatools/CMakeLists.txt b/plugins/feature/antennatools/CMakeLists.txt index 69cc6dd9d..117ad444f 100644 --- a/plugins/feature/antennatools/CMakeLists.txt +++ b/plugins/feature/antennatools/CMakeLists.txt @@ -41,11 +41,17 @@ else() set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) endif() -add_library(${TARGET_NAME} SHARED - ${antennatools_SOURCES} -) +if(NOT Qt6_FOUND) + add_library(${TARGET_NAME} ${antennatools_SOURCES}) +else() + qt_add_plugin(${TARGET_NAME} CLASS_NAME AntennaToolsPlugin ${antennatools_SOURCES}) +endif() -target_link_libraries(${TARGET_NAME} +if(NOT BUILD_SHARED_LIBS) + set_property(GLOBAL APPEND PROPERTY STATIC_PLUGINS_PROPERTY ${TARGET_NAME}) +endif() + +target_link_libraries(${TARGET_NAME} PRIVATE Qt::Core ${TARGET_LIB} sdrbase diff --git a/plugins/feature/limerfe/CMakeLists.txt b/plugins/feature/limerfe/CMakeLists.txt index 07a7e279b..f23c61f20 100644 --- a/plugins/feature/limerfe/CMakeLists.txt +++ b/plugins/feature/limerfe/CMakeLists.txt @@ -60,6 +60,9 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${TARGET_LIB_GUI} ${LIMESUITE_LIBRARY} ) +if(ANDROID) + target_link_libraries(${TARGET_NAME} PRIVATE ${LIBUSB_LIBRARIES} log) +endif() install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) diff --git a/plugins/feature/map/CMakeLists.txt b/plugins/feature/map/CMakeLists.txt index 45c5d9a1e..d93b6f2d0 100644 --- a/plugins/feature/map/CMakeLists.txt +++ b/plugins/feature/map/CMakeLists.txt @@ -91,7 +91,8 @@ if(NOT SERVER_MODE) set(TARGET_LIB ${TARGET_LIB} Qt::WebEngine Qt::WebEngineCore Qt::WebEngineWidgets) elseif(Qt${QT_DEFAULT_MAJOR_VERSION}WebEngineCore_FOUND) set(TARGET_LIB ${TARGET_LIB} Qt::SvgWidgets Qt::WebEngineCore Qt::WebEngineWidgets) - else() + elseif(Qt6_FOUND) + # Not on Qt5 Android? set(TARGET_LIB ${TARGET_LIB} Qt::SvgWidgets) endif() else() diff --git a/plugins/feature/map/mapsettings.cpp b/plugins/feature/map/mapsettings.cpp index 96aeecd7a..2f86d93f2 100644 --- a/plugins/feature/map/mapsettings.cpp +++ b/plugins/feature/map/mapsettings.cpp @@ -211,6 +211,7 @@ void MapSettings::resetToDefaults() m_displayfoF2 = false; m_displayRain = false; m_displayClouds = false; + m_displayRailways = false; m_displaySeaMarks = false; m_displayNASAGlobalImagery = false; m_nasaGlobalImageryIdentifier = ""; diff --git a/plugins/feature/pertester/pertesterworker.cpp b/plugins/feature/pertester/pertesterworker.cpp index 96319f8e5..72e3d8568 100644 --- a/plugins/feature/pertester/pertesterworker.cpp +++ b/plugins/feature/pertester/pertesterworker.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "util/ax25.h" @@ -205,11 +205,12 @@ void PERTesterWorker::rx() void PERTesterWorker::tx() { - QRegExp ax25Dst("^%\\{ax25\\.dst=([A-Za-z0-9-]+)\\}"); - QRegExp ax25Src("^%\\{ax25\\.src=([A-Za-z0-9-]+)\\}"); - QRegExp num("^%\\{num\\}"); - QRegExp data("^%\\{data=([0-9]+),([0-9]+)\\}"); - QRegExp hex("^(0x)?([0-9a-fA-F]?[0-9a-fA-F])"); + QRegularExpression ax25Dst("^%\\{ax25\\.dst=([A-Za-z0-9-]+)\\}"); + QRegularExpression ax25Src("^%\\{ax25\\.src=([A-Za-z0-9-]+)\\}"); + QRegularExpression num("^%\\{num\\}"); + QRegularExpression data("^%\\{data=([0-9]+),([0-9]+)\\}"); + QRegularExpression hex("^(0x)?([0-9a-fA-F]?[0-9a-fA-F])"); + QRegularExpressionMatch match; QByteArray bytes; int pos = 0; @@ -217,34 +218,34 @@ void PERTesterWorker::tx() { if (m_settings.m_packet[pos] == '%') { - if (ax25Dst.indexIn(m_settings.m_packet, pos, QRegExp::CaretAtOffset) != -1) + if ((match = ax25Dst.match(m_settings.m_packet, pos, QRegularExpression::NormalMatch, QRegularExpression::AnchoredMatchOption)).hasMatch()) { // AX.25 destination callsign & SSID - QString address = ax25Dst.capturedTexts()[1]; + QString address = match.captured(1); bytes.append(AX25Packet::encodeAddress(address)); - pos += ax25Dst.matchedLength(); + pos += match.capturedLength(); } - else if (ax25Src.indexIn(m_settings.m_packet, pos, QRegExp::CaretAtOffset) != -1) + else if ((match = ax25Src.match(m_settings.m_packet, pos, QRegularExpression::NormalMatch, QRegularExpression::AnchoredMatchOption)).hasMatch()) { // AX.25 source callsign & SSID - QString address = ax25Src.capturedTexts()[1]; + QString address = match.captured(1); bytes.append(AX25Packet::encodeAddress(address, 1)); - pos += ax25Src.matchedLength(); + pos += match.capturedLength(); } - else if (num.indexIn(m_settings.m_packet, pos, QRegExp::CaretAtOffset) != -1) + else if ((match = num.match(m_settings.m_packet, pos, QRegularExpression::NormalMatch, QRegularExpression::AnchoredMatchOption)).hasMatch()) { // Big endian packet number bytes.append((m_tx >> 24) & 0xff); bytes.append((m_tx >> 16) & 0xff); bytes.append((m_tx >> 8) & 0xff); bytes.append(m_tx & 0xff); - pos += num.matchedLength(); + pos += match.capturedLength(); } - else if (data.indexIn(m_settings.m_packet, pos, QRegExp::CaretAtOffset) != -1) + else if ((match = data.match(m_settings.m_packet, pos, QRegularExpression::NormalMatch, QRegularExpression::AnchoredMatchOption)).hasMatch()) { // Constrained random number of random bytes - int minBytes = data.capturedTexts()[1].toInt(); - int maxBytes = data.capturedTexts()[2].toInt(); + int minBytes = match.captured(1).toInt(); + int maxBytes = match.captured(2).toInt(); std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution<> distr0(minBytes, maxBytes); @@ -252,7 +253,7 @@ void PERTesterWorker::tx() int count = distr0(gen); for (int i = 0; i < count; i++) bytes.append(distr1(gen)); - pos += data.matchedLength(); + pos += match.capturedLength(); } else { @@ -278,12 +279,12 @@ void PERTesterWorker::tx() break; } } - else if (hex.indexIn(m_settings.m_packet, pos, QRegExp::CaretAtOffset) != -1) + else if ((match = hex.match(m_settings.m_packet, pos, QRegularExpression::NormalMatch, QRegularExpression::AnchoredMatchOption)).hasMatch()) { // Hex byte - int value = hex.capturedTexts()[2].toInt(nullptr, 16); + int value = match.captured(2).toInt(nullptr, 16); bytes.append(value); - pos += hex.matchedLength(); + pos += match.capturedLength(); } else if ((m_settings.m_packet[pos] == ' ') || (m_settings.m_packet[pos] == ',') || (m_settings.m_packet[pos] == ':')) { diff --git a/plugins/feature/satellitetracker/CMakeLists.txt b/plugins/feature/satellitetracker/CMakeLists.txt index 2c78453d8..aeb81e92e 100644 --- a/plugins/feature/satellitetracker/CMakeLists.txt +++ b/plugins/feature/satellitetracker/CMakeLists.txt @@ -82,9 +82,6 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${TARGET_LIB_GUI} ${SGP4_LIBRARIES} ) -if (Qt6_FOUND) - target_link_libraries(${TARGET_NAME} PRIVATE Qt::Core5Compat) -endif() install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) diff --git a/plugins/samplesource/CMakeLists.txt b/plugins/samplesource/CMakeLists.txt index 7f22bfca8..92cf8d85b 100644 --- a/plugins/samplesource/CMakeLists.txt +++ b/plugins/samplesource/CMakeLists.txt @@ -106,7 +106,7 @@ add_subdirectory(audioinput) add_subdirectory(kiwisdr) add_subdirectory(remotetcpinput) -if(ENABLE_AARONIARTSA) +if(ENABLE_AARONIARTSA AND NOT ANDROID) add_subdirectory(aaroniartsainput) else() message(STATUS "Not building aaroniartsainput (ENABLE_AARONIARTSA=${ENABLE_AARONIARTSA})") diff --git a/plugins/samplesource/androidsdrdriverinput/CMakeLists.txt b/plugins/samplesource/androidsdrdriverinput/CMakeLists.txt index 835450c80..de5b15d19 100644 --- a/plugins/samplesource/androidsdrdriverinput/CMakeLists.txt +++ b/plugins/samplesource/androidsdrdriverinput/CMakeLists.txt @@ -60,7 +60,7 @@ target_link_libraries(${TARGET_NAME} PRIVATE swagger ) if(NOT ENABLE_QT6 AND ANDROID) - target_link_libraries(${TARGET_NAME} Qt::AndroidExtras) + target_link_libraries(${TARGET_NAME} PRIVATE Qt::AndroidExtras) endif() install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) diff --git a/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinput.cpp b/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinput.cpp index f14b5b882..481d9d1b1 100644 --- a/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinput.cpp +++ b/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinput.cpp @@ -29,6 +29,7 @@ #include "SWGDeviceReport.h" #include "SWGAndroidSDRDriverInputReport.h" +#include "util/android.h" #include "util/simpleserializer.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" diff --git a/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinputtcphandler.h b/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinputtcphandler.h index b856f2d28..bba34ef28 100644 --- a/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinputtcphandler.h +++ b/plugins/samplesource/androidsdrdriverinput/androidsdrdriverinputtcphandler.h @@ -26,6 +26,7 @@ #include #include +#include "util/message.h" #include "util/messagequeue.h" #include "util/message.h" #include "androidsdrdriverinputsettings.h" diff --git a/plugins/samplesource/fileinput/fileinputworker.cpp b/plugins/samplesource/fileinput/fileinputworker.cpp index c6dcc2dae..4bf5d6772 100644 --- a/plugins/samplesource/fileinput/fileinputworker.cpp +++ b/plugins/samplesource/fileinput/fileinputworker.cpp @@ -19,6 +19,9 @@ #include #include #include +#ifdef ANDROID +#include +#endif #include "fileinputworker.h" #include "dsp/samplesinkfifo.h" diff --git a/plugins/samplesource/limesdrinput/CMakeLists.txt b/plugins/samplesource/limesdrinput/CMakeLists.txt index df8b00ed6..440f374ee 100644 --- a/plugins/samplesource/limesdrinput/CMakeLists.txt +++ b/plugins/samplesource/limesdrinput/CMakeLists.txt @@ -68,6 +68,9 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${LIMESUITE_LIBRARY} limesdrdevice ) +if(ANDROID) + target_link_libraries(${TARGET_NAME} PRIVATE ${LIBUSB_LIBRARIES} log) +endif() install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp index 61733d012..e8ecb8dad 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp @@ -128,7 +128,7 @@ bool RTLSDRInput::openDevice() qCritical("RTLSDRInput::openDevice: could not open USB device %s", qPrintable(m_deviceAPI->getSamplingDeviceSerial())); return false; } - if ((res = rtlsdr_open_fd(&m_dev, fd)) < 0) + if ((rtlsdr_open_fd(&m_dev, fd)) < 0) { qCritical("RTLSDRInput::openDevice: could not open RTLSDR: %s", strerror(errno)); return false; diff --git a/sdrbase/CMakeLists.txt b/sdrbase/CMakeLists.txt index bc66651f6..3748c3a89 100644 --- a/sdrbase/CMakeLists.txt +++ b/sdrbase/CMakeLists.txt @@ -702,7 +702,6 @@ if (LIBSIGMF_FOUND) endif() if (Qt6_FOUND) target_link_libraries(sdrbase - Qt::Core5Compat Qt::CorePrivate ) endif() diff --git a/sdrbase/dsp/wavfilerecord.cpp b/sdrbase/dsp/wavfilerecord.cpp index 18e2f8b12..b201f2c77 100644 --- a/sdrbase/dsp/wavfilerecord.cpp +++ b/sdrbase/dsp/wavfilerecord.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include "dsp/dspcommands.h" #include "util/message.h" @@ -472,16 +472,19 @@ void WavFileRecord::writeHeader(QFile& sampleFile, Header& header) bool WavFileRecord::getCenterFrequency(QString fileName, quint64& centerFrequency) { // Attempt to extract center frequency from filename - QRegExp freqkRE("(([0-9]+)kHz)"); - QRegExp freqRE("(([0-9]+)Hz)"); - if (freqkRE.indexIn(fileName)) + QRegularExpression freqkRE("(([0-9]+)kHz)"); + QRegularExpression freqRE("(([0-9]+)Hz)"); + QRegularExpressionMatch freqkREMatch = freqkRE.match(fileName); + QRegularExpressionMatch freqREMatch = freqRE.match(fileName); + + if (freqkREMatch.hasMatch()) { - centerFrequency = freqkRE.capturedTexts()[2].toLongLong() * 1000LL; + centerFrequency = freqkREMatch.capturedTexts()[2].toLongLong() * 1000LL; return true; } - else if (freqRE.indexIn(fileName)) + else if (freqREMatch.hasMatch()) { - centerFrequency = freqRE.capturedTexts()[2].toLongLong(); + centerFrequency = freqREMatch.capturedTexts()[2].toLongLong(); return true; } return false; @@ -490,17 +493,18 @@ bool WavFileRecord::getCenterFrequency(QString fileName, quint64& centerFrequenc bool WavFileRecord::getStartTime(QString fileName, QDateTime& startTime) { // Attempt to extract start time from filename - QRegExp dateTimeRE("([12][0-9][0-9][0-9]).?([01][0-9]).?([0-3][0-9]).?([0-2][0-9]).?([0-5][0-9]).?([0-5][0-9])"); - if (dateTimeRE.indexIn(fileName) != -1) + QRegularExpression dateTimeRE("([12][0-9][0-9][0-9]).?([01][0-9]).?([0-3][0-9]).?([0-2][0-9]).?([0-5][0-9]).?([0-5][0-9])"); + QRegularExpressionMatch match = dateTimeRE.match(fileName); + if (match.hasMatch()) { startTime = QDateTime(QDate( - dateTimeRE.capturedTexts()[1].toInt(), - dateTimeRE.capturedTexts()[2].toInt(), - dateTimeRE.capturedTexts()[3].toInt()), + match.capturedTexts()[1].toInt(), + match.capturedTexts()[2].toInt(), + match.capturedTexts()[3].toInt()), QTime( - dateTimeRE.capturedTexts()[4].toInt(), - dateTimeRE.capturedTexts()[5].toInt(), - dateTimeRE.capturedTexts()[6].toInt())); + match.capturedTexts()[4].toInt(), + match.capturedTexts()[5].toInt(), + match.capturedTexts()[6].toInt())); return true; } return false; diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index 4f59fa07c..de5109e49 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -81,7 +81,10 @@ void PluginManager::loadPluginsPart(const QString& pluginsSubDir) // on make install [PREFIX]/bin and [PREFIX]/lib/sdrangel #if defined(ANDROID) PluginsPath = QStringList({applicationDirPath}); - filter = QStringList({"libsdrangel_" + pluginsSubDir + "_*.so"}); + // Qt5 add_library gives libsdrangel_plugins_antennatools.so + // Qt6 qt_add_plugin gives libplugins__sdrangel_plugins_antennatools.so + // Assuming PLUGINS_PREFIX=sdrangel_plugins_ + filter = QStringList({"lib*sdrangel_" + pluginsSubDir + "_*.so"}); #else filter = QStringList({"*"}); PluginsPath << applicationDirPath + "/../" + LIB + "/sdrangel/" + pluginsSubDir; diff --git a/sdrbase/util/android.cpp b/sdrbase/util/android.cpp index 40f95d5b8..3e72ca855 100644 --- a/sdrbase/util/android.cpp +++ b/sdrbase/util/android.cpp @@ -95,6 +95,38 @@ void Android::moveTaskToBack() } } +void Android::acquireWakeLock() +{ + QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;"); + if (activity.isValid()) { + activity.callMethod("acquireWakeLock"); + } +} + +void Android::releaseWakeLock() +{ + QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;"); + if (activity.isValid()) { + activity.callMethod("releaseWakeLock"); + } +} + +void Android::acquireScreenLock() +{ + QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;"); + if (activity.isValid()) { + activity.callMethod("acquireScreenLock"); + } +} + +void Android::releaseScreenLock() +{ + QJniObject activity = QJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;"); + if (activity.isValid()) { + activity.callMethod("releaseScreenLock"); + } +} + #else // QT_VERSION #include diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index ebe0071d8..1b265f560 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -1143,7 +1143,7 @@ void LoadConfigurationFSM::restoreGeometry() m_mainWindow->m_workspaces[i]->adjustSubWindowsAfterRestore(); #ifdef ANDROID // On Android, workspaces seem to be restored to 0,20, rather than 0,0 - m_mainWindow->m_workspaces[i]->move(m_workspaces[i]->pos().x(), 0); + m_mainWindow->m_workspaces[i]->move(m_mainWindow->m_workspaces[i]->pos().x(), 0); // Need to call updateGeometry, otherwise sometimes the layout is corrupted m_mainWindow->m_workspaces[i]->updateGeometry(); #endif