diff options
author | Arno <arno@disconnect.de> | 2018-01-04 05:52:44 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-01-04 05:52:44 +0100 |
commit | 3213b4b32cd6620f88c6db442ebc38753b368441 (patch) | |
tree | 3396524622a9dd4bbfcd8d46412dfbe65e6e53e8 /helper.cpp | |
parent | bd839541a0c556576415c721132d71205766755a (diff) | |
download | ShemovCleaner-3213b4b32cd6620f88c6db442ebc38753b368441.tar.gz ShemovCleaner-3213b4b32cd6620f88c6db442ebc38753b368441.tar.bz2 ShemovCleaner-3213b4b32cd6620f88c6db442ebc38753b368441.zip |
Improve lookup of cache dir
Implement looking up the cache dir as Helper::function. Create it if it
doesn't exist.
Diffstat (limited to 'helper.cpp')
-rw-r--r-- | helper.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -9,6 +9,8 @@ #include <QProcess> #include <QFontMetrics> #include <QPainter> +#include <QStandardPaths> +#include <QDir> #include "helper.h" @@ -122,6 +124,18 @@ namespace Helper { return retval; } + const QString appDataDir(){ + QString retval = QStandardPaths::locate(QStandardPaths::HomeLocation, ".shemovcleaner", QStandardPaths::LocateDirectory); + if(retval.isEmpty()){ + QString homeDir = QStandardPaths::locate(QStandardPaths::HomeLocation, QString(), QStandardPaths::LocateDirectory); + QDir d(homeDir); + if(d.mkdir(".shemovcleaner")){ + retval = QString("%1/%2").arg(homeDir).arg(".shemovcleaner"); + } + } + return retval; + } + Duration::Duration() : mHours(0), mMinutes(0), mSeconds(0) {} Duration::Duration(qint64 seconds){ |