diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-10-16 23:02:18 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-10-16 23:02:18 +0200 |
commit | 5a01b46f7593f16994f1719bbaff5957d8b51021 (patch) | |
tree | e42f71c48d5a650dc594524ca8ba99d0d31716c6 | |
parent | use the same bar string. (diff) | |
parent | add an action to refresh thumbnails (diff) | |
download | rekonq-5a01b46f7593f16994f1719bbaff5957d8b51021.tar.xz |
Merge commit 'refs/merge-requests/1826' of git://gitorious.org/rekonq/mainline into MagicNoon3
-rw-r--r-- | src/previewimage.cpp | 12 | ||||
-rw-r--r-- | src/previewimage.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/previewimage.cpp b/src/previewimage.cpp index e4bcb339..03741770 100644 --- a/src/previewimage.cpp +++ b/src/previewimage.cpp @@ -216,6 +216,10 @@ void PreviewImage::contextMenuEvent(QContextMenuEvent* event) a = new KAction(KIcon("edit-delete"), i18n("Remove Thumbnail"), this); connect(a, SIGNAL(triggered(bool)), this, SLOT(removeMe())); menu.addAction(a); + + a = new KAction(KIcon("view-refresh"), i18n("Refresh Thumbnail"), &menu); + connect(a, SIGNAL(triggered(bool)), this, SLOT(refreshPreview())); + menu.addAction(a); } menu.addAction(historyMenu()); @@ -287,6 +291,14 @@ void PreviewImage::setUrlFromAction() } +void PreviewImage::refreshPreview() +{ + QString path = KStandardDirs::locateLocal("cache", QString("thumbs/") + guessNameFromUrl(m_url) + ".png", true); + QFile::remove(path); + loadUrlPreview(m_url); +} + + QString PreviewImage::guessNameFromUrl(QUrl url) { QString name = url.toString( QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::StripTrailingSlash ); diff --git a/src/previewimage.h b/src/previewimage.h index 99e278f1..5568dd29 100644 --- a/src/previewimage.h +++ b/src/previewimage.h @@ -53,6 +53,7 @@ public slots: void snapFinished(); void removeMe(); void setUrlFromAction(); + void refreshPreview(); protected: void contextMenuEvent(QContextMenuEvent *event); |