Include Mac OS X platform in installer project

refs #615
This commit is contained in:
Roland Winklmeier
2016-04-10 23:52:27 +02:00
parent 59551c0f1b
commit 45b0503896
21 changed files with 121 additions and 51 deletions

View File

@@ -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");

View File

@@ -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

View File

@@ -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

View File

@@ -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");
}
}

View File

@@ -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");
}
}