From 9e4df5c5c27c9c0f6399462659dab2651082cfb4 Mon Sep 17 00:00:00 2001 From: Pluto Date: Sat, 3 Sep 2022 09:25:19 +0000 Subject: [PATCH 1/2] =?UTF-8?q?!111=20feat=EF=BC=9A=20=E6=B8=85=E9=99=A4Qt?= =?UTF-8?q?WebCore=E7=9A=84=E7=BC=93=E5=AD=98=20*=20Merge=20remote-trackin?= =?UTF-8?q?g=20branch=20'upstream/dev'=20into=20dev=20*=20Merge=20branch?= =?UTF-8?q?=20'dev'=20of=20gitee.com:uniartisan2018/spark-store=20into=20d?= =?UTF-8?q?ev=20*=20feat:=20=E6=B8=85=E9=99=A4=E7=BD=91=E9=A1=B5=E7=BC=93?= =?UTF-8?q?=E5=AD=98=20*=20=E6=96=87=E6=A1=88=E4=BF=AE=E6=94=B9=20*=20upda?= =?UTF-8?q?te=20src/widget.ui.=20*=20feat:=20=E6=98=9F=E7=81=AB=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=95=86=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 | 10 +++++++++ src/widget.h | 1 + src/widget.ui | 61 ++++++++++++++++++++++++++++---------------------- 3 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/widget.cpp b/src/widget.cpp index 594315b..f0bb212 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -1148,6 +1148,16 @@ void Widget::on_pushButton_clear_clicked() // 清空临时缓存目录 }); } +void Widget::on_pushButton_clearWebCache_clicked() +{ + QtConcurrent::run([=]() + { + + QString dataLocal = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); + QDir cacheDir(dataLocal ); + cacheDir.removeRecursively(); }); +} + quint64 Widget::dirFileSize(const QString &path) { QDir dir(path); diff --git a/src/widget.h b/src/widget.h index 254b26c..f9faad9 100644 --- a/src/widget.h +++ b/src/widget.h @@ -91,6 +91,7 @@ private slots: void on_pushButton_updateApt_clicked(); void on_pushButton_uninstall_clicked(); void on_pushButton_clear_clicked(); + void on_pushButton_clearWebCache_clicked(); void on_pushButton_website_clicked(); void on_pushButton_clicked(); void on_btn_openDir_clicked(); diff --git a/src/widget.ui b/src/widget.ui index 2b25684..e35fede 100644 --- a/src/widget.ui +++ b/src/widget.ui @@ -345,7 +345,7 @@ 0 - 2 + 3 @@ -489,7 +489,7 @@ 0 0 - 903 + 889 849 @@ -993,8 +993,8 @@ 0 0 - 869 - 325 + 851 + 324 @@ -1123,8 +1123,8 @@ 0 0 - 738 - 886 + 889 + 716 @@ -1285,7 +1285,31 @@ - + + + + color:#808080 + + + Since the dictionary is at /tmp,It would be cleaned automatically when system reboot. + + + + + + + 0B + + + + + + + Location:/tmp/spark-store + + + + Qt::Horizontal @@ -1305,16 +1329,6 @@ - - - - color:#808080 - - - Since the dictionary is at /tmp,It would be cleaned automatically when system reboot. - - - @@ -1328,17 +1342,10 @@ - - + + - 0B - - - - - - - Location:/tmp/spark-store + Clear Web Cache From 8741973ccabe2dd633b8a5b4fd591e16d2019601 Mon Sep 17 00:00:00 2001 From: shenmo Date: Mon, 19 Sep 2022 17:58:00 +0800 Subject: [PATCH 2/2] aptss will now refresh the system source before doing install, download, policy....etc --- debian/changelog | 7 +++++++ src/main.cpp | 4 ++-- tool/aptss | 28 +++++++++++++++++++++------- tool/ssinstall | 4 ++-- 4 files changed, 32 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8938191..ec67721 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +spark-store (3.2.2) stable; urgency=medium + + * aptss will now refresh the system source before doing install, download, policy....etc + + +-- shenmo Fri, 30 Jan 2022 00:00:00 +0800 + spark-store (3.2.1) stable; urgency=medium * 更改刷新系统源的功能 diff --git a/src/main.cpp b/src/main.cpp index 7b29aeb..aca4f69 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,7 +30,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.1")); + dialog.setVersion(DApplication::buildVersion("Version 3.2.2")); dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo dialog.setProductName(QLabel::tr("Spark Store")); dialog.setDescription( @@ -51,7 +51,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.1")); + a.setApplicationVersion(DApplication::buildVersion("3.2.2")); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationDescription( QObject::tr( diff --git a/tool/aptss b/tool/aptss index 7c2ddbd..15d96a5 100755 --- a/tool/aptss +++ b/tool/aptss @@ -1,11 +1,5 @@ #/bin/bash - - - - -if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "download" ] ; then - if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then ###刷新apt-fast配置 mkdir -p /tmp/aptss-conf/ @@ -17,12 +11,23 @@ chmod -R 755 /tmp/aptss-conf fi + + + + + + + +if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "download" ] ; then + DEPEND=`which apt-fast` if [ "$DEPEND" = "" ] ; then echo "未安装依赖:apt-fast 开始安装" -sudo aptss ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y +aptss ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y fi +sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::etc::sourceparts="-" -o APT::Get::List-Cleanup="0" + ###执行 bwrap --dev-bind / / \ --bind '/tmp/aptss-conf/apt-fast.conf' /etc/apt-fast.conf \ @@ -30,6 +35,15 @@ bwrap --dev-bind / / \ apt-fast "$@" --allow-downgrades +elif [ "$1" = "policy" ] || [ "$1" = "search" ];then +sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::etc::sourceparts="-" -o APT::Get::List-Cleanup="0" + +###执行 +bwrap --dev-bind / / \ + --bind '/tmp/aptss-conf/apt-fast.conf' /etc/apt-fast.conf \ + --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list \ + apt "$@" --allow-downgrades + elif [ "$1" = "ssupdate" ];then mkdir -p /tmp/aptss-conf/ diff --git a/tool/ssinstall b/tool/ssinstall index db7ee0a..749d336 100755 --- a/tool/ssinstall +++ b/tool/ssinstall @@ -65,7 +65,7 @@ fi if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then echo "检测到apt-fast,使用aptss进行多线程下载加速" echo ---------------------------------------------------------------------------------- -echo "$upass" | sudo -S dpkg -i $1 || sudo aptss ssupdate && sudo aptss install -yf +echo "$upass" | sudo -S dpkg -i $1 || sudo aptss install -yf fi @@ -90,7 +90,7 @@ fi if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then echo "检测到apt-fast,使用aptss进行多线程下载加速" echo ---------------------------------------------------------------------------------- -dpkg -i $1 || aptss ssupdate && aptss install -yf +dpkg -i $1 || aptss install -yf fi