mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-04 02:12:21 +08:00
!118 fix: high CPU usage because futex is still waiting for queue after illegal exit
* fix * Merge remote-tracking branch 'upstream/dev' into dev * fix: high CPU usage because futex is still waiting for queue after illegal exit * Merge remote-tracking branch 'upstream/master' into dev * Merge remote-tracking branch 'upstream/dev' into dev * feat: enable GPU * !113 3.2.1 merge * !112 Now stop use mail to collect info * Merge remote-tracking branch 'upstream/dev' into dev * Merge branch 'dev' of gitee.com:uniartisan2018/spark-store into dev * feat: 清除网页缓存 * 文案修改 * update src/widget.ui. * feat: 星火应用商店检测更新
This commit is contained in:
parent
beaeac60a3
commit
8902c81b9e
@ -18,6 +18,7 @@
|
||||
#include <QSettings>
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#include <QtConcurrent> // 并发
|
||||
#include <QCloseEvent> // close event
|
||||
|
||||
#include <DApplication>
|
||||
#include <DGuiApplicationHelper>
|
||||
@ -572,14 +573,14 @@ void Widget::chooseLeftMenu(int index)
|
||||
|
||||
updateUI();
|
||||
|
||||
if(index <= 12)
|
||||
if (index <= 12)
|
||||
{
|
||||
if(themeIsDark)
|
||||
if (themeIsDark)
|
||||
{
|
||||
QString darkurl = menuUrl[index].toString();
|
||||
QStringList list = darkurl.split("/");
|
||||
darkurl.clear();
|
||||
for(int i = 0; i < list.size() - 1; i++)
|
||||
for (int i = 0; i < list.size() - 1; i++)
|
||||
{
|
||||
darkurl += list[i] + "/";
|
||||
}
|
||||
@ -687,22 +688,18 @@ void Widget::searchApp(QString text)
|
||||
}
|
||||
else
|
||||
{
|
||||
// sendNotification(tr("Spark store could only process spk:// links for now. The search feature is coming soon!"));
|
||||
// ui->webView->setUrl(QUrl("http://www.baidu.com/s?wd="+text)); // 这东西对接百度
|
||||
// ui->stackedWidget->setCurrentIndex(0);
|
||||
|
||||
// 禁止同时进行多次搜索
|
||||
if(!mutex.tryLock())
|
||||
if (!mutex.tryLock())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 关键字搜索处理
|
||||
httpClient->get("https://search.deepinos.org.cn/appinfo/search")
|
||||
.header("content-type", "application/json")
|
||||
.queryParam("keyword", text)
|
||||
.onResponse([this](QByteArray result)
|
||||
{
|
||||
.header("content-type", "application/json")
|
||||
.queryParam("keyword", text)
|
||||
.onResponse([this](QByteArray result)
|
||||
{
|
||||
auto json = QJsonDocument::fromJson(result).array();
|
||||
if (json.empty())
|
||||
{
|
||||
@ -711,20 +708,24 @@ void Widget::searchApp(QString text)
|
||||
mutex.unlock();
|
||||
return;
|
||||
}
|
||||
displaySearchApp(json);
|
||||
})
|
||||
.onError([this](QString errorStr)
|
||||
{
|
||||
displaySearchApp(json); })
|
||||
.onError([this](QString errorStr)
|
||||
{
|
||||
qDebug() << "请求出错:" << errorStr;
|
||||
sendNotification(QString(tr("Request Error: %1")).arg(errorStr));
|
||||
mutex.unlock();
|
||||
return;
|
||||
})
|
||||
.timeout(10 * 1000)
|
||||
.exec();
|
||||
return; })
|
||||
.timeout(10 * 1000)
|
||||
.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
mutex.unlock();
|
||||
httpClient->deleteLater();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 展示搜索的APP信息
|
||||
*/
|
||||
|
@ -128,6 +128,7 @@ private:
|
||||
void setfoot(int);
|
||||
void updatefoot();
|
||||
void updateUI();
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
quint64 dirFileSize(const QString &path);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user