setup: Enhance URL Handling to Support Partial Inputs (#30681)

* easy urls

* better
pull/30859/head
royjr 1 year ago committed by GitHub
parent a1f53c70e6
commit 4df85062c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      selfdrive/ui/qt/setup/setup.cc

@ -34,6 +34,11 @@ bool is_elf(char *fname) {
}
void Setup::download(QString url) {
// autocomplete incomplete urls
if (QRegularExpression("^([^/.]+)/([^/]+)$").match(url).hasMatch()) {
url.prepend("https://installer.comma.ai/");
}
CURL *curl = curl_easy_init();
if (!curl) {
emit finished(url, tr("Something went wrong. Reboot the device."));

Loading…
Cancel
Save