Commit 9c958657 authored by Heiko Becker's avatar Heiko Becker

Adjust to "new" version of the thumbnail standard

...which respects the XDG Base Directory Specification. This fixes
clearing the thumbnail cache. Also update the links to the two
specs. The old ones weren't available anymore.

BUG: 361482
parent 7942d0b8
......@@ -50,10 +50,10 @@ using namespace KAStats::Terms;
bool ClearThumbnailsAction::action()
{
// http://freedesktop.org/Standards/Home
// http://triq.net/~jens/thumbnail-spec/index.html
// https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
// https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html
QDir thumbnailDir( QDir::homePath() + QLatin1String( "/.thumbnails/normal" ));
QDir thumbnailDir( QDir::homePath() + QLatin1String( "/.cache/thumbnails/normal" ));
thumbnailDir.setFilter( QDir::Files );
const QStringList entries = thumbnailDir.entryList();
for( QStringList::const_iterator it = entries.begin() ; it != entries.end() ; ++it) {
......@@ -63,7 +63,7 @@ bool ClearThumbnailsAction::action()
}
}
thumbnailDir.setPath(QDir::homePath() + QLatin1String( "/.thumbnails/large" ));
thumbnailDir.setPath(QDir::homePath() + QLatin1String( "/.cache/thumbnails/large" ));
const QStringList entries2 = thumbnailDir.entryList();
for( QStringList::const_iterator it = entries2.begin() ; it != entries2.end() ; ++it) {
if(!thumbnailDir.remove(*it)) {
......@@ -72,7 +72,7 @@ bool ClearThumbnailsAction::action()
}
}
thumbnailDir.setPath(QDir::homePath() + QLatin1String( "/.thumbnails/fail" ));
thumbnailDir.setPath(QDir::homePath() + QLatin1String( "/.cache/thumbnails/fail" ));
const QStringList entries3 = thumbnailDir.entryList();
for( QStringList::const_iterator it = entries3.begin() ; it != entries3.end() ; ++it) {
if(!thumbnailDir.remove(*it)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment