Merge branch 'Reason' of gitee.com:deepin-community-store/spark-store into Reason

This commit is contained in:
2023-03-05 22:51:47 +08:00
15 changed files with 308 additions and 542 deletions

View File

@@ -95,7 +95,7 @@ void Application::setBuildDateTime(const QString &buildDateTime)
config.sync();
}
setApplicationVersion(DApplication::buildVersion(QString(APP_VERSION) + "-" + "Flamescion" + "-" + buildDateTime));
setApplicationVersion(DApplication::buildVersion(QString(APP_VERSION) + "-" + "Reason" + "-" + buildDateTime));
}
void Application::setMainWindow(MainWindow *window)

View File

@@ -54,7 +54,7 @@ void SparkAPI::getRAW(QUrl url)
void SparkAPI::getAppList(QString type)
{
get(QUrl(getServerUrl() + "store/" + type + "/applist.json"));
get(QUrl(getServerUrl() + "aarch64-store/" + type + "/applist.json"));
}
void SparkAPI::getSearchList(QString keyword)
@@ -64,12 +64,12 @@ void SparkAPI::getSearchList(QString keyword)
void SparkAPI::getAppInfo(QUrl spk)
{
get(QUrl(getServerUrl() + "store" + spk.path().replace("+", "%2B") + "/app.json"));
get(QUrl(getServerUrl() + "aarch64-store" + spk.path().replace("+", "%2B") + "/app.json"));
}
void SparkAPI::getAppDownloadTimes(QUrl spk)
{
getRAW(QUrl(getServerUrl() + "store" + spk.path().replace("+", "%2B") + "/download-times.txt"));
getRAW(QUrl(getServerUrl() + "aarch64-store" + spk.path().replace("+", "%2B") + "/download-times.txt"));
}
QString SparkAPI::getServerUrl()

View File

@@ -55,8 +55,8 @@ void AppIntoPage::openUrl(const QUrl &url)
// 获取图标
QNetworkRequest request;
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
qDebug() << api->getImgServerUrl() + "store" + url.path() + "/icon.png";
request.setUrl(QUrl(api->getImgServerUrl() + "store" + url.path() + "/icon.png"));
qDebug() << api->getImgServerUrl() + "aarch64-store" + url.path() + "/icon.png";
request.setUrl(QUrl(api->getImgServerUrl() + "aarch64-store" + url.path() + "/icon.png"));
request.setRawHeader("User-Agent", "Mozilla/5.0");
request.setRawHeader("Content-Type", "charset='utf-8'");
manager->get(request);
@@ -175,7 +175,7 @@ void AppIntoPage::openUrl(const QUrl &url)
ui->downloadButton->show();
}
isDownloading(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString());
isDownloading(SparkAPI::getServerUrl() + "aarch64-store" + spk.path() + "/" + info["Filename"].toString());
}
api1->disconnect();
@@ -267,7 +267,7 @@ void AppIntoPage::setDownloadWidget(DownloadListWidget *w)
dw = w;
connect(w, &DownloadListWidget::downloadFinished, [=]()
{ isDownloading(SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString()); });
{ isDownloading(SparkAPI::getServerUrl() + "aarch64-store" + spk.path() + "/" + info["Filename"].toString()); });
}
void AppIntoPage::initUI()
@@ -375,7 +375,7 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
void AppIntoPage::on_downloadButton_clicked()
{
QString downloadUrl = SparkAPI::getServerUrl() + "store" + spk.path() + "/" + info["Filename"].toString();
QString downloadUrl = SparkAPI::getServerUrl() + "aarch64-store" + spk.path() + "/" + info["Filename"].toString();
if (ui->downloadButton->text() == tr("Install"))
{
DownloadItem *item = dw->getDIList()[dw->getUrlList().lastIndexOf(downloadUrl)];

View File

@@ -37,19 +37,19 @@ void AppListPage::getAppList(QString type)
QString theme;
if (isDark)
{
theme = "theme=dark";
theme = "dark";
}
else
{
theme = "theme=light";
theme = "";
}
if (type == "")
{
url = api->getServerUrl() + "store/#/flamescion/?" + theme;
url = api->getServerUrl() + "aarch64-store/#/"+ theme;
}
else
{
url = api->getServerUrl() + "store/#/flamescion/applist?type=" + type + "&" + theme;
url = api->getServerUrl() + "aarch64-store/#/"+ theme + type;
}
ui->webEngineView->setUrl(url);
@@ -86,7 +86,7 @@ void AppListPage::on_webEngineView_urlChanged(const QUrl &arg1)
if (arg1.path().right(8) == "app.json")
{
QString url = arg1.toString();
url = url.mid(url.indexOf("/store/"));
url = url.mid(url.indexOf("/aarch64-store/"));
url = "spk:/" + url;
url = url.mid(0, url.indexOf("/app.json"));
qDebug() << "程序跳转链接地址:" << url;