Commit 140b908e authored by Stefan Brüns's avatar Stefan Brüns

[Bookmarks Runner] Fix cleanup of favicon directory

Summary:
QDir.entryInfoList(NoDotAndDotDot) always returns an empty list, as it
requires one of QDir::Files, QDir::Dirs or QDir::Drives or any
combination thereof.

Instead of implementing it manually, use QDir::removeRecursively().

Test Plan:
Watch ~/.cache/krunner/
When krunner is closed, KRunner-Favicons-firefox-default should
be emptied and deleted.

Reviewers: #plasma, davidedmundson, broulik

Reviewed By: #plasma, broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D15391
parent c8358c20
......@@ -113,11 +113,7 @@ void FaviconFromBlob::teardown()
void FaviconFromBlob::cleanCacheDirectory()
{
foreach(const QFileInfo &file, QDir(m_profileCacheDirectory).entryInfoList(QDir::NoDotAndDotDot)) {
//qDebug() << "Removing file " << file.absoluteFilePath() << ": " <<
QFile(file.absoluteFilePath()).remove();
}
QDir().rmdir(m_profileCacheDirectory);
QDir(m_profileCacheDirectory).removeRecursively();
}
QIcon FaviconFromBlob::iconFor(const QString &url)
......
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