diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-17 18:27:40 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-17 18:27:40 +0200 |
commit | 8ef95ed5f65c07020a91b9fce306eacc0309794a (patch) | |
tree | 1292b44906fddb23d368335daf32eed615a7ca70 /src/urlbar | |
parent | Based on Lionel's merge request #80: (diff) | |
download | rekonq-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')
-rw-r--r-- | src/urlbar/listitem.cpp | 24 | ||||
-rw-r--r-- | src/urlbar/listitem.h | 3 |
2 files changed, 3 insertions, 24 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; -} - - // --------------------------------------------------------------- diff --git a/src/urlbar/listitem.h b/src/urlbar/listitem.h index 2f6f898a..8a6f520f 100644 --- a/src/urlbar/listitem.h +++ b/src/urlbar/listitem.h @@ -193,9 +193,6 @@ class ItemPreview : public QLabel public: ItemPreview(const QString &url, int width, int height, QWidget *parent = 0); - -private: - static QString guessNameFromUrl(QUrl url); }; |