Skip to content

Commit 30a2816

Browse files
committed
clear cache when exit
1 parent bb8356c commit 30a2816

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/tools/mainWindow.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ QWidget *mainWidget;
1717

1818
float scale = 1.0;
1919
extern void setPen(int mode);
20+
extern void clearCache();
2021
extern QColor colors[];
2122

2223
class MainWindow : public QMainWindow {
@@ -70,6 +71,7 @@ class MainWindow : public QMainWindow {
7071
msgBox.addButton(QMessageBox::No);
7172
msgBox.setDefaultButton(QMessageBox::No);
7273
if(msgBox.exec() == QMessageBox::Yes){
74+
clearCache();
7375
enable_erc();
7476
exit(0);
7577
}

src/widgets/DrawingWidget.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ class ImageStorage {
124124
last_image_num = 1;
125125
removed = 0;
126126
updateGui();
127-
removeDirectory(cache_path);
128127
}
129128

130129
QImage loadValue(qint64 id) {
@@ -801,3 +800,6 @@ QString generateRandomString(int length) {
801800
return randomString;
802801
}
803802

803+
void clearCache(){
804+
removeDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/pardus-pen/");
805+
}

0 commit comments

Comments
 (0)