diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2022-11-01 17:19:54 +0000 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2022-11-01 17:19:54 +0000 |
commit | d03ae34b61b6c61d0afd4a5ba0d27347c87b0726 (patch) | |
tree | 4f6becc543bb1a5a4dbf5f50ebed54a7896d889c /launcher/ui/pages | |
parent | b9547adce7c7222a2d3c8dc455e7619f2be7a221 (diff) | |
download | PrismLauncher-d03ae34b61b6c61d0afd4a5ba0d27347c87b0726.tar.gz PrismLauncher-d03ae34b61b6c61d0afd4a5ba0d27347c87b0726.tar.bz2 PrismLauncher-d03ae34b61b6c61d0afd4a5ba0d27347c87b0726.zip |
Auto-select first result
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/ui/pages')
-rw-r--r-- | launcher/ui/pages/modplatform/ModPage.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp index 7f62fff1..780750a8 100644 --- a/launcher/ui/pages/modplatform/ModPage.cpp +++ b/launcher/ui/pages/modplatform/ModPage.cpp @@ -261,8 +261,7 @@ void ModPage::openUrl(const QUrl& url) && url.path().startsWith("/mod/")) { prefixLength = 5; page = "modrinth"; - } - else if (APPLICATION->capabilities() & Application::SupportsFlame + } else if (APPLICATION->capabilities() & Application::SupportsFlame && url.host() == "www.curseforge.com" && url.path().toLower().startsWith("/minecraft/mc-mods/")) { prefixLength = 19; @@ -282,9 +281,14 @@ void ModPage::openUrl(const QUrl& url) // and the user isn't opening the same mod; they probably // intended to view in their web browser if (!slug.isEmpty() && !slug.contains('/') && slug != current.slug) { - ui->searchEdit->setText(slug); dialog->selectPage(page); + ui->searchEdit->setText(slug); + triggerSearch(); + connect(listModel->activeJob(), &Task::finished, [this] { + ui->packView->setCurrentIndex(listModel->index(0)); + }); + return; } } |