diff options
Diffstat (limited to 'src/previewimage.cpp')
-rw-r--r-- | src/previewimage.cpp | 12 |
1 files changed, 12 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 ); |