From 1d2e4946e7650466a21acc6d2abb19740a63d431 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 22 Apr 2010 01:42:58 +0200 Subject: Fix, improve and clean WebSnap API. This led me to a little polish in the classes using the WebSnap facilities and to change the mechanism the NewTabPage retrieves images from the "cache" --- src/webpage.cpp | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'src/webpage.cpp') diff --git a/src/webpage.cpp b/src/webpage.cpp index c3acc1ad..1e25ce8d 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -564,3 +564,55 @@ void WebPage::showSSLInfo() ); } } + + + + +void WebPage::updateImage(bool ok) +{ + if(!ok) + kDebug() << "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"; + else + kDebug() << "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"; + +/* int previewIndex = 1; + KUrl url; + QString snapTitle = QString("ciao");*/ +// // Update page, but only if open +// if(m_root.document().findAll("#rekonq-newtabpage").count() == 0) +// return; +// if(m_root.findAll(".favorites").count() == 0 || m_root.findAll(".closedTabs").count() == 0) +// return; +// +// QStringList urls = ReKonfig::previewUrls(); +// +// for(int i = 0; i < urls.count(); i++) +// { +// QString title = urls.at(i); +// KUrl url( title ); +// +// +// if( WebSnap::existsImage(url) ) +// { +// QStringList names = ReKonfig::previewNames(); +// names.replace(i, title); +// ReKonfig::setPreviewNames(names); +// ReKonfig::self()->writeConfig(); +// +// QWebElement prev = m_root.findFirst("#preview" + QVariant(i).toString()); +// if(KUrl(prev.findFirst("a").attribute("href")) == url ) +// { +// QWebElement newPrev = validPreview(i, url, title); +// +// if(m_root.findAll(".closedTabs").count() != 0) +// hideControls(newPrev); +// +// prev.replace(newPrev); +// } +// break; +// } +// } + + NewTabPage p( mainFrame() ); + p.snapFinished(); +} -- cgit v1.2.1