From 8902c81b9ec5bb13c493df5d754a79bcdc77559d Mon Sep 17 00:00:00 2001 From: Pluto Date: Tue, 27 Sep 2022 01:34:18 +0000 Subject: [PATCH 1/4] =?UTF-8?q?!118=20fix:=20high=20CPU=20usage=20because?= =?UTF-8?q?=20futex=20is=20still=20waiting=20for=20queue=20after=20illegal?= =?UTF-8?q?=20exit=20*=20fix=20*=20Merge=20remote-tracking=20branch=20'ups?= =?UTF-8?q?tream/dev'=20into=20dev=20*=20fix:=20high=20CPU=20usage=20becau?= =?UTF-8?q?se=20futex=20is=20still=20waiting=20for=20queue=20after=20illeg?= =?UTF-8?q?al=20exit=20*=20Merge=20remote-tracking=20branch=20'upstream/ma?= =?UTF-8?q?ster'=20into=20dev=20*=20Merge=20remote-tracking=20branch=20'up?= =?UTF-8?q?stream/dev'=20into=20dev=20*=20feat:=20enable=20GPU=20*=20!113?= =?UTF-8?q?=203.2.1=20merge=20*=20!112=20Now=20stop=20use=20mail=20to=20co?= =?UTF-8?q?llect=20info=20*=20Merge=20remote-tracking=20branch=20'upstream?= =?UTF-8?q?/dev'=20into=20dev=20*=20Merge=20branch=20'dev'=20of=20gitee.co?= =?UTF-8?q?m:uniartisan2018/spark-store=20into=20dev=20*=20feat:=20?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E7=BD=91=E9=A1=B5=E7=BC=93=E5=AD=98=20*=20?= =?UTF-8?q?=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9=20*=20update=20src/widget.?= =?UTF-8?q?ui.=20*=20feat:=20=E6=98=9F=E7=81=AB=E5=BA=94=E7=94=A8=E5=95=86?= =?UTF-8?q?=E5=BA=97=E6=A3=80=E6=B5=8B=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget.cpp | 41 +++++++++++++++++++++-------------------- src/widget.h | 1 + 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index f0bb212..8e7d2eb 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -18,6 +18,7 @@ #include #include #include // 并发 +#include // close event #include #include @@ -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信息 */ diff --git a/src/widget.h b/src/widget.h index f9faad9..9ec716e 100644 --- a/src/widget.h +++ b/src/widget.h @@ -128,6 +128,7 @@ private: void setfoot(int); void updatefoot(); void updateUI(); + void closeEvent(QCloseEvent *event); quint64 dirFileSize(const QString &path); From ad57aa26ff8a2c7caa4fa0ea6592f05963b732db Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 27 Sep 2022 01:34:48 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E9=99=8D=E4=BD=8Edtk=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: shenmo --- debian/control | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index b5f8340..3917216 100644 --- a/debian/control +++ b/debian/control @@ -11,9 +11,9 @@ Build-Depends: libqt5widgets5, libqt5network5, libqt5concurrent5, - libdtkcore-dev(>=5.2), - libdtkgui-dev(>=5.2), - libdtkwidget-dev(>=5.2), + libdtkcore-dev(>=5.0), + libdtkgui-dev(>=5.0), + libdtkwidget-dev(>=5.0), qttools5-private-dev, libnotify-dev, qtwebengine5-dev From 21d33ec347d7cf5090c44dab5d2baa1578c1680b Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 27 Sep 2022 01:48:34 +0000 Subject: [PATCH 3/4] update debian/changelog. Signed-off-by: shenmo --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 8a72289..7381de5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (3.2.3) stable; urgency=medium + + * 客户端异常退出时仍然占用资源问题修复 + * 降低dtk依赖版本,Debian 11 stable可直接安装 + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.2.2) stable; urgency=medium * aptss will now refresh the system source before doing install, policy....etc From 10125c58168d68e21cdd94ca911603dcc6595850 Mon Sep 17 00:00:00 2001 From: shenmo Date: Tue, 27 Sep 2022 01:49:01 +0000 Subject: [PATCH 4/4] update src/main.cpp. Signed-off-by: shenmo --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5aacfdb..bb74f29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) DAboutDialog dialog; a.setAboutDialog(&dialog); dialog.setLicense(QObject::tr("We publish this program under GPL V3")); - dialog.setVersion(DApplication::buildVersion("Version 3.2.2")); + dialog.setVersion(DApplication::buildVersion("Version 3.2.3")); dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo dialog.setProductName(QLabel::tr("Spark Store")); dialog.setDescription( @@ -55,7 +55,7 @@ int main(int argc, char *argv[]) a.setOrganizationName("spark-union"); a.setOrganizationDomain("https://www.deepinos.org/"); a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文 - a.setApplicationVersion(DApplication::buildVersion("3.2.2")); + a.setApplicationVersion(DApplication::buildVersion("3.2.3")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr(