feat: ISSUE #I67K8Y 新增 spk://search/keyword 链接格式解析

支持打开该链接跳转搜索页面(禁止直接搜索 %,搜索结果过多会导致搜索页面 QtWebEngine 进程崩溃,无法继续搜索)

Log: 支持链接跳转搜索结果页面;暂不支持直接跳转到应用详情页
This commit is contained in:
zty199
2023-01-30 16:15:07 +08:00
parent 1a89c2a1a6
commit 4b40e3caca
5 changed files with 35 additions and 17 deletions

View File

@@ -56,7 +56,7 @@ void AppListPage::getAppList(QString type)
delete api;
}
void AppListPage::getSearchList(QString keyword)
void AppListPage::getSearchList(const QString &keyword)
{
isSearch = true;
nowType = keyword;
@@ -71,7 +71,7 @@ void AppListPage::getSearchList(QString keyword)
{
theme = "theme=light";
}
url = api->getServerUrl() + "store/#/flamescion/search?keywords=" + keyword + "&" + theme;
url = api->getServerUrl() + "store/#/flamescion/search?keywords=" + QUrl::toPercentEncoding(keyword) + "&" + theme;
ui->webEngineView->setUrl(url);
delete api;
}

View File

@@ -14,7 +14,7 @@ class AppListPage : public QWidget
public:
void setTheme(bool dark);
void getSearchList(QString keyword);
void getSearchList(const QString &keyword);
void getAppList(QString type);
explicit AppListPage(QWidget *parent = nullptr);
~AppListPage();