mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
refs #883, fixes and formatting
* QProcess::startDetached is static, removed startNewProcess * QStringBuilder
This commit is contained in:
committed by
Mathew Sutcliffe
parent
455d9c7b7d
commit
7bc53ada3e
@@ -45,6 +45,7 @@
|
||||
#include <QNetworkRequest>
|
||||
#include <QSslSocket>
|
||||
#include <QStandardPaths>
|
||||
#include <QStringBuilder>
|
||||
#include <QTemporaryDir>
|
||||
#include <QThread>
|
||||
#include <QTime>
|
||||
@@ -420,11 +421,14 @@ namespace BlackCore
|
||||
|
||||
QString CApplication::getEnvironmentInfoString(const QString &separator) const
|
||||
{
|
||||
QString env("Beta: ");
|
||||
env.append(boolToYesNo(CBuildConfig::isBetaTest()));
|
||||
env = env.append(" dev.env,: ").append(boolToYesNo(isRunningInDeveloperEnvironment()));
|
||||
env = env.append(separator);
|
||||
env.append("Windows: ").append(boolToYesNo(CBuildConfig::isRunningOnWindowsNtPlatform()));
|
||||
const QString env =
|
||||
QLatin1Literal("Beta: ") %
|
||||
boolToYesNo(CBuildConfig::isBetaTest()) %
|
||||
QLatin1Literal(" dev.env,: ") %
|
||||
boolToYesNo(isRunningInDeveloperEnvironment()) %
|
||||
separator %
|
||||
QLatin1Literal("Windows: ") %
|
||||
boolToYesNo(CBuildConfig::isRunningOnWindowsNtPlatform());
|
||||
return env;
|
||||
}
|
||||
|
||||
@@ -465,12 +469,13 @@ namespace BlackCore
|
||||
|
||||
QString CApplication::getInfoString(const QString &separator) const
|
||||
{
|
||||
QString str(CVersion::version());
|
||||
str = str.append(" ").append(CBuildConfig::isReleaseBuild() ? "Release build" : "Debug build");
|
||||
str = str.append(separator);
|
||||
str = str.append(getEnvironmentInfoString(separator));
|
||||
str = str.append(separator);
|
||||
str.append(CBuildConfig::compiledWithInfo(false));
|
||||
const QString str =
|
||||
CVersion::version() %
|
||||
QLatin1Char(' ') % (CBuildConfig::isReleaseBuild() ? QLatin1Literal("Release build") : QLatin1Literal("Debug build")) %
|
||||
separator %
|
||||
getEnvironmentInfoString(separator) %
|
||||
separator %
|
||||
CBuildConfig::compiledWithInfo(false);
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -1077,13 +1082,13 @@ namespace BlackCore
|
||||
if (isUnitTest()) { return CStatusMessage(this).info("No crash handler for unit tests"); }
|
||||
|
||||
static const QString extension = CBuildConfig::isRunningOnWindowsNtPlatform() ? ".exe" : QString();
|
||||
static const QString handler = CDirectoryUtils::applicationDirectoryPath() + "/" + "swift_crashpad_handler" + extension;
|
||||
static const QString crashpadPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
|
||||
"/org.swift-project/" +
|
||||
CDirectoryUtils::normalizedApplicationDirectory() +
|
||||
"/crashpad";
|
||||
static const QString database = crashpadPath + "/database";
|
||||
static const QString metrics = crashpadPath + "/metrics";
|
||||
static const QString handler = CDirectoryUtils::applicationDirectoryPath() % QLatin1Char('/') % "swift_crashpad_handler" + extension;
|
||||
static const QString crashpadPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) %
|
||||
QLatin1Literal("/org.swift-project/") %
|
||||
CDirectoryUtils::normalizedApplicationDirectory() %
|
||||
QLatin1Literal("/crashpad");
|
||||
static const QString database = crashpadPath % QLatin1Literal("/database");
|
||||
static const QString metrics = crashpadPath % QLatin1Literal("/metrics");
|
||||
|
||||
if (!QFileInfo::exists(handler))
|
||||
{
|
||||
|
||||
@@ -22,8 +22,7 @@ namespace BlackMisc
|
||||
bool startWindowsMixer()
|
||||
{
|
||||
if (!CBuildConfig::isRunningOnWindowsNtPlatform()) { return false; }
|
||||
QStringList parameterlist;
|
||||
return QProcess::startDetached("SndVol.exe", parameterlist);
|
||||
return QProcess::startDetached("SndVol.exe");
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -47,8 +47,8 @@ int main(int argc, char *argv[])
|
||||
if (launcher.exec() == QDialog::Rejected) { return EXIT_SUCCESS; }
|
||||
launcher.close();
|
||||
|
||||
QString exe(launcher.getExecutable());
|
||||
QStringList exeArgs(launcher.getExecutableArgs());
|
||||
const QString exe(launcher.getExecutable());
|
||||
const QStringList exeArgs(launcher.getExecutableArgs());
|
||||
Q_ASSERT_X(!exe.isEmpty(), Q_FUNC_INFO, "Missing executable");
|
||||
CLogMessage(QCoreApplication::instance()).info(launcher.getCmdLine());
|
||||
QProcess::startDetached(exe, exeArgs);
|
||||
|
||||
@@ -41,7 +41,6 @@ class CSwiftLauncher :
|
||||
Q_INTERFACES(BlackGui::IMainWindowAccess)
|
||||
|
||||
public:
|
||||
|
||||
//! Pages
|
||||
enum Pages
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user