feat: 清除网页缓存

This commit is contained in:
lizhiyuan 2022-09-02 19:24:45 +08:00
parent 2df5363c2c
commit 5d5fbfbad4
3 changed files with 45 additions and 27 deletions

View File

@ -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);

View File

@ -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();

View File

@ -345,7 +345,7 @@
<number>0</number>
</property>
<property name="currentIndex">
<number>2</number>
<number>3</number>
</property>
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_4">
@ -489,7 +489,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>903</width>
<width>889</width>
<height>849</height>
</rect>
</property>
@ -993,8 +993,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>869</width>
<height>325</height>
<width>851</width>
<height>324</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
@ -1123,8 +1123,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>738</width>
<height>886</height>
<width>889</width>
<height>716</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
@ -1285,7 +1285,31 @@
<item>
<widget class="QWidget" name="widget_10" native="true">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="3">
<item row="2" column="0" colspan="5">
<widget class="QLabel" name="label_12">
<property name="styleSheet">
<string notr="true">color:#808080</string>
</property>
<property name="text">
<string>Since the dictionary is at /tmp,It would be cleaned automatically when system reboot.</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="tmp_size_ui">
<property name="text">
<string>0B</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Location/tmp/spark-store</string>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -1305,16 +1329,6 @@
</property>
</widget>
</item>
<item row="2" column="0" colspan="4">
<widget class="QLabel" name="label_12">
<property name="styleSheet">
<string notr="true">color:#808080</string>
</property>
<property name="text">
<string>Since the dictionary is at /tmp,It would be cleaned automatically when system reboot.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_13">
<property name="maximumSize">
@ -1328,17 +1342,10 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="tmp_size_ui">
<item row="0" column="3">
<widget class="QPushButton" name="pushButton_clearWebCache">
<property name="text">
<string>0B</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Location/tmp/spark-store</string>
<string>Clear Web Cache</string>
</property>
</widget>
</item>