Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ac0451de authored by Heiko Becker's avatar Heiko Becker 🎸

Fix porting regression when cleaning favicons

* 7f868f51 introduced QStandardPaths::CacheLocation in order to look
  for the dir containing the favicons, which describes the *app's*
  cache location though. Replaced with QSP::GenericCacheLocation
* ".../(.*)" already matches the whole filename, including the .png
  suffix, adding an additional "*.png" obviously prevents deleting
  the favicon later on.
parent 00f50d36
......@@ -175,7 +175,7 @@ bool ClearWebHistoryAction::action()
bool ClearFaviconsAction::action()
{
QDir favIconDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1Char('/') + QLatin1String( "favicons/" ));
QDir favIconDir(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1Char('/') + QLatin1String( "favicons/" ));
QStringList saveTheseFavicons;
KBookmarkManager* konqiBookmarkMgr;
......@@ -194,12 +194,12 @@ bool ClearFaviconsAction::action()
KBookmark bookmark = konqiBookmarks.first();
while (!bookmark.isNull()) {
if ((bookmark.icon()).startsWith(QStringLiteral("favicons/"))) {
if ((bookmark.icon()).startsWith(QLatin1String("favicons/"))) {
// pick out the name, throw .png on the end, and store the filename
QRegExp regex(QLatin1String( "favicons/(.*)" ));
regex.indexIn(bookmark.icon(), 0);
qDebug() << "will save " << (regex.cap(1) + QLatin1String( ".png" )) ;
saveTheseFavicons << (regex.cap(1) + QLatin1String( ".png" ));
qDebug() << "will save " << (regex.cap(1)) ;
saveTheseFavicons << (regex.cap(1));
}
bookmark = konqiBookmarks.next(bookmark);
}
......
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