mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
@@ -436,6 +436,14 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
QString CApplication::applicationDirPath()
|
||||
{
|
||||
QString appDirectoryString(qApp->applicationDirPath());
|
||||
if (appDirectoryString.endsWith("Contents/MacOS")) { appDirectoryString += "/../../.."; }
|
||||
QDir appDirectory(appDirectoryString);
|
||||
return appDirectory.absolutePath();
|
||||
}
|
||||
|
||||
bool CApplication::useContexts(const CCoreFacadeConfig &coreConfig)
|
||||
{
|
||||
Q_ASSERT_X(this->m_parsed, Q_FUNC_INFO, "Call this function after parsing");
|
||||
|
||||
@@ -158,6 +158,10 @@ namespace BlackCore
|
||||
//! Clear the caches
|
||||
static QStringList clearCaches();
|
||||
|
||||
//! Returns the directory of the application. In contrast to QCoreApplication::applicationDirPath()
|
||||
//! it takes Mac OS X app bundles into account and returns the directory of the bundle.
|
||||
static QString applicationDirPath();
|
||||
|
||||
// ----------------------- parsing ----------------------------------------
|
||||
|
||||
//! \name parsing of command line options
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "blackcore/pluginmanager.h"
|
||||
#include "blackcore/application.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
|
||||
@@ -54,7 +55,7 @@ namespace BlackCore
|
||||
|
||||
QString IPluginManager::pluginDirectory() const
|
||||
{
|
||||
return qApp->applicationDirPath() % QStringLiteral("/plugins");
|
||||
return sApp->applicationDirPath() % QStringLiteral("/plugins");
|
||||
}
|
||||
|
||||
bool IPluginManager::isValid(const QJsonObject &metadata) const
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackcore/application.h"
|
||||
#include "blackcore/pluginmanagersimulator.h"
|
||||
#include "blackcore/simulator.h"
|
||||
|
||||
@@ -134,7 +135,7 @@ namespace BlackCore
|
||||
|
||||
QString CPluginManagerSimulator::pluginDirectory() const
|
||||
{
|
||||
return qApp->applicationDirPath() % QStringLiteral("/plugins/simulator");
|
||||
return sApp->applicationDirPath() % QStringLiteral("/plugins/simulator");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackcore/application.h"
|
||||
#include "blackcore/pluginmanagerweatherdata.h"
|
||||
#include "blackcore/weatherdata.h"
|
||||
|
||||
@@ -66,7 +67,7 @@ namespace BlackCore
|
||||
|
||||
QString CPluginManagerWeatherData::pluginDirectory() const
|
||||
{
|
||||
return qApp->applicationDirPath() % QStringLiteral("/plugins/weatherdata");
|
||||
return sApp->applicationDirPath() % QStringLiteral("/plugins/weatherdata");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user