8#include <QCoreApplication>
9#include <QStandardPaths>
10#include <QDesktopServices>
13#include <CoreFoundation/CFURL.h>
14#include <CoreFoundation/CFString.h>
15#include <CoreFoundation/CFBundle.h>
22 CFURLRef resourcesDirUrl = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
23 CFURLRef resourcesDirAbsoluteUrl = CFURLCopyAbsoluteURL(resourcesDirUrl);
24 CFStringRef macPath = CFURLCopyFileSystemPath(resourcesDirAbsoluteUrl, kCFURLPOSIXPathStyle);
25 QString path = QString::fromCFString(macPath);
26 CFRelease(resourcesDirUrl);
27 CFRelease(resourcesDirAbsoluteUrl);
31 return QCoreApplication::applicationDirPath().append(u
"/assets"_qs);
32#elif defined(__linux__)
33 return QStandardPaths::locate(QStandardPaths::AppDataLocation,
"assets", QStandardPaths::LocateDirectory);
39 QStringList arguments;
40 arguments.append(
"-e");
41 arguments.append(
"tell application \"Finder\"");
42 arguments.append(
"-e");
43 arguments.append(
"activate");
44 arguments.append(
"select POSIX file \""+ filePath +
"\"");
45 arguments.append(
"-e");
46 arguments.append(
"end tell");
47 QProcess::startDetached(
"osascript", arguments);
48#elif defined(Q_OS_WIN32)
49 QStringList arguments;
50 arguments.append(
"/select,");
51 arguments.append(QDir::toNativeSeparators(filePath));
52 QProcess::startDetached(
"explorer.exe", arguments);
53#elif defined(Q_OS_LINUX)
54 QDesktopServices::openUrl(QUrl::fromLocalFile(filePath));
Definition: audioformat.hpp:155
void showFileInExplorer(const QString &filePath)
Definition: platform.hpp:37
QString getAssetsDir()
Definition: platform.hpp:20