2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +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:
Ilya Fedin
2023-06-13 04:34:27 +04:00
committed by John Preston
parent 63ccf1bed4
commit a7bd097b2f
13 changed files with 50 additions and 70 deletions

View File

@@ -281,6 +281,8 @@ base::options::toggle OptionFractionalScalingEnabled({
const char kOptionFractionalScalingEnabled[] = "fractional-scaling-enabled";
const char kOptionFreeType[] = "freetype";
Launcher *Launcher::InstanceSetter::Instance = nullptr;
std::unique_ptr<Launcher> Launcher::Create(int argc, char *argv[]) {
return std::make_unique<Platform::Launcher>(argc, argv);
}
@@ -294,6 +296,10 @@ Launcher::Launcher(int argc, char *argv[])
base::Integration::Set(&_baseIntegration);
}
Launcher::~Launcher() {
InstanceSetter::Instance = nullptr;
}
void Launcher::init() {
_arguments = readArguments(_argc, _argv);
@@ -558,7 +564,7 @@ void Launcher::processArguments() {
int Launcher::executeApplication() {
FilteredCommandLineArguments arguments(_argc, _argv);
Sandbox sandbox(this, arguments.count(), arguments.values());
Sandbox sandbox(arguments.count(), arguments.values());
Ui::MainQueueProcessor processor;
base::ConcurrentTimerEnvironment environment;
return sandbox.start();