| 1140 | } |
| 1141 | |
| 1142 | void 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 | |
| 1182 | bool Application::openLocalUrl(const QString &url, QVariant context) { |
| 1183 | const auto urlTrimmed = url.trimmed(); |
no test coverage detected