mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-03 01:42:20 +08:00
chore: 修复投递链接;新增应用升级判断
fix: 修复投递链接; chore: 应用详情页支持判断是否需要升级。
This commit is contained in:
parent
9def55a2c2
commit
adf8b478a8
@ -198,7 +198,7 @@ void Widget::initUI()
|
|||||||
menu->addAction(actionSubmission);
|
menu->addAction(actionSubmission);
|
||||||
titlebar->setMenu(menu);
|
titlebar->setMenu(menu);
|
||||||
|
|
||||||
connect(actionSubmission, &QAction::triggered, this, [=]{QDesktopServices::openUrl(QUrl("https://upload.spark-app.store/"));});
|
connect(actionSubmission, &QAction::triggered, this, [=]{QDesktopServices::openUrl(QUrl("https://upload.deepinos.org/"));});
|
||||||
connect(setting, &QAction::triggered, this, &Widget::opensetting);
|
connect(setting, &QAction::triggered, this, &Widget::opensetting);
|
||||||
|
|
||||||
// 载入自定义字体
|
// 载入自定义字体
|
||||||
@ -863,7 +863,7 @@ void Widget::sltAppinfoTags(QStringList *tagList)
|
|||||||
|
|
||||||
void Widget::sltAppinfoDetails(QString *name, QString *details, QString *info,
|
void Widget::sltAppinfoDetails(QString *name, QString *details, QString *info,
|
||||||
QString *website, QString *packageName, QUrl *fileUrl,
|
QString *website, QString *packageName, QUrl *fileUrl,
|
||||||
bool isInstalled)
|
bool isInstalled, bool isUpdated)
|
||||||
{
|
{
|
||||||
ui->label_appname->setText(appName = *name);
|
ui->label_appname->setText(appName = *name);
|
||||||
ui->label_appname->show();
|
ui->label_appname->show();
|
||||||
@ -878,8 +878,16 @@ void Widget::sltAppinfoDetails(QString *name, QString *details, QString *info,
|
|||||||
|
|
||||||
if(isInstalled)
|
if(isInstalled)
|
||||||
{
|
{
|
||||||
ui->pushButton_download->setText(tr("Reinstall"));
|
if(isUpdated)
|
||||||
ui->pushButton_uninstall->show();
|
{
|
||||||
|
ui->pushButton_download->setText(tr("Reinstall"));
|
||||||
|
ui->pushButton_uninstall->show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->pushButton_download->setText(tr("Upgrade"));
|
||||||
|
ui->pushButton_uninstall->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -75,8 +75,9 @@ private slots:
|
|||||||
void sltAppinfoResetUi();
|
void sltAppinfoResetUi();
|
||||||
void sltAppinfoTags(QStringList *tagList);
|
void sltAppinfoTags(QStringList *tagList);
|
||||||
void sltAppinfoDetails(QString *name, QString *details, QString *info,
|
void sltAppinfoDetails(QString *name, QString *details, QString *info,
|
||||||
QString *website, QString *packageName,
|
QString *website, QString *packageName,
|
||||||
QUrl *fileUrl, bool isInstalled);
|
QUrl *fileUrl, bool isInstalled,
|
||||||
|
bool isUpdated);
|
||||||
void sltAppinfoIcon(QPixmap *icon);
|
void sltAppinfoIcon(QPixmap *icon);
|
||||||
void sltAppinfoScreenshot(QPixmap *picture, int index);
|
void sltAppinfoScreenshot(QPixmap *picture, int index);
|
||||||
void sltAppinfoFinish();
|
void sltAppinfoFinish();
|
||||||
|
@ -21,6 +21,7 @@ void SpkAppInfoLoaderThread::run()
|
|||||||
qDebug() << "请求应用信息 " << json_array;
|
qDebug() << "请求应用信息 " << json_array;
|
||||||
QString urladdress, deatils, more, packagename, appweb;
|
QString urladdress, deatils, more, packagename, appweb;
|
||||||
bool isInstalled;
|
bool isInstalled;
|
||||||
|
bool isUpdated;
|
||||||
|
|
||||||
// 将路径转化为相应源的下载路径
|
// 将路径转化为相应源的下载路径
|
||||||
urladdress = targetUrl.toString().left(targetUrl.toString().length() - 8);
|
urladdress = targetUrl.toString().left(targetUrl.toString().length() - 8);
|
||||||
@ -70,13 +71,31 @@ void SpkAppInfoLoaderThread::run()
|
|||||||
if(error == 0)
|
if(error == 0)
|
||||||
{
|
{
|
||||||
isInstalled = true;
|
isInstalled = true;
|
||||||
|
|
||||||
|
QProcess isUpdate;
|
||||||
|
isUpdate.start("dpkg-query --showformat='${Version}' --show " + json["Pkgname"].toString());
|
||||||
|
isUpdate.waitForFinished();
|
||||||
|
QString localVersion = isUpdate.readAllStandardOutput();
|
||||||
|
localVersion.replace("'", "");
|
||||||
|
|
||||||
|
isUpdate.start("dpkg --compare-versions " + localVersion + " ge " + json["Version"].toString());
|
||||||
|
isUpdate.waitForFinished();
|
||||||
|
if(!isUpdate.exitCode())
|
||||||
|
{
|
||||||
|
isUpdated = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isUpdated = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
isInstalled = false;
|
isInstalled = false;
|
||||||
|
isUpdated = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit requestSetAppInformation(&appName, &details, &more, &appweb, &packagename, &fileUrl, isInstalled);
|
emit requestSetAppInformation(&appName, &details, &more, &appweb, &packagename, &fileUrl, isInstalled, isUpdated);
|
||||||
|
|
||||||
// tag 加载
|
// tag 加载
|
||||||
QString tags = json["Tags"].toString();
|
QString tags = json["Tags"].toString();
|
||||||
|
@ -40,7 +40,8 @@ signals:
|
|||||||
void requestSetTags(QStringList *tagList);
|
void requestSetTags(QStringList *tagList);
|
||||||
void requestSetAppInformation(QString *name, QString *details, QString *info,
|
void requestSetAppInformation(QString *name, QString *details, QString *info,
|
||||||
QString *website, QString *packageName,
|
QString *website, QString *packageName,
|
||||||
QUrl *fileUrl, bool isInstalled);
|
QUrl *fileUrl, bool isInstalled,
|
||||||
|
bool isUpdated);
|
||||||
void finishedIconLoad(QPixmap *icon);
|
void finishedIconLoad(QPixmap *icon);
|
||||||
void finishedScreenshotLoad(QPixmap *icon, int index); // 该信号必须以 BlockingQueued 方式连接
|
void finishedScreenshotLoad(QPixmap *icon, int index); // 该信号必须以 BlockingQueued 方式连接
|
||||||
void finishAllLoading(); // 该信号必须以 BlockingQueued 方式连接
|
void finishAllLoading(); // 该信号必须以 BlockingQueued 方式连接
|
||||||
|
Loading…
x
Reference in New Issue
Block a user