From b766edb6afbb023c7f89b5ae40fed9fcc7e24556 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sat, 1 Oct 2022 12:36:48 +0300 Subject: [PATCH 1/2] [iOS] don't nest AI and scripting libs under subdirectories 3rd party signing tools may ignore such directory layout --- CMakeLists.txt | 10 ++++++++-- lib/VCMIDirs.cpp | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c918facbd..6993140dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -402,8 +402,14 @@ else() add_definitions(-DM_LIB_DIR="${CMAKE_INSTALL_PREFIX}/${LIB_DIR}") endif() -set(AI_LIB_DIR "${LIB_DIR}/AI") -set(SCRIPTING_LIB_DIR "${LIB_DIR}/scripting") +# iOS has flat libs directory structure +if(APPLE_IOS) + set(AI_LIB_DIR "${LIB_DIR}") + set(SCRIPTING_LIB_DIR "${LIB_DIR}") +else() + set(AI_LIB_DIR "${LIB_DIR}/AI") + set(SCRIPTING_LIB_DIR "${LIB_DIR}/scripting") +endif() ####################################### # Add subdirectories # diff --git a/lib/VCMIDirs.cpp b/lib/VCMIDirs.cpp index 86749fb17..d8f630da2 100644 --- a/lib/VCMIDirs.cpp +++ b/lib/VCMIDirs.cpp @@ -391,6 +391,7 @@ public: std::vector dataPaths() const override; bfs::path libraryPath() const override; + bfs::path fullLibraryPath(const std::string & desiredFolder, const std::string & baseLibName) const override; bfs::path binaryPath() const override; }; @@ -411,6 +412,12 @@ std::vector VCMIDirsIOS::dataPaths() const return paths; } +bfs::path VCMIDirsIOS::fullLibraryPath(const std::string & desiredFolder, const std::string & baseLibName) const +{ + // iOS has flat libs directory structure + return libraryPath() / libraryName(baseLibName); +} + bfs::path VCMIDirsIOS::libraryPath() const { return {iOS_utils::frameworksPath()}; } bfs::path VCMIDirsIOS::binaryPath() const { return {iOS_utils::bundlePath()}; } #elif defined(VCMI_MAC) From 796845d173e40242b03c59c50b86cae707439d12 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sat, 1 Oct 2022 12:37:23 +0300 Subject: [PATCH 2/2] [iOS] clear focus in launcher only when something has focus --- launcher/mainwindow_moc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/launcher/mainwindow_moc.cpp b/launcher/mainwindow_moc.cpp index 04b51018c..95d8be728 100644 --- a/launcher/mainwindow_moc.cpp +++ b/launcher/mainwindow_moc.cpp @@ -92,7 +92,8 @@ MainWindow::MainWindow(QWidget * parent) connect(ui->tabSelectList, &QListWidget::currentRowChanged, [this](int i) { #ifdef Q_OS_IOS - qApp->focusWidget()->clearFocus(); + if(auto widget = qApp->focusWidget()) + widget->clearFocus(); #endif ui->tabListWidget->setCurrentIndex(i); });