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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user