mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Smaller adjustments of unit test and application
This commit is contained in:
@@ -359,8 +359,10 @@ namespace BlackCore
|
||||
// crashpad dump
|
||||
if (this->isSet(m_cmdTestCrashpad))
|
||||
{
|
||||
QPointer<CApplication> myself(this);
|
||||
QTimer::singleShot(10 * 1000, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
#ifdef BLACK_USE_CRASHPAD
|
||||
CRASHPAD_SIMULATE_CRASH();
|
||||
#else
|
||||
@@ -547,7 +549,7 @@ namespace BlackCore
|
||||
CSettingsCache::instance()->saveToStore(keys);
|
||||
}
|
||||
|
||||
QString CApplication::getTemporaryDirectory() const
|
||||
QString CApplication::getTemporaryDirectory()
|
||||
{
|
||||
static const QTemporaryDir tempDir;
|
||||
if (tempDir.isValid()) { return tempDir.path(); }
|
||||
|
||||
@@ -184,12 +184,12 @@ namespace BlackCore
|
||||
//! Comprehensive info
|
||||
QString getInfoString(const QString &separator) const;
|
||||
|
||||
//! Directory for temporary files
|
||||
QString getTemporaryDirectory() const;
|
||||
|
||||
//! Stop and restart application
|
||||
void restartApplication(const QStringList &newArguments = {}, const QStringList &removeArguments = {});
|
||||
|
||||
//! Directory for temporary files
|
||||
static QString getTemporaryDirectory();
|
||||
|
||||
//! Register as running
|
||||
//! \note Normally done automatically when CApplication::exec is called
|
||||
static bool registerAsRunning();
|
||||
|
||||
@@ -334,7 +334,7 @@ namespace BlackGui
|
||||
void CDbOwnModelSetComponent::showAirlineAircraftMatrix() const
|
||||
{
|
||||
const CAircraftModelList set(this->getModelSetFromView());
|
||||
const QString file = CAircraftModelUtilities::createIcaoAirlineAircraftHtmlMatrixFile(set, sGui->getTemporaryDirectory());
|
||||
const QString file = CAircraftModelUtilities::createIcaoAirlineAircraftHtmlMatrixFile(set, CGuiApplication::getTemporaryDirectory());
|
||||
if (file.isEmpty()) { return; }
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(file));
|
||||
}
|
||||
|
||||
@@ -32,12 +32,11 @@ int main(int argc, char *argv[])
|
||||
a.addVatlibOptions();
|
||||
const bool setup = a.parseAndSynchronizeSetup();
|
||||
if (!setup) { qWarning() << "No setup loaded"; }
|
||||
if (!a.start())
|
||||
int r = EXIT_FAILURE;
|
||||
if (a.start())
|
||||
{
|
||||
a.gracefulShutdown();
|
||||
return EXIT_FAILURE;
|
||||
r = CBlackCoreTestMain::unitMain(argc, argv);
|
||||
}
|
||||
const int r = CBlackCoreTestMain::unitMain(argc, argv);
|
||||
a.gracefulShutdown();
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user