mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refactor: Remove shortcuts to start launcher
This commit is contained in:
@@ -257,47 +257,6 @@ namespace swift::core
|
||||
return s;
|
||||
}
|
||||
|
||||
QString CApplication::getExecutableForApplication(CApplicationInfo::Application application) const
|
||||
{
|
||||
QString searchFor;
|
||||
switch (application)
|
||||
{
|
||||
case CApplicationInfo::PilotClientCore: searchFor = "core"; break;
|
||||
case CApplicationInfo::Launcher: searchFor = "launcher"; break;
|
||||
case CApplicationInfo::MappingTool: searchFor = "data"; break;
|
||||
case CApplicationInfo::PilotClientGui: searchFor = "gui"; break;
|
||||
default: break;
|
||||
}
|
||||
if (searchFor.isEmpty()) { return {}; }
|
||||
|
||||
for (const QString &executable : CFileUtils::getSwiftExecutables())
|
||||
{
|
||||
if (!executable.contains("swift", Qt::CaseInsensitive)) { continue; }
|
||||
if (executable.contains(searchFor, Qt::CaseInsensitive)) { return executable; }
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
bool CApplication::startLauncher()
|
||||
{
|
||||
static const QString launcher =
|
||||
CApplication::getExecutableForApplication(CApplicationInfo::Application::Launcher);
|
||||
if (launcher.isEmpty() || CApplication::isApplicationRunning(CApplicationInfo::Launcher)) { return false; }
|
||||
|
||||
// const QStringList args = this->argumentsJoined({}, { "--dbus", "--core", "--coreaudio" });
|
||||
const QStringList args = this->argumentsJoined({}, { "--dbus", "--core" });
|
||||
return QProcess::startDetached(launcher, args);
|
||||
}
|
||||
|
||||
bool CApplication::startLauncherAndQuit()
|
||||
{
|
||||
const bool started = CApplication::startLauncher();
|
||||
if (!started) { return false; }
|
||||
this->gracefulShutdown();
|
||||
CApplication::exit();
|
||||
return true;
|
||||
}
|
||||
|
||||
CGlobalSetup CApplication::getGlobalSetup() const
|
||||
{
|
||||
if (m_shutdown) { return CGlobalSetup(); }
|
||||
|
||||
Reference in New Issue
Block a user