mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 12:45:40 +08:00
Ref T103, moved directory functions from CBuildConfig to CDirectoryUtils
getApplicationDir renamed to getBinDir() as it works different on MacOs see https://dev.swift-project.org/w/dev/swiftpc/dirstructure/
This commit is contained in:
committed by
Mathew Sutcliffe
parent
eaac4dacd6
commit
debd9c802f
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
#include "samplesperformance.h"
|
#include "samplesperformance.h"
|
||||||
#include "blackcore/db/databasereader.h"
|
#include "blackcore/db/databasereader.h"
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||||
|
#include "blackmisc/simulation/distributorlist.h"
|
||||||
#include "blackmisc/aviation/aircrafticaocodelist.h"
|
#include "blackmisc/aviation/aircrafticaocodelist.h"
|
||||||
#include "blackmisc/aviation/aircraftsituation.h"
|
#include "blackmisc/aviation/aircraftsituation.h"
|
||||||
#include "blackmisc/aviation/aircraftsituationlist.h"
|
#include "blackmisc/aviation/aircraftsituationlist.h"
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
#include "blackmisc/aviation/liverylist.h"
|
#include "blackmisc/aviation/liverylist.h"
|
||||||
#include "blackmisc/geo/coordinategeodetic.h"
|
#include "blackmisc/geo/coordinategeodetic.h"
|
||||||
#include "blackmisc/pq/units.h"
|
#include "blackmisc/pq/units.h"
|
||||||
#include "blackmisc/simulation/distributorlist.h"
|
|
||||||
#include "blackmisc/test/testing.h"
|
#include "blackmisc/test/testing.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/stringutils.h"
|
#include "blackmisc/stringutils.h"
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -51,7 +51,6 @@ using namespace BlackMisc::Network;
|
|||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
using namespace BlackMisc::Simulation;
|
using namespace BlackMisc::Simulation;
|
||||||
using namespace BlackMisc::Test;
|
using namespace BlackMisc::Test;
|
||||||
using namespace BlackConfig;
|
|
||||||
using namespace BlackCore::Db;
|
using namespace BlackCore::Db;
|
||||||
|
|
||||||
namespace BlackSample
|
namespace BlackSample
|
||||||
@@ -373,7 +372,7 @@ namespace BlackSample
|
|||||||
|
|
||||||
int CSamplesPerformance::samplesJsonModel(QTextStream &out)
|
int CSamplesPerformance::samplesJsonModel(QTextStream &out)
|
||||||
{
|
{
|
||||||
const QString dir = CBuildConfig::getSwiftStaticDbFilesDir();
|
const QString dir = CDirectoryUtils::getSwiftStaticDbFilesDir();
|
||||||
const QString file = QDir(dir).filePath("models.json");
|
const QString file = QDir(dir).filePath("models.json");
|
||||||
QFile modelFile(file);
|
QFile modelFile(file);
|
||||||
Q_ASSERT_X(modelFile.exists(), Q_FUNC_INFO, "Model file does not exist");
|
Q_ASSERT_X(modelFile.exists(), Q_FUNC_INFO, "Model file does not exist");
|
||||||
|
|||||||
@@ -124,217 +124,12 @@ namespace BlackConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getApplicationDirImpl()
|
|
||||||
{
|
|
||||||
QFileInfo executable(QCoreApplication::applicationFilePath());
|
|
||||||
QDir p(executable.dir());
|
|
||||||
return p.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getApplicationDir()
|
|
||||||
{
|
|
||||||
static const QString s(getApplicationDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isAppBundle()
|
|
||||||
{
|
|
||||||
QDir bundleDir(CBuildConfig::getApplicationDir());
|
|
||||||
bundleDir.cd("../..");
|
|
||||||
static const bool isBundled = QFileInfo(bundleDir.absolutePath()).isBundle();
|
|
||||||
return isBundled;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getSwiftShareDirImpl()
|
|
||||||
{
|
|
||||||
QDir dir(CBuildConfig::getApplicationDir());
|
|
||||||
bool success = true;
|
|
||||||
|
|
||||||
static const bool appBundle = isAppBundle();
|
|
||||||
if (CBuildConfig::isRunningOnMacOSXPlatform() && appBundle)
|
|
||||||
{
|
|
||||||
success = dir.cd("../../../../share");
|
|
||||||
}
|
|
||||||
else { success = dir.cd("../share"); }
|
|
||||||
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
Q_ASSERT_X(false, Q_FUNC_INFO, "missing dir");
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getSwiftShareDir()
|
|
||||||
{
|
|
||||||
static const QString s(getSwiftShareDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString getBootstrapResourceFileImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
if (d.isEmpty()) { return ""; }
|
|
||||||
const QFile file(QDir::cleanPath(d + QDir::separator() + "shared/boostrap/boostrap.json"));
|
|
||||||
Q_ASSERT_X(file.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return QFileInfo(file).absoluteFilePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getBootstrapResourceFile()
|
|
||||||
{
|
|
||||||
static const QString s(getBootstrapResourceFileImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getSwiftStaticDbFilesDirImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
if (d.isEmpty()) { return ""; }
|
|
||||||
const QDir dir(QDir::cleanPath(d + QDir::separator() + "shared/dbdata"));
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getSwiftStaticDbFilesDir()
|
|
||||||
{
|
|
||||||
static QString s(getSwiftStaticDbFilesDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getSoundFilesDirImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
if (d.isEmpty()) { return ""; }
|
|
||||||
const QDir dir(QDir::cleanPath(d + QDir::separator() + "sounds"));
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getSoundFilesDir()
|
|
||||||
{
|
|
||||||
static QString s(getSoundFilesDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getStylesheetsDirImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
if (d.isEmpty()) { return ""; }
|
|
||||||
const QDir dir(QDir::cleanPath(d + QDir::separator() + "qss"));
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getStylesheetsDir()
|
|
||||||
{
|
|
||||||
static QString s(getStylesheetsDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getImagesDirImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
const QDir dir(QDir::cleanPath(d + QDir::separator() + "images"));
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getImagesDir()
|
|
||||||
{
|
|
||||||
static const QString s(getImagesDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getImagesAirlinesDir()
|
|
||||||
{
|
|
||||||
static const QString s(QDir::cleanPath(getImagesDir() + QDir::separator() + "airlines"));
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getImagesFlagsDir()
|
|
||||||
{
|
|
||||||
static const QString s(QDir::cleanPath(getImagesDir() + QDir::separator() + "flags"));
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getHtmlDirImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
const QDir dir(QDir::cleanPath(d + QDir::separator() + "html"));
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getHtmlDir()
|
|
||||||
{
|
|
||||||
static const QString s(getHtmlDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getLegalDirImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
const QDir dir(QDir::cleanPath(d + QDir::separator() + "legal"));
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getLegalDir()
|
|
||||||
{
|
|
||||||
static const QString s(getLegalDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getAboutFileLocation()
|
|
||||||
{
|
|
||||||
static const QString about = QDir::cleanPath(CBuildConfig::getLegalDir() + QDir::separator() + "about.html");
|
|
||||||
return about;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString getTestFilesDirImpl()
|
|
||||||
{
|
|
||||||
const QString d(CBuildConfig::getSwiftShareDir());
|
|
||||||
if (d.isEmpty()) { return ""; }
|
|
||||||
const QDir dir(QDir::cleanPath(d + QDir::separator() + "test"));
|
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
|
||||||
return dir.absolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getTestFilesDir()
|
|
||||||
{
|
|
||||||
static QString s(getTestFilesDirImpl());
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getHtmlTemplateFileName()
|
|
||||||
{
|
|
||||||
static const QString s(getHtmlDir() + QDir::separator() + "swifttemplate.html");
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CBuildConfig::canRunInDeveloperEnvironment()
|
bool CBuildConfig::canRunInDeveloperEnvironment()
|
||||||
{
|
{
|
||||||
if (CBuildConfig::isDevBranch()) { return true; }
|
if (CBuildConfig::isDevBranch()) { return true; }
|
||||||
return !CBuildConfig::isStableBranch();
|
return !CBuildConfig::isStableBranch();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getDocumentationDirectoryImpl()
|
|
||||||
{
|
|
||||||
QStringList pathes(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation));
|
|
||||||
QString d = pathes.first();
|
|
||||||
d = QDir::cleanPath(d + QDir::separator() + "swift");
|
|
||||||
QDir dir(d);
|
|
||||||
if (dir.exists()) { return dir.absolutePath(); }
|
|
||||||
return pathes.first();
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString &CBuildConfig::getDocumentationDirectory()
|
|
||||||
{
|
|
||||||
static const QString d(getDocumentationDirectoryImpl());
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString boolToYesNo(bool v)
|
QString boolToYesNo(bool v)
|
||||||
{
|
{
|
||||||
return v ? "yes" : "no";
|
return v ? "yes" : "no";
|
||||||
|
|||||||
@@ -89,52 +89,6 @@ namespace BlackConfig
|
|||||||
//! Running on Unix (Linux or Mac OS X) platform
|
//! Running on Unix (Linux or Mac OS X) platform
|
||||||
static bool isRunningOnUnixPlatform();
|
static bool isRunningOnUnixPlatform();
|
||||||
|
|
||||||
//! Application directory where current application is located
|
|
||||||
static const QString &getApplicationDir();
|
|
||||||
|
|
||||||
//! Where resource files (static DB files, ...) etc are located
|
|
||||||
//! \remark share not shared (do no mix)
|
|
||||||
static const QString &getSwiftShareDir();
|
|
||||||
|
|
||||||
//! Bootstrap resource directory
|
|
||||||
static const QString &getBootstrapResourceFile();
|
|
||||||
|
|
||||||
//! Where static DB files are located
|
|
||||||
static const QString &getSwiftStaticDbFilesDir();
|
|
||||||
|
|
||||||
//! Where sound files are located
|
|
||||||
static const QString &getSoundFilesDir();
|
|
||||||
|
|
||||||
//! Where qss files are located
|
|
||||||
static const QString &getStylesheetsDir();
|
|
||||||
|
|
||||||
//! Where images are located
|
|
||||||
static const QString &getImagesDir();
|
|
||||||
|
|
||||||
//! Where airline images are located
|
|
||||||
static const QString &getImagesAirlinesDir();
|
|
||||||
|
|
||||||
//! Where flags images are located
|
|
||||||
static const QString &getImagesFlagsDir();
|
|
||||||
|
|
||||||
//! Where HTML files are located
|
|
||||||
static const QString &getHtmlDir();
|
|
||||||
|
|
||||||
//! Where Legal files are located
|
|
||||||
static const QString &getLegalDir();
|
|
||||||
|
|
||||||
//! The about document file location
|
|
||||||
static const QString &getAboutFileLocation();
|
|
||||||
|
|
||||||
//! Where test files are located
|
|
||||||
static const QString &getTestFilesDir();
|
|
||||||
|
|
||||||
//! Where HTML files are located
|
|
||||||
static const QString &getHtmlTemplateFileName();
|
|
||||||
|
|
||||||
//! Directory where data can be stored
|
|
||||||
static const QString &getDocumentationDirectory();
|
|
||||||
|
|
||||||
//! Info string about compilation
|
//! Info string about compilation
|
||||||
static const QString &compiledWithInfo(bool shortVersion = true);
|
static const QString &compiledWithInfo(bool shortVersion = true);
|
||||||
|
|
||||||
|
|||||||
@@ -1189,7 +1189,7 @@ namespace BlackCore
|
|||||||
if (isUnitTest()) { return CStatusMessage(this).info("No crash handler for unit tests"); }
|
if (isUnitTest()) { return CStatusMessage(this).info("No crash handler for unit tests"); }
|
||||||
|
|
||||||
static const QString crashpadHandler(CBuildConfig::isRunningOnWindowsNtPlatform() ? "swift_crashpad_handler.exe" : "swift_crashpad_handler");
|
static const QString crashpadHandler(CBuildConfig::isRunningOnWindowsNtPlatform() ? "swift_crashpad_handler.exe" : "swift_crashpad_handler");
|
||||||
static const QString handler = CFileUtils::appendFilePaths(CDirectoryUtils::applicationDirectoryPath(), crashpadHandler);
|
static const QString handler = CFileUtils::appendFilePaths(CDirectoryUtils::getBinDir(), crashpadHandler);
|
||||||
static const QString crashpadPath = CDirectoryUtils::getCrashpadDirectory();
|
static const QString crashpadPath = CDirectoryUtils::getCrashpadDirectory();
|
||||||
static const QString database = CFileUtils::appendFilePaths(crashpadPath, "/database");
|
static const QString database = CFileUtils::appendFilePaths(crashpadPath, "/database");
|
||||||
static const QString metrics = CFileUtils::appendFilePaths(crashpadPath, "/metrics");
|
static const QString metrics = CFileUtils::appendFilePaths(crashpadPath, "/metrics");
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
QString IPluginManager::pluginDirectory() const
|
QString IPluginManager::pluginDirectory() const
|
||||||
{
|
{
|
||||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/plugins");
|
return CDirectoryUtils::getBinDir() % QStringLiteral("/plugins");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IPluginManager::isValid(const QJsonObject &metadata) const
|
bool IPluginManager::isValid(const QJsonObject &metadata) const
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
QString CPluginManagerSimulator::pluginDirectory() const
|
QString CPluginManagerSimulator::pluginDirectory() const
|
||||||
{
|
{
|
||||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/plugins/simulator");
|
return CDirectoryUtils::getBinDir() % QStringLiteral("/plugins/simulator");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
QString CPluginManagerWeatherData::pluginDirectory() const
|
QString CPluginManagerWeatherData::pluginDirectory() const
|
||||||
{
|
{
|
||||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/plugins/weatherdata");
|
return CDirectoryUtils::getBinDir() % QStringLiteral("/plugins/weatherdata");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#include "blackmisc/network/networkutils.h"
|
#include "blackmisc/network/networkutils.h"
|
||||||
#include "blackmisc/network/url.h"
|
#include "blackmisc/network/url.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
@@ -31,7 +30,6 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Db;
|
using namespace BlackMisc::Db;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
@@ -518,7 +516,7 @@ namespace BlackCore
|
|||||||
CLogMessage(this).info("Setup (bootstrap already cached, no prefill needed");
|
CLogMessage(this).info("Setup (bootstrap already cached, no prefill needed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const QString fn = CBuildConfig::getBootstrapResourceFile();
|
const QString fn = CDirectoryUtils::getBootstrapResourceFile();
|
||||||
const CStatusMessageList msgs = this->readLocalBootstrapFile(fn);
|
const CStatusMessageList msgs = this->readLocalBootstrapFile(fn);
|
||||||
CLogMessage::preformatted(msgs);
|
CLogMessage::preformatted(msgs);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "blackcore/webdataservices.h"
|
#include "blackcore/webdataservices.h"
|
||||||
#include "blackgui/components/datainfoareacomponent.h"
|
#include "blackgui/components/datainfoareacomponent.h"
|
||||||
#include "blackgui/components/dbaircrafticaocomponent.h"
|
#include "blackgui/components/dbaircrafticaocomponent.h"
|
||||||
@@ -21,6 +20,7 @@
|
|||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
#include "blackmisc/network/entityflags.h"
|
#include "blackmisc/network/entityflags.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/verify.h"
|
#include "blackmisc/verify.h"
|
||||||
#include "ui_datainfoareacomponent.h"
|
#include "ui_datainfoareacomponent.h"
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
using namespace BlackGui;
|
using namespace BlackGui;
|
||||||
@@ -91,7 +90,7 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
|
|
||||||
// write to disk
|
// write to disk
|
||||||
bool s = sGui->getWebDataServices()->writeDbDataToDisk(CBuildConfig::getSwiftStaticDbFilesDir());
|
bool s = sGui->getWebDataServices()->writeDbDataToDisk(CDirectoryUtils::getSwiftStaticDbFilesDir());
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
CLogMessage(this).info("Written DB data");
|
CLogMessage(this).info("Written DB data");
|
||||||
@@ -106,12 +105,12 @@ namespace BlackGui
|
|||||||
bool CDataInfoAreaComponent::readDbDataFromResourceDir()
|
bool CDataInfoAreaComponent::readDbDataFromResourceDir()
|
||||||
{
|
{
|
||||||
bool s = sGui &&
|
bool s = sGui &&
|
||||||
sGui->getWebDataServices()->readDbDataFromDisk(CBuildConfig::getSwiftStaticDbFilesDir(), true);
|
sGui->getWebDataServices()->readDbDataFromDisk(CDirectoryUtils::getSwiftStaticDbFilesDir(), true);
|
||||||
|
|
||||||
// info
|
// info
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
CLogMessage(this).info("Read DB data from directory: %1") << CBuildConfig::getSwiftStaticDbFilesDir();
|
CLogMessage(this).info("Read DB data from directory: %1") << CDirectoryUtils::getSwiftStaticDbFilesDir();
|
||||||
ui->comp_DbAircraftIcao->showLoadIndicator();
|
ui->comp_DbAircraftIcao->showLoadIndicator();
|
||||||
ui->comp_DbAirlineIcao->showLoadIndicator();
|
ui->comp_DbAirlineIcao->showLoadIndicator();
|
||||||
ui->comp_DbCountries->showLoadIndicator();
|
ui->comp_DbCountries->showLoadIndicator();
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "blackmisc/pq/speed.h"
|
#include "blackmisc/pq/speed.h"
|
||||||
#include "blackmisc/pq/units.h"
|
#include "blackmisc/pq/units.h"
|
||||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "ui_flightplancomponent.h"
|
#include "ui_flightplancomponent.h"
|
||||||
|
|
||||||
@@ -598,7 +599,7 @@ namespace BlackGui
|
|||||||
QString CFlightPlanComponent::getDefaultFilename(bool load)
|
QString CFlightPlanComponent::getDefaultFilename(bool load)
|
||||||
{
|
{
|
||||||
// some logic to find a useful default name
|
// some logic to find a useful default name
|
||||||
QString dir = CBuildConfig::getDocumentationDirectory();
|
QString dir = CDirectoryUtils::getDocumentationDirectory();
|
||||||
|
|
||||||
if (load)
|
if (load)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackmisc/settingscache.h"
|
#include "blackmisc/settingscache.h"
|
||||||
#include "blackconfig/buildconfig.h"
|
#include "blackmisc/directoryutils.h"
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
@@ -31,7 +31,7 @@ namespace BlackGui
|
|||||||
static bool isValid(const QString &directory) { Q_UNUSED(directory); return true; }
|
static bool isValid(const QString &directory) { Q_UNUSED(directory); return true; }
|
||||||
|
|
||||||
//! Default, not consolidating
|
//! Default, not consolidating
|
||||||
static const QString &defaultValue() { return BlackConfig::CBuildConfig::getDocumentationDirectory(); }
|
static const QString &defaultValue() { return BlackMisc::CDirectoryUtils::getDocumentationDirectory(); }
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#include "blackconfig/buildconfig.h"
|
#include "blackconfig/buildconfig.h"
|
||||||
#include "blackgui/stylesheetutility.h"
|
#include "blackgui/stylesheetutility.h"
|
||||||
#include "blackmisc/fileutils.h"
|
#include "blackmisc/fileutils.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/restricted.h"
|
#include "blackmisc/restricted.h"
|
||||||
|
|
||||||
#include <QAbstractScrollArea>
|
#include <QAbstractScrollArea>
|
||||||
@@ -132,12 +133,12 @@ namespace BlackGui
|
|||||||
|
|
||||||
bool CStyleSheetUtility::read()
|
bool CStyleSheetUtility::read()
|
||||||
{
|
{
|
||||||
QDir directory(CBuildConfig::getStylesheetsDir());
|
QDir directory(CDirectoryUtils::getStylesheetsDir());
|
||||||
if (!directory.exists()) { return false; }
|
if (!directory.exists()) { return false; }
|
||||||
|
|
||||||
// qss/css files
|
// qss/css files
|
||||||
const bool needsWatcher = this->m_fileWatcher.files().isEmpty();
|
const bool needsWatcher = this->m_fileWatcher.files().isEmpty();
|
||||||
if (needsWatcher) { this->m_fileWatcher.addPath(CBuildConfig::getStylesheetsDir()); } // directory to deleted file watching
|
if (needsWatcher) { this->m_fileWatcher.addPath(CDirectoryUtils::getStylesheetsDir()); } // directory to deleted file watching
|
||||||
directory.setNameFilters({"*.qss", "*.css"});
|
directory.setNameFilters({"*.qss", "*.css"});
|
||||||
directory.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
directory.setFilter(QDir::Files | QDir::Hidden | QDir::NoSymLinks);
|
||||||
|
|
||||||
@@ -239,7 +240,7 @@ namespace BlackGui
|
|||||||
qssWidget.append(qss);
|
qssWidget.append(qss);
|
||||||
qssWidget.append("}\n");
|
qssWidget.append("}\n");
|
||||||
|
|
||||||
QFile fontFile(CBuildConfig::getStylesheetsDir() + "/" + fileNameFontsModified());
|
QFile fontFile(CDirectoryUtils::getStylesheetsDir() + "/" + fileNameFontsModified());
|
||||||
bool ok = fontFile.open(QFile::Text | QFile::WriteOnly);
|
bool ok = fontFile.open(QFile::Text | QFile::WriteOnly);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
@@ -253,7 +254,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
bool CStyleSheetUtility::resetFont()
|
bool CStyleSheetUtility::resetFont()
|
||||||
{
|
{
|
||||||
QFile fontFile(CBuildConfig::getStylesheetsDir() + "/" + fileNameFontsModified());
|
QFile fontFile(CDirectoryUtils::getStylesheetsDir() + "/" + fileNameFontsModified());
|
||||||
return fontFile.remove();
|
return fontFile.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,7 +300,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
bool CStyleSheetUtility::deleteModifiedFontFile()
|
bool CStyleSheetUtility::deleteModifiedFontFile()
|
||||||
{
|
{
|
||||||
const QString fn = CFileUtils::appendFilePaths(CBuildConfig::getStylesheetsDir(), fileNameFontsModified());
|
const QString fn = CFileUtils::appendFilePaths(CDirectoryUtils::getStylesheetsDir(), fileNameFontsModified());
|
||||||
QFile file(fn);
|
QFile file(fn);
|
||||||
if (!file.exists()) { return false; }
|
if (!file.exists()) { return false; }
|
||||||
bool r = file.remove();
|
bool r = file.remove();
|
||||||
@@ -483,7 +484,7 @@ namespace BlackGui
|
|||||||
bool CStyleSheetUtility::qssFileExists(const QString &filename)
|
bool CStyleSheetUtility::qssFileExists(const QString &filename)
|
||||||
{
|
{
|
||||||
if (filename.isEmpty()) { return false; }
|
if (filename.isEmpty()) { return false; }
|
||||||
const QFileInfo f(CFileUtils::appendFilePaths(CBuildConfig::getStylesheetsDir(), filename));
|
const QFileInfo f(CFileUtils::appendFilePaths(CDirectoryUtils::getStylesheetsDir(), filename));
|
||||||
return f.exists() && f.isReadable();
|
return f.exists() && f.isReadable();
|
||||||
}
|
}
|
||||||
}
|
} // ns
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "airlineicaocode.h"
|
#include "airlineicaocode.h"
|
||||||
#include "callsign.h"
|
#include "callsign.h"
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "blackmisc/db/datastoreutility.h"
|
#include "blackmisc/db/datastoreutility.h"
|
||||||
#include "blackmisc/comparefunctions.h"
|
#include "blackmisc/comparefunctions.h"
|
||||||
#include "blackmisc/icons.h"
|
#include "blackmisc/icons.h"
|
||||||
@@ -18,6 +17,7 @@
|
|||||||
#include "blackmisc/propertyindex.h"
|
#include "blackmisc/propertyindex.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/stringutils.h"
|
#include "blackmisc/stringutils.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/variant.h"
|
#include "blackmisc/variant.h"
|
||||||
#include "blackmisc/verify.h"
|
#include "blackmisc/verify.h"
|
||||||
|
|
||||||
@@ -30,7 +30,6 @@
|
|||||||
#include <Qt>
|
#include <Qt>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Db;
|
using namespace BlackMisc::Db;
|
||||||
|
|
||||||
@@ -481,7 +480,7 @@ namespace BlackMisc
|
|||||||
//! \private
|
//! \private
|
||||||
QSet<int> iconIdsImpl()
|
QSet<int> iconIdsImpl()
|
||||||
{
|
{
|
||||||
QDir dir(CBuildConfig::getImagesAirlinesDir());
|
QDir dir(CDirectoryUtils::getImagesAirlinesDir());
|
||||||
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "image directory missing");
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "image directory missing");
|
||||||
|
|
||||||
QSet<int> ids;
|
QSet<int> ids;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "blackmisc/directoryutils.h"
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/fileutils.h"
|
#include "blackmisc/fileutils.h"
|
||||||
#include "blackmisc/range.h"
|
#include "blackmisc/range.h"
|
||||||
|
#include "blackconfig/buildconfig.h"
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
@@ -20,9 +21,11 @@
|
|||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
|
using namespace BlackConfig;
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
QString applicationDirectoryPathImpl()
|
QString binDirectoryImpl()
|
||||||
{
|
{
|
||||||
QString appDirectoryString(qApp->applicationDirPath());
|
QString appDirectoryString(qApp->applicationDirPath());
|
||||||
if (appDirectoryString.endsWith("Contents/MacOS")) { appDirectoryString += "/../../.."; }
|
if (appDirectoryString.endsWith("Contents/MacOS")) { appDirectoryString += "/../../.."; }
|
||||||
@@ -30,15 +33,15 @@ namespace BlackMisc
|
|||||||
return appDirectory.absolutePath();
|
return appDirectory.absolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CDirectoryUtils::applicationDirectoryPath()
|
const QString &CDirectoryUtils::getBinDir()
|
||||||
{
|
{
|
||||||
static const QString appDirectory(applicationDirectoryPathImpl());
|
static const QString binDir(binDirectoryImpl());
|
||||||
return appDirectory;
|
return binDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString normalizedApplicationDirectoryImpl()
|
QString normalizedApplicationDirectoryImpl()
|
||||||
{
|
{
|
||||||
QString appDir = CDirectoryUtils::applicationDirectoryPath();
|
QString appDir = CDirectoryUtils::getBinDir();
|
||||||
Q_ASSERT(appDir.size() > 0);
|
Q_ASSERT(appDir.size() > 0);
|
||||||
// Remove leading '/' on Unix
|
// Remove leading '/' on Unix
|
||||||
if (appDir.at(0) == '/') { appDir.remove(0, 1); }
|
if (appDir.at(0) == '/') { appDir.remove(0, 1); }
|
||||||
@@ -90,6 +93,198 @@ namespace BlackMisc
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isAppBundleImpl()
|
||||||
|
{
|
||||||
|
QDir bundleDir(CDirectoryUtils::getBinDir());
|
||||||
|
bundleDir.cd("../..");
|
||||||
|
const bool isBundled = QFileInfo(bundleDir.absolutePath()).isBundle();
|
||||||
|
return isBundled;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getSwiftShareDirImpl()
|
||||||
|
{
|
||||||
|
QDir dir(CDirectoryUtils::getBinDir());
|
||||||
|
bool success = true;
|
||||||
|
|
||||||
|
static const bool appBundle = isAppBundleImpl();
|
||||||
|
if (CBuildConfig::isRunningOnMacOSXPlatform() && appBundle)
|
||||||
|
{
|
||||||
|
success = dir.cd("../../../../share");
|
||||||
|
}
|
||||||
|
else { success = dir.cd("../share"); }
|
||||||
|
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
Q_ASSERT_X(false, Q_FUNC_INFO, "missing dir");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getSwiftShareDir()
|
||||||
|
{
|
||||||
|
static const QString s(getSwiftShareDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString getBootstrapResourceFileImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
if (d.isEmpty()) { return ""; }
|
||||||
|
const QFile file(QDir::cleanPath(d + QDir::separator() + "shared/boostrap/boostrap.json"));
|
||||||
|
Q_ASSERT_X(file.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return QFileInfo(file).absoluteFilePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getBootstrapResourceFile()
|
||||||
|
{
|
||||||
|
static const QString s(getBootstrapResourceFileImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getSwiftStaticDbFilesDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
if (d.isEmpty()) { return ""; }
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "shared/dbdata"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getSwiftStaticDbFilesDir()
|
||||||
|
{
|
||||||
|
static QString s(getSwiftStaticDbFilesDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getSoundFilesDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
if (d.isEmpty()) { return ""; }
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "sounds"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getSoundFilesDir()
|
||||||
|
{
|
||||||
|
static QString s(getSoundFilesDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getStylesheetsDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
if (d.isEmpty()) { return ""; }
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "qss"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getStylesheetsDir()
|
||||||
|
{
|
||||||
|
static QString s(getStylesheetsDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getImagesDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "images"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getImagesDir()
|
||||||
|
{
|
||||||
|
static const QString s(getImagesDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getImagesAirlinesDir()
|
||||||
|
{
|
||||||
|
static const QString s(QDir::cleanPath(getImagesDir() + QDir::separator() + "airlines"));
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getImagesFlagsDir()
|
||||||
|
{
|
||||||
|
static const QString s(QDir::cleanPath(getImagesDir() + QDir::separator() + "flags"));
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getHtmlDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "html"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getHtmlDir()
|
||||||
|
{
|
||||||
|
static const QString s(getHtmlDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getLegalDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "legal"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getLegalDir()
|
||||||
|
{
|
||||||
|
static const QString s(getLegalDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getAboutFileLocation()
|
||||||
|
{
|
||||||
|
static const QString about = QDir::cleanPath(CDirectoryUtils::getLegalDir() + QDir::separator() + "about.html");
|
||||||
|
return about;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getTestFilesDirImpl()
|
||||||
|
{
|
||||||
|
const QString d(CDirectoryUtils::getSwiftShareDir());
|
||||||
|
if (d.isEmpty()) { return ""; }
|
||||||
|
const QDir dir(QDir::cleanPath(d + QDir::separator() + "test"));
|
||||||
|
Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir");
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getTestFilesDir()
|
||||||
|
{
|
||||||
|
static QString s(getTestFilesDirImpl());
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getHtmlTemplateFileName()
|
||||||
|
{
|
||||||
|
static const QString s(getHtmlDir() + QDir::separator() + "swifttemplate.html");
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString getDocumentationDirectoryImpl()
|
||||||
|
{
|
||||||
|
QStringList pathes(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation));
|
||||||
|
QString d = pathes.first();
|
||||||
|
d = QDir::cleanPath(d + QDir::separator() + "swift");
|
||||||
|
QDir dir(d);
|
||||||
|
if (dir.exists()) { return dir.absolutePath(); }
|
||||||
|
return pathes.first();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::getDocumentationDirectory()
|
||||||
|
{
|
||||||
|
static const QString d(getDocumentationDirectoryImpl());
|
||||||
|
return d;
|
||||||
|
}
|
||||||
|
|
||||||
const QString &CDirectoryUtils::getCrashpadDirectory()
|
const QString &CDirectoryUtils::getCrashpadDirectory()
|
||||||
{
|
{
|
||||||
static const QString p = CFileUtils::appendFilePaths(swiftNormalizedApplicationDataDirectory(), "/crashpad");
|
static const QString p = CFileUtils::appendFilePaths(swiftNormalizedApplicationDataDirectory(), "/crashpad");
|
||||||
|
|||||||
@@ -25,9 +25,11 @@ namespace BlackMisc
|
|||||||
class BLACKMISC_EXPORT CDirectoryUtils
|
class BLACKMISC_EXPORT CDirectoryUtils
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Returns the directory of the application. In contrast to QCoreApplication::applicationDirPath()
|
//! Returns the bin directory. On Windows/Linux this is the same directory as
|
||||||
//! it takes Mac OS X app bundles into account and returns the directory of the bundle.
|
//! QCoreApplication::applicationDirPath(), but on MacOS the exceutable is
|
||||||
static QString applicationDirectoryPath();
|
//! located deeper in the hierarchy of the bundles
|
||||||
|
//! \see https://dev.swift-project.org/w/dev/swiftpc/dirstructure/
|
||||||
|
static const QString &getBinDir();
|
||||||
|
|
||||||
//! swift application data directory, contains 0..n swift installation directories
|
//! swift application data directory, contains 0..n swift installation directories
|
||||||
static const QString &swiftApplicationDataDirectory();
|
static const QString &swiftApplicationDataDirectory();
|
||||||
@@ -41,6 +43,49 @@ namespace BlackMisc
|
|||||||
//! swift application data directory for one specific installation (a version)
|
//! swift application data directory for one specific installation (a version)
|
||||||
static const QString &swiftNormalizedApplicationDataDirectory();
|
static const QString &swiftNormalizedApplicationDataDirectory();
|
||||||
|
|
||||||
|
//! Where resource files (static DB files, ...) etc are located
|
||||||
|
//! \remark share not shared (do no mix)
|
||||||
|
static const QString &getSwiftShareDir();
|
||||||
|
|
||||||
|
//! Bootstrap resource directory
|
||||||
|
static const QString &getBootstrapResourceFile();
|
||||||
|
|
||||||
|
//! Where static DB files are located
|
||||||
|
static const QString &getSwiftStaticDbFilesDir();
|
||||||
|
|
||||||
|
//! Where sound files are located
|
||||||
|
static const QString &getSoundFilesDir();
|
||||||
|
|
||||||
|
//! Where qss files are located
|
||||||
|
static const QString &getStylesheetsDir();
|
||||||
|
|
||||||
|
//! Where images are located
|
||||||
|
static const QString &getImagesDir();
|
||||||
|
|
||||||
|
//! Where airline images are located
|
||||||
|
static const QString &getImagesAirlinesDir();
|
||||||
|
|
||||||
|
//! Where flags images are located
|
||||||
|
static const QString &getImagesFlagsDir();
|
||||||
|
|
||||||
|
//! Where HTML files are located
|
||||||
|
static const QString &getHtmlDir();
|
||||||
|
|
||||||
|
//! Where Legal files are located
|
||||||
|
static const QString &getLegalDir();
|
||||||
|
|
||||||
|
//! The about document file location
|
||||||
|
static const QString &getAboutFileLocation();
|
||||||
|
|
||||||
|
//! Where test files are located
|
||||||
|
static const QString &getTestFilesDir();
|
||||||
|
|
||||||
|
//! Where HTML files are located
|
||||||
|
static const QString &getHtmlTemplateFileName();
|
||||||
|
|
||||||
|
//! Directory where data can be stored
|
||||||
|
static const QString &getDocumentationDirectory();
|
||||||
|
|
||||||
//! Directory for log files
|
//! Directory for log files
|
||||||
//! \remark In BlackMisc so it can also be used from BlackMisc classes
|
//! \remark In BlackMisc so it can also be used from BlackMisc classes
|
||||||
static const QString &getLogDirectory();
|
static const QString &getLogDirectory();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
//! \cond PRIVATE
|
//! \cond PRIVATE
|
||||||
|
|
||||||
#include "blackconfig/buildconfig.h"
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/fileutils.h"
|
#include "blackmisc/fileutils.h"
|
||||||
#include "blackmisc/icons.h"
|
#include "blackmisc/icons.h"
|
||||||
#include "blackmisc/threadutils.h"
|
#include "blackmisc/threadutils.h"
|
||||||
@@ -22,8 +22,6 @@
|
|||||||
#include <QSize>
|
#include <QSize>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
const QPixmap &CIcons::info16()
|
const QPixmap &CIcons::info16()
|
||||||
@@ -1157,7 +1155,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
if (!getResourceFileCache().contains(fileName))
|
if (!getResourceFileCache().contains(fileName))
|
||||||
{
|
{
|
||||||
const QString path = CFileUtils::appendFilePaths(CBuildConfig::getImagesDir(), fileName);
|
const QString path = CFileUtils::appendFilePaths(CDirectoryUtils::getImagesDir(), fileName);
|
||||||
QPixmap pm;
|
QPixmap pm;
|
||||||
const bool s = pm.load(path);
|
const bool s = pm.load(path);
|
||||||
getResourceFileCache().insert(fileName, s ? pm : CIcons::empty());
|
getResourceFileCache().insert(fileName, s ? pm : CIcons::empty());
|
||||||
|
|||||||
@@ -7,12 +7,11 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||||
#include "blackmisc/simulation/aircraftmodelutils.h"
|
#include "blackmisc/simulation/aircraftmodelutils.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/verify.h"
|
#include "blackmisc/verify.h"
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
namespace Simulation
|
namespace Simulation
|
||||||
@@ -133,7 +132,7 @@ namespace BlackMisc
|
|||||||
BLACK_VERIFY_X(dir.exists(), Q_FUNC_INFO, "Directory does not exist");
|
BLACK_VERIFY_X(dir.exists(), Q_FUNC_INFO, "Directory does not exist");
|
||||||
if (!dir.exists()) { return ""; }
|
if (!dir.exists()) { return ""; }
|
||||||
|
|
||||||
const QString htmlTemplate = CFileUtils::readFileToString(CBuildConfig::getHtmlTemplateFileName());
|
const QString htmlTemplate = CFileUtils::readFileToString(CDirectoryUtils::getHtmlTemplateFileName());
|
||||||
const QString fn("airlineAircraftMatrix.html");
|
const QString fn("airlineAircraftMatrix.html");
|
||||||
const bool ok = CFileUtils::writeStringToFile(htmlTemplate.arg(html), dir.absoluteFilePath(fn));
|
const bool ok = CFileUtils::writeStringToFile(htmlTemplate.arg(html), dir.absoluteFilePath(fn));
|
||||||
return ok ? dir.absoluteFilePath(fn) : "";
|
return ok ? dir.absoluteFilePath(fn) : "";
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (parts.isEmpty() && interpolation.isEmpty()) { return CStatusMessage(static_cast<CInterpolationLogger *>(nullptr)).warning("No data for log"); }
|
if (parts.isEmpty() && interpolation.isEmpty()) { return CStatusMessage(static_cast<CInterpolationLogger *>(nullptr)).warning("No data for log"); }
|
||||||
static const QString html = QStringLiteral("Entries: %1\n\n%2");
|
static const QString html = QStringLiteral("Entries: %1\n\n%2");
|
||||||
const QString htmlTemplate = CFileUtils::readFileToString(CBuildConfig::getHtmlTemplateFileName());
|
const QString htmlTemplate = CFileUtils::readFileToString(CDirectoryUtils::getHtmlTemplateFileName());
|
||||||
|
|
||||||
CStatusMessageList msgs;
|
CStatusMessageList msgs;
|
||||||
const QString ts = QDateTime::currentDateTimeUtc().toString("yyyyMMddhhmmss");
|
const QString ts = QDateTime::currentDateTimeUtc().toString("yyyyMMddhhmmss");
|
||||||
|
|||||||
@@ -8,16 +8,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "testdata.h"
|
#include "testdata.h"
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||||
#include "blackmisc/aviation/atcstationlist.h"
|
#include "blackmisc/aviation/atcstationlist.h"
|
||||||
#include "blackmisc/aviation/flightplan.h"
|
#include "blackmisc/aviation/flightplan.h"
|
||||||
#include "blackmisc/network/userlist.h"
|
#include "blackmisc/network/userlist.h"
|
||||||
#include "blackmisc/network/server.h"
|
#include "blackmisc/network/server.h"
|
||||||
#include "blackmisc/fileutils.h"
|
#include "blackmisc/fileutils.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/variantlist.h"
|
#include "blackmisc/variantlist.h"
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::Geo;
|
using namespace BlackMisc::Geo;
|
||||||
using namespace BlackMisc::Network;
|
using namespace BlackMisc::Network;
|
||||||
@@ -240,7 +239,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoB737()
|
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoB737()
|
||||||
{
|
{
|
||||||
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAircraftIcaoB737Boeing.json");
|
static const QString json = CFileUtils::readFileToString(CDirectoryUtils::getTestFilesDir(), "DBAircraftIcaoB737Boeing.json");
|
||||||
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
||||||
Q_ASSERT(icao.hasValidDbKey());
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
@@ -248,7 +247,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoC172()
|
const CAircraftIcaoCode &CTestData::getDBAircraftIcaoC172()
|
||||||
{
|
{
|
||||||
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAircraftIcaoC172Cessna.json");
|
static const QString json = CFileUtils::readFileToString(CDirectoryUtils::getTestFilesDir(), "DBAircraftIcaoC172Cessna.json");
|
||||||
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
static const CAircraftIcaoCode icao(CAircraftIcaoCode::fromJson(json));
|
||||||
Q_ASSERT(icao.hasValidDbKey());
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
@@ -256,7 +255,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoDLH()
|
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoDLH()
|
||||||
{
|
{
|
||||||
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAirlineIcaoDLH.json");
|
static const QString json = CFileUtils::readFileToString(CDirectoryUtils::getTestFilesDir(), "DBAirlineIcaoDLH.json");
|
||||||
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
||||||
Q_ASSERT(icao.hasValidDbKey());
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
@@ -264,7 +263,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoBAW()
|
const CAirlineIcaoCode &CTestData::getDbAirlineIcaoBAW()
|
||||||
{
|
{
|
||||||
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBAirlineIcaoBAW.json");
|
static const QString json = CFileUtils::readFileToString(CDirectoryUtils::getTestFilesDir(), "DBAirlineIcaoBAW.json");
|
||||||
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
static const CAirlineIcaoCode icao(CAirlineIcaoCode::fromJson(json));
|
||||||
Q_ASSERT(icao.hasValidDbKey());
|
Q_ASSERT(icao.hasValidDbKey());
|
||||||
return icao;
|
return icao;
|
||||||
@@ -272,7 +271,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CLivery &CTestData::getDbLiveryDLHStarAlliance()
|
const CLivery &CTestData::getDbLiveryDLHStarAlliance()
|
||||||
{
|
{
|
||||||
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBLiveryDLHStarAlliance.json");
|
static const QString json = CFileUtils::readFileToString(CDirectoryUtils::getTestFilesDir(), "DBLiveryDLHStarAlliance.json");
|
||||||
static const CLivery livery(CLivery::fromJson(json));
|
static const CLivery livery(CLivery::fromJson(json));
|
||||||
Q_ASSERT(livery.hasValidDbKey());
|
Q_ASSERT(livery.hasValidDbKey());
|
||||||
return livery;
|
return livery;
|
||||||
@@ -280,7 +279,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAircraftModel &CTestData::getDbAircraftModelFsxA2AC172Skyhawk()
|
const CAircraftModel &CTestData::getDbAircraftModelFsxA2AC172Skyhawk()
|
||||||
{
|
{
|
||||||
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBModelFSXA2ACessnaC172.json");
|
static const QString json = CFileUtils::readFileToString(CDirectoryUtils::getTestFilesDir(), "DBModelFSXA2ACessnaC172.json");
|
||||||
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
||||||
Q_ASSERT(model.hasValidDbKey());
|
Q_ASSERT(model.hasValidDbKey());
|
||||||
Q_ASSERT(!model.getModelString().isEmpty());
|
Q_ASSERT(!model.getModelString().isEmpty());
|
||||||
@@ -289,7 +288,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAircraftModel &CTestData::getDbAircraftModelFsxAerosoftA320()
|
const CAircraftModel &CTestData::getDbAircraftModelFsxAerosoftA320()
|
||||||
{
|
{
|
||||||
static const QString json = CFileUtils::readFileToString(CBuildConfig::getTestFilesDir(), "DBModelFSXAerosoftA320.json");
|
static const QString json = CFileUtils::readFileToString(CDirectoryUtils::getTestFilesDir(), "DBModelFSXAerosoftA320.json");
|
||||||
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
static const CAircraftModel model(CAircraftModel::fromDatabaseJson(Json::jsonObjectFromString(json)));
|
||||||
Q_ASSERT(model.hasValidDbKey());
|
Q_ASSERT(model.hasValidDbKey());
|
||||||
Q_ASSERT(!model.getModelString().isEmpty());
|
Q_ASSERT(!model.getModelString().isEmpty());
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "blacksound/soundgenerator.h"
|
#include "blacksound/soundgenerator.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "blackmisc/filedeleter.h"
|
#include "blackmisc/filedeleter.h"
|
||||||
#include <QtCore/qendian.h>
|
#include <QtCore/qendian.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::PhysicalQuantities;
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
@@ -501,12 +500,12 @@ namespace BlackSound
|
|||||||
// order here is crucial, needs to be the same as in CSoundGenerator::Notification
|
// order here is crucial, needs to be the same as in CSoundGenerator::Notification
|
||||||
if (!playlist) playlist = new QMediaPlaylist(mediaPlayer);
|
if (!playlist) playlist = new QMediaPlaylist(mediaPlayer);
|
||||||
bool success = true;
|
bool success = true;
|
||||||
success = playlist->addMedia(QUrl::fromLocalFile(CBuildConfig::getSoundFilesDir() + "/error.wav")) && success;
|
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::getSoundFilesDir() + "/error.wav")) && success;
|
||||||
success = playlist->addMedia(QUrl::fromLocalFile(CBuildConfig::getSoundFilesDir() + "/login.wav")) && success;
|
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::getSoundFilesDir() + "/login.wav")) && success;
|
||||||
success = playlist->addMedia(QUrl::fromLocalFile(CBuildConfig::getSoundFilesDir() + "/logoff.wav")) && success;
|
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::getSoundFilesDir() + "/logoff.wav")) && success;
|
||||||
success = playlist->addMedia(QUrl::fromLocalFile(CBuildConfig::getSoundFilesDir() + "/privatemessage.wav")) && success;
|
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::getSoundFilesDir() + "/privatemessage.wav")) && success;
|
||||||
success = playlist->addMedia(QUrl::fromLocalFile(CBuildConfig::getSoundFilesDir() + "/voiceroomjoined.wav")) && success;
|
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::getSoundFilesDir() + "/voiceroomjoined.wav")) && success;
|
||||||
success = playlist->addMedia(QUrl::fromLocalFile(CBuildConfig::getSoundFilesDir() + "/voiceroomleft.wav")) && success;
|
success = playlist->addMedia(QUrl::fromLocalFile(CDirectoryUtils::getSoundFilesDir() + "/voiceroomleft.wav")) && success;
|
||||||
|
|
||||||
Q_ASSERT(success);
|
Q_ASSERT(success);
|
||||||
playlist->setPlaybackMode(QMediaPlaylist::CurrentItemOnce);
|
playlist->setPlaybackMode(QMediaPlaylist::CurrentItemOnce);
|
||||||
@@ -546,5 +545,4 @@ namespace BlackSound
|
|||||||
out << qd.deviceName() << endl;
|
out << qd.deviceName() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace
|
|||||||
{
|
{
|
||||||
QString xSwiftBusOriginDir()
|
QString xSwiftBusOriginDir()
|
||||||
{
|
{
|
||||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/../xswiftbus");
|
return CDirectoryUtils::getBinDir() % QStringLiteral("/../xswiftbus");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "blackgui/components/datainfoareacomponent.h"
|
#include "blackgui/components/datainfoareacomponent.h"
|
||||||
#include "blackgui/components/datamaininfoareacomponent.h"
|
#include "blackgui/components/datamaininfoareacomponent.h"
|
||||||
#include "blackgui/components/dbmappingcomponent.h"
|
#include "blackgui/components/dbmappingcomponent.h"
|
||||||
#include "blackgui/guiapplication.h"
|
#include "blackgui/guiapplication.h"
|
||||||
#include "blackmisc/icons.h"
|
#include "blackmisc/icons.h"
|
||||||
|
#include "blackmisc/directoryutils.h"
|
||||||
#include "swiftdata.h"
|
#include "swiftdata.h"
|
||||||
#include "ui_swiftdata.h"
|
#include "ui_swiftdata.h"
|
||||||
|
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
using namespace BlackConfig;
|
|
||||||
using namespace BlackGui;
|
using namespace BlackGui;
|
||||||
using namespace BlackCore;
|
using namespace BlackCore;
|
||||||
using namespace BlackGui::Components;
|
using namespace BlackGui::Components;
|
||||||
@@ -56,7 +55,7 @@ void CSwiftData::initDynamicMenus()
|
|||||||
Q_ASSERT_X(ui->comp_MainInfoArea, Q_FUNC_INFO, "missing main area");
|
Q_ASSERT_X(ui->comp_MainInfoArea, Q_FUNC_INFO, "missing main area");
|
||||||
ui->menu_InfoAreas->addActions(ui->comp_MainInfoArea->getInfoAreaSelectActions(true, ui->menu_InfoAreas));
|
ui->menu_InfoAreas->addActions(ui->comp_MainInfoArea->getInfoAreaSelectActions(true, ui->menu_InfoAreas));
|
||||||
|
|
||||||
QString resourceDir(CBuildConfig::getSwiftShareDir());
|
QString resourceDir(CDirectoryUtils::getSwiftShareDir());
|
||||||
if (!resourceDir.isEmpty() && QDir(resourceDir).exists())
|
if (!resourceDir.isEmpty() && QDir(resourceDir).exists())
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(ui->comp_MainInfoArea, Q_FUNC_INFO, "Missing main info area");
|
Q_ASSERT_X(ui->comp_MainInfoArea, Q_FUNC_INFO, "Missing main info area");
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ void CSwiftLauncher::loadAbout()
|
|||||||
// workaround:
|
// workaround:
|
||||||
// 1) Only reading as HTML gives proper formatting
|
// 1) Only reading as HTML gives proper formatting
|
||||||
// 2) Reading the file resource fails (likely because of the style sheet)
|
// 2) Reading the file resource fails (likely because of the style sheet)
|
||||||
static const QString html = CFileUtils::readFileToString(CBuildConfig::getAboutFileLocation());
|
static const QString html = CFileUtils::readFileToString(CDirectoryUtils::getAboutFileLocation());
|
||||||
static const QString legalDir = sGui->getGlobalSetup().getLegalDirectoryUrl().getFullUrl();
|
static const QString legalDir = sGui->getGlobalSetup().getLegalDirectoryUrl().getFullUrl();
|
||||||
|
|
||||||
// make links absolute
|
// make links absolute
|
||||||
@@ -265,7 +265,7 @@ void CSwiftLauncher::startSwiftCore()
|
|||||||
// I set this for debug purpose only
|
// I set this for debug purpose only
|
||||||
m_executableArgs = args;
|
m_executableArgs = args;
|
||||||
m_executable.clear();
|
m_executable.clear();
|
||||||
m_executable = CFileUtils::appendFilePaths(CDirectoryUtils::applicationDirectoryPath(), CBuildConfig::swiftCoreExecutableName());
|
m_executable = CFileUtils::appendFilePaths(CDirectoryUtils::getBinDir(), CBuildConfig::swiftCoreExecutableName());
|
||||||
if (CBuildConfig::isRunningOnMacOSXPlatform())
|
if (CBuildConfig::isRunningOnMacOSXPlatform())
|
||||||
{
|
{
|
||||||
m_executable += QLatin1String(".app/Contents/MacOS/");
|
m_executable += QLatin1String(".app/Contents/MacOS/");
|
||||||
@@ -281,7 +281,7 @@ void CSwiftLauncher::startSwiftCore()
|
|||||||
void CSwiftLauncher::setSwiftDataExecutable()
|
void CSwiftLauncher::setSwiftDataExecutable()
|
||||||
{
|
{
|
||||||
m_executable.clear();
|
m_executable.clear();
|
||||||
m_executable = CFileUtils::appendFilePaths(CDirectoryUtils::applicationDirectoryPath(), CBuildConfig::swiftDataExecutableName());
|
m_executable = CFileUtils::appendFilePaths(CDirectoryUtils::getBinDir(), CBuildConfig::swiftDataExecutableName());
|
||||||
if (CBuildConfig::isRunningOnMacOSXPlatform())
|
if (CBuildConfig::isRunningOnMacOSXPlatform())
|
||||||
{
|
{
|
||||||
m_executable += QLatin1String(".app/Contents/MacOS/");
|
m_executable += QLatin1String(".app/Contents/MacOS/");
|
||||||
@@ -293,7 +293,7 @@ void CSwiftLauncher::setSwiftDataExecutable()
|
|||||||
bool CSwiftLauncher::setSwiftGuiExecutable()
|
bool CSwiftLauncher::setSwiftGuiExecutable()
|
||||||
{
|
{
|
||||||
m_executable.clear();
|
m_executable.clear();
|
||||||
m_executable = CFileUtils::appendFilePaths(CDirectoryUtils::applicationDirectoryPath(), CBuildConfig::swiftGuiExecutableName());
|
m_executable = CFileUtils::appendFilePaths(CDirectoryUtils::getBinDir(), CBuildConfig::swiftGuiExecutableName());
|
||||||
if (CBuildConfig::isRunningOnMacOSXPlatform())
|
if (CBuildConfig::isRunningOnMacOSXPlatform())
|
||||||
{
|
{
|
||||||
m_executable += QLatin1String(".app/Contents/MacOS/");
|
m_executable += QLatin1String(".app/Contents/MacOS/");
|
||||||
|
|||||||
Reference in New Issue
Block a user