summaryrefslogtreecommitdiff
path: root/src/urlbar/listitem.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-17 18:27:40 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-17 18:27:40 +0200
commit8ef95ed5f65c07020a91b9fce306eacc0309794a (patch)
tree1292b44906fddb23d368335daf32eed615a7ca70 /src/urlbar/listitem.cpp
parentBased on Lionel's merge request #80: (diff)
downloadrekonq-8ef95ed5f65c07020a91b9fce306eacc0309794a.tar.xz
Clean tab previews, not showing on loading
removed a duplicated method and save one QPixmap in WebSnap class
Diffstat (limited to 'src/urlbar/listitem.cpp')
-rw-r--r--src/urlbar/listitem.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 6f91aabd..229b43e9 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -31,6 +31,7 @@
// Local Includes
#include "urlresolver.h"
#include "application.h"
+#include "websnap.h"
// KDE Includes
#include <KIcon>
@@ -238,7 +239,8 @@ ItemPreview::ItemPreview(const QString &url, int width, int height, QWidget *par
setFixedSize(width, height);
setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
- QString path = KStandardDirs::locateLocal("cache", QString("thumbs/") + guessNameFromUrl( QUrl(url) ) + ".png", true);
+ KUrl u = WebSnap::fileForUrl( QUrl(url) );
+ QString path = u.pathOrUrl();
if(QFile::exists(path))
{
QPixmap preview;
@@ -248,26 +250,6 @@ ItemPreview::ItemPreview(const QString &url, int width, int height, QWidget *par
}
-//TODO: REMOVE DUPLICATE CODE WITH PREVIEWIMAGE
-QString ItemPreview::guessNameFromUrl(QUrl url)
-{
- QString name = url.toString( QUrl::RemoveScheme | QUrl::RemoveUserInfo | QUrl::StripTrailingSlash );
-
- // TODO learn Regular Expressions :)
- // and implement something better here..
- name.remove('/');
- name.remove('&');
- name.remove('.');
- name.remove('-');
- name.remove('_');
- name.remove('?');
- name.remove('=');
- name.remove('+');
-
- return name;
-}
-
-
// ---------------------------------------------------------------