From 59a261a5bec3a6162ae0e6fbcbec60e25b65dfd5 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 2 Sep 2022 00:20:26 +0200 Subject: [PATCH] main: Add Frameworks to library paths for macOS --- src/main.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fb52ec6bf..33f9a61dd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -192,9 +192,20 @@ int main(int argc, char *argv[]) { QGuiApplication::setWindowIcon(IconLoader::Load("strawberry")); -#if defined(USE_BUNDLE) && (defined(Q_OS_LINUX) || defined(Q_OS_MACOS)) - qLog(Debug) << "Looking for resources in" << QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR; - QCoreApplication::setLibraryPaths(QStringList() << QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR); +#if defined(USE_BUNDLE) + { + QStringList library_paths; +#ifdef Q_OS_MACOS + library_paths.append(QCoreApplication::applicationDirPath() + "/../Frameworks"); +#endif +#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS) + library_paths.append(QCoreApplication::applicationDirPath() + "/" + USE_BUNDLE_DIR); +#endif + if (!library_paths.isEmpty()) { + qLog(Debug) << "Looking for resources in" << library_paths; + QCoreApplication::setLibraryPaths(library_paths); + } + } #endif // Gnome on Ubuntu has menu icons disabled by default. I think that's a bad idea, and makes some menus in Strawberry look confusing.