summaryrefslogtreecommitdiff
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
parenti18n fixes (diff)
downloadrekonq-56b3d5fda4f814478f96ce19857399a607d929a9.tar.xz
add an action to refresh thumbnails
-rw-r--r--src/previewimage.cpp12
-rw-r--r--src/previewimage.h1
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);