summaryrefslogtreecommitdiff
path: root/src/websnap.h
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2010-09-14 23:02:10 +0200
committerPierre Rossi <pierre.rossi@nokia.com>2010-09-15 18:40:33 +0200
commitaad3dfe4b42bd0f909755710d4fa2ac02ce59a0f (patch)
treeabbdaee0ca283e634f4f20c8f4c212b3885fba5b /src/websnap.h
parentUpgraded download i18n script to automagically grab translation strings (diff)
downloadrekonq-aad3dfe4b42bd0f909755710d4fa2ac02ce59a0f.tar.xz
Websnaps: change the image path to use base64.
This should solve the problems caused by special characters for good. A few other improvements: - do not call updateImage as many times as there are favorites. - removed an unused variable. - trade #defines for static const ints - take advantage of the already loaded page to refresh the snapshot.
Diffstat (limited to 'src/websnap.h')
-rw-r--r--src/websnap.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/websnap.h b/src/websnap.h
index 5bad952d..e5b550fc 100644
--- a/src/websnap.h
+++ b/src/websnap.h
@@ -43,11 +43,6 @@
// Forward Declarations
class QPixmap;
-// Defines
-#define WIDTH 200
-#define HEIGHT 150
-
-
/**
* This class is used in many classes of rekonq to produce an image
* based on the site corresponding to the url passed as argument.
@@ -63,6 +58,7 @@ class QPixmap;
* - NewTabPage class: to show the favorites page "preview" (given an url, you show AND save an image)
*
*/
+
class REKONQ_TESTS_EXPORT WebSnap : public QObject
{
Q_OBJECT
@@ -88,7 +84,7 @@ public:
*
* @return the pixmap snapped from the page
*/
- static QPixmap renderPagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT);
+ static QPixmap renderPagePreview(const QWebPage &page, int w = defaultWidth, int h = defaultHeight);
// static QPixmap renderVisiblePagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT); TODO: try to make this method work => more previews for the urlbar
@@ -101,7 +97,7 @@ public:
*
* @return the pixmap snapped from the page
*/
- static QPixmap renderClosingPagePreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT);
+ static QPixmap renderClosingPagePreview(const QWebPage &page, int w = defaultWidth, int h = defaultHeight);
/**
* Snaps a pixmap of size w * h from a page for tab preview
@@ -139,6 +135,9 @@ signals:
void snapDone(bool ok);
private:
+ // Constants
+ static const int defaultWidth = 200;
+ static const int defaultHeight = 150;
QWebPage m_page;
KUrl m_url;