summaryrefslogtreecommitdiff
path: root/src/previewimage.cpp
diff options
context:
space:
mode:
authormatgic78 <matgic78@gmail.com>2009-10-16 17:36:40 +0200
committermatgic78 <matgic78@gmail.com>2009-10-16 17:36:40 +0200
commit56b3d5fda4f814478f96ce19857399a607d929a9 (patch)
tree9de9d710bca8ad2b91bb01e879de7d4e820c1c87 /src/previewimage.cpp
parenti18n fixes (diff)
downloadrekonq-56b3d5fda4f814478f96ce19857399a607d929a9.tar.xz
add an action to refresh thumbnails
Diffstat (limited to 'src/previewimage.cpp')
-rw-r--r--src/previewimage.cpp12
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 );