mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Have a global Core::Launcher accessor
This allows to use Launcher in code executing before Sandbox is created
This commit is contained in:
@@ -143,9 +143,8 @@ struct Application::Private {
|
||||
Settings settings;
|
||||
};
|
||||
|
||||
Application::Application(not_null<Launcher*> launcher)
|
||||
Application::Application()
|
||||
: QObject()
|
||||
, _launcher(launcher)
|
||||
, _private(std::make_unique<Private>())
|
||||
, _platformIntegration(Platform::Integration::Create())
|
||||
, _batterySaving(std::make_unique<base::BatterySaving>())
|
||||
@@ -945,11 +944,11 @@ rpl::producer<> Application::materializeLocalDraftsRequests() const {
|
||||
void Application::switchDebugMode() {
|
||||
if (Logs::DebugEnabled()) {
|
||||
Logs::SetDebugEnabled(false);
|
||||
_launcher->writeDebugModeSetting();
|
||||
Launcher::Instance().writeDebugModeSetting();
|
||||
Restart();
|
||||
} else {
|
||||
Logs::SetDebugEnabled(true);
|
||||
_launcher->writeDebugModeSetting();
|
||||
Launcher::Instance().writeDebugModeSetting();
|
||||
DEBUG_LOG(("Debug logs started."));
|
||||
if (_lastActivePrimaryWindow) {
|
||||
_lastActivePrimaryWindow->hideLayer();
|
||||
@@ -957,10 +956,6 @@ void Application::switchDebugMode() {
|
||||
}
|
||||
}
|
||||
|
||||
void Application::writeInstallBetaVersionsSetting() {
|
||||
_launcher->writeInstallBetaVersionsSetting();
|
||||
}
|
||||
|
||||
Main::Account &Application::activeAccount() const {
|
||||
return _domain->active();
|
||||
}
|
||||
@@ -1770,7 +1765,7 @@ void Application::RegisterUrlScheme() {
|
||||
.executable = (!Platform::IsLinux() || !Core::UpdaterDisabled())
|
||||
? (cExeDir() + cExeName())
|
||||
: cExeName(),
|
||||
.arguments = Sandbox::Instance().customWorkingDir()
|
||||
.arguments = Launcher::Instance().customWorkingDir()
|
||||
? u"-workdir \"%1\""_q.arg(cWorkingDir())
|
||||
: QString(),
|
||||
.protocol = u"tg"_q,
|
||||
|
Reference in New Issue
Block a user