diff options
Diffstat (limited to 'src')
-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); |