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

Method checkStartUrls

Telegram/SourceFiles/core/application.cpp:1142–1180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1140}
1141
1142void Application::checkStartUrls() {
1143 if (!Core::App().passcodeLocked()) {
1144 cRefStartUrls() = ranges::views::all(
1145 cRefStartUrls()
1146 ) | ranges::views::filter([&](const QUrl &url) {
1147 if (url.scheme() == u"tonsite"_q) {
1148 iv().showTonSite(url.toString(), {});
1149 return false;
1150 } else if (_lastActivePrimaryWindow) {
1151 const auto local = TryConvertUrlToLocal(url.toString());
1152 return !openLocalUrl(local, {});
1153 }
1154 return true;
1155 }) | ranges::to<QList<QUrl>>;
1156 }
1157 if (!cRefStartUrls().isEmpty()
1158 && _lastActivePrimaryWindow
1159 && !_lastActivePrimaryWindow->locked()) {
1160 auto interprets = QStringList();
1161 auto paths = QStringList();
1162 cRefStartUrls() = ranges::views::all(
1163 cRefStartUrls()
1164 ) | ranges::views::filter([&](const QUrl &url) {
1165 if (url.scheme() == u"interpret"_q) {
1166 interprets.append(url.path());
1167 return false;
1168 } else if (url.isLocalFile()) {
1169 paths.append(url.toLocalFile());
1170 return false;
1171 }
1172 return true;
1173 }) | ranges::to<QList<QUrl>>;
1174 if (!interprets.isEmpty() || !paths.isEmpty()) {
1175 _lastActivePrimaryWindow->widget()->handleStartFiles(
1176 std::move(interprets),
1177 std::move(paths));
1178 }
1179 }
1180}
1181
1182bool Application::openLocalUrl(const QString &url, QVariant context) {
1183 const auto urlTrimmed = url.trimmed();

Callers 4

clearSetupEmailLockMethod · 0.80
clearPasscodeLockMethod · 0.80
setupMainMethod · 0.80
readClientsMethod · 0.80

Calls 10

AppClass · 0.85
TryConvertUrlToLocalFunction · 0.85
passcodeLockedMethod · 0.80
showTonSiteMethod · 0.45
isEmptyMethod · 0.45
lockedMethod · 0.45
appendMethod · 0.45
pathMethod · 0.45
handleStartFilesMethod · 0.45
widgetMethod · 0.45

Tested by

no test coverage detected