QString PluginContext::librariesPath(){ #ifdef Q_OS_DARWIN return applicationPath() + "/Libraries"; #else return applicationPath() + "/libraries"; #endif }
QString PluginContext::developmentPath(){ #ifdef Q_OS_DARWIN return applicationPath() + "/Dev"; #else return applicationPath() + "/dev"; #endif }
QString PluginContext::externalPath(){ #ifdef Q_OS_DARWIN return applicationPath() + "/External"; #else return applicationPath() + "/external"; #endif }
QString PluginContext::pluginPath(){ #ifdef Q_OS_DARWIN return applicationPath() + "/PlugIns"; #else return applicationPath() + "/plugins"; #endif }
bool isPortableMode() { // Making portableMode static means that the PORTABLE file check occurs only // once, when this function is being accessed the first time. This avoids // tricky situations in which the user might create/delete the check-file // while the program is running, since the mode will not change unless the // user restarts the program. static bool portableMode = applicationPath().exists("PORTABLE"); return portableMode; }
QString absoluteDataStoragePath(const QString &filename) { QString dirPath; if (isPortableMode()) { dirPath = applicationPath().filePath("data"); } else { dirPath = #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) QStandardPaths::writableLocation(QStandardPaths::DataLocation); #else QDesktopServices::storageLocation(QDesktopServices::DataLocation); #endif } QDir dir(dirPath); if (!dir.exists()) dir.mkpath("."); return dir.filePath(filename); }
void MainWindow::startApplication() { qDebug() << Q_FUNC_INFO; m_hooqPlayer->start(applicationPath(), m_arguments, m_hooqPlayInjector); }
std::string Moose::applicationFolder() { std::string s = applicationPath(); return s.substr( 0, s.rfind( '/' ) + 1 ); }
QString PluginContext::configPath(){ return applicationPath() + "/config"; }