Remove UUID from history path and move .cache to AppData/Roaming for Windows
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QUuid>
|
||||
|
||||
ConfigHandler::ConfigHandler(){
|
||||
m_settings.setDefaultFormat(QSettings::IniFormat);
|
||||
@@ -373,18 +372,6 @@ QString ConfigHandler::configFilePath() const {
|
||||
return m_settings.fileName();
|
||||
}
|
||||
|
||||
const QString ConfigHandler::userUuid() {
|
||||
QString userUuid;
|
||||
if (m_settings.contains(QStringLiteral("userUuid"))) {
|
||||
userUuid = m_settings.value(QStringLiteral("userUuid")).toString();
|
||||
} else {
|
||||
userUuid = QUuid::createUuid().toString();
|
||||
userUuid = userUuid.replace("{", "").replace("}", "");
|
||||
m_settings.setValue(QStringLiteral("userUuid"), userUuid);
|
||||
}
|
||||
return userUuid;
|
||||
}
|
||||
|
||||
bool ConfigHandler::normalizeButtons(QVector<int> &buttons) {
|
||||
auto listTypes = CaptureButton::getIterableButtonTypes();
|
||||
QVector<int> listTypesInt;
|
||||
|
||||
@@ -81,7 +81,6 @@ public:
|
||||
void setAllTheButtons();
|
||||
|
||||
QString configFilePath() const;
|
||||
const QString userUuid();
|
||||
|
||||
private:
|
||||
QSettings m_settings;
|
||||
|
||||
@@ -9,8 +9,11 @@ History::History()
|
||||
{
|
||||
// Get cache history path
|
||||
ConfigHandler config;
|
||||
QString userUuid = config.userUuid();
|
||||
m_historyPath = QDir::homePath() + "/.cache/flameshot/history/"+ userUuid + "/";
|
||||
#ifdef Q_OS_WIN
|
||||
m_historyPath = QDir::homePath() + "/AppData/Roaming/flameshot/history/";
|
||||
#else
|
||||
m_historyPath = QDir::homePath() + "/.cache/flameshot/history/";
|
||||
#endif
|
||||
|
||||
// Check if directory for history exists and create if doesn't
|
||||
QDir dir = QDir(m_historyPath);
|
||||
|
||||
Reference in New Issue
Block a user