diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-22 09:31:10 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-11-22 16:53:57 +0900 |
commit | 7f6dec0676123629d2cdf9da7640c1e17566ed3d (patch) | |
tree | f404d3e572651146c7f30aa2cb2ab1d8f696d494 /lib/avatar.cpp | |
parent | f9dccac588f2aa1c809018c0c5eb606a1470d2c5 (diff) | |
download | libquotient-7f6dec0676123629d2cdf9da7640c1e17566ed3d.tar.gz libquotient-7f6dec0676123629d2cdf9da7640c1e17566ed3d.zip |
Generalise and expose cacheLocation()
Diffstat (limited to 'lib/avatar.cpp')
-rw-r--r-- | lib/avatar.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/avatar.cpp b/lib/avatar.cpp index b8e1096d..c0ef3cba 100644 --- a/lib/avatar.cpp +++ b/lib/avatar.cpp @@ -190,18 +190,8 @@ bool Avatar::Private::checkUrl(const QUrl& url) const return _imageSource != Banned; } -QString cacheLocation() { - const auto cachePath = - QStandardPaths::writableLocation(QStandardPaths::CacheLocation) - + "/avatar/"; - QDir dir; - if (!dir.exists(cachePath)) - dir.mkpath(cachePath); - return cachePath; -} - QString Avatar::Private::localFile() const { - static const auto cachePath = cacheLocation(); + static const auto cachePath = cacheLocation("avatars"); return cachePath % _url.authority() % '_' % _url.fileName() % ".png"; } |