9 #include <QCoreApplication> 11 #include <QLibraryInfo> 12 #include <QStandardPaths> 13 #include <QStringBuilder> 25 static QString getPath()
27 #if defined(Q_OS_ANDROID) 28 return QStringLiteral(
"assets:");
30 #elif defined(Q_OS_MACOS) && defined(QT_NO_DEBUG) 31 return QCoreApplication::applicationDirPath() + QStringLiteral(
"/../Resources");
34 return QCoreApplication::applicationDirPath();
40 static QString
getPath(
const QString& pFilename,
41 QStandardPaths::LocateOption pOption = QStandardPaths::LocateFile,
42 QStandardPaths::StandardLocation pStandard = QStandardPaths::AppDataLocation)
44 #if (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) || (defined(Q_OS_BSD4) && !defined(Q_OS_MACOS) && !defined(Q_OS_IOS)) 45 if (pFilename.compare(QStringLiteral(
"translations")) == 0)
46 return QLibraryInfo::location(QLibraryInfo::TranslationsPath);
47 const auto match = QStandardPaths::locate(pStandard, pFilename, pOption);
53 qDebug() << pFilename <<
"not found in following destinations |" << pOption;
54 const auto defaultLocations = QStandardPaths::standardLocations(pStandard);
55 for (
const auto& location : defaultLocations)
64 return getPath() % QLatin1Char(
'/') % pFilename;
static QString getPath(const QString &pFilename, QStandardPaths::LocateOption pOption=QStandardPaths::LocateFile, QStandardPaths::StandardLocation pStandard=QStandardPaths::AppDataLocation)
Definition: FileDestination.h:40
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
Definition: FileDestination.h:18