MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / run

Method run

Telegram/SourceFiles/core/application.cpp:265–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265void Application::run() {
266 EnhancedSettings::Start();
267 // Depends on OpenSSL on macOS, so on ThirdParty::start().
268 // Depends on notifications settings.
269 _notifications = std::make_unique<Window::Notifications::System>();
270
271 startLocalStorage();
272
273 style::SetCustomFont(settings().customFontFamily());
274 style::internal::StartFonts();
275
276 ValidateScale();
277
278 refreshGlobalProxy(); // Depends on app settings being read.
279
280 if (const auto old = Local::oldSettingsVersion(); old < AppVersion) {
281 autoRegisterUrlScheme();
282 Platform::NewVersionLaunched(old);
283 }
284
285 if (cAutoStart() && !Platform::AutostartSupported()) {
286 cSetAutoStart(false);
287 }
288
289 if (cLaunchMode() == LaunchModeAutoStart && Platform::AutostartSkip()) {
290 Platform::AutostartToggle(false);
291 Quit();
292 return;
293 }
294
295 _translator = std::make_unique<Lang::Translator>();
296 QCoreApplication::instance()->installTranslator(_translator.get());
297
298 style::StartManager(cScale());
299 Ui::Accessible::Init();
300 Ui::InitTextOptions();
301 Ui::StartCachedCorners();
302 Ui::Emoji::Init();
303 Ui::PreloadTextSpoilerMask();
304 startShortcuts();
305 startEmojiImageLoader();
306 startSystemDarkModeViewer();
307 Media::Player::start(_audio.get());
308
309 if (MediaControlsManager::Supported()) {
310 _mediaControlsManager = std::make_unique<MediaControlsManager>();
311 }
312
313 rpl::combine(
314 _batterySaving->value(),
315 settings().ignoreBatterySavingValue()
316 ) | rpl::on_next([=](bool saving, bool ignore) {
317 PowerSaving::SetForceAll(saving && !ignore);
318 }, _lifetime);
319
320 style::ShortAnimationPlaying(
321 ) | rpl::on_next([=](bool playing) {
322 if (playing) {

Callers 3

configure.pyFile · 0.45
launchApplicationMethod · 0.45
UnsafeShowOpenWithFunction · 0.45

Calls 15

ValidateScaleFunction · 0.85
oldSettingsVersionFunction · 0.85
QuitFunction · 0.85
cScaleFunction · 0.85
InitTextOptionsFunction · 0.85
StartCachedCornersFunction · 0.85
SetForceAllFunction · 0.85
pauseFunction · 0.85
unpauseFunction · 0.85
ErrorsClass · 0.85
SetCrashAnnotationsGLFunction · 0.85
customFontFamilyMethod · 0.80

Tested by

no test coverage detected