-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettingscontroller.cpp
42 lines (35 loc) · 994 Bytes
/
settingscontroller.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "settingscontroller.h"
#include <QSettings>
#include <QDir>
#include <QStandardPaths>
#include <QDebug>
void cleanSettings() {
QSettings cleanHelper;
cleanHelper.beginGroup("iconview/id_count");
cleanHelper.clear();
cleanHelper.endGroup();
cleanHelper.beginGroup("iconview/id_title_table");
cleanHelper.clear();
cleanHelper.endGroup();
cleanHelper.beginGroup("iconview/id_state_table");
cleanHelper.clear();
cleanHelper.endGroup();
}
void removeDirs() {
QDir dirHelper;
/* NOTE:!!!!!!!
* be careful to remove a unsure dir.
*/
bool isDir = dirHelper.setCurrent(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+"/.iconviews_on_desktop_test");
if (isDir) {
qDebug()<<dirHelper.removeRecursively()<<" delete done";
}
}
SettingsController::SettingsController(QObject *parent) : QObject(parent)
{
}
void SettingsController::resetAll() {
cleanSettings();
removeDirs();
exit(0);
}