Feature Request: thumbnails of web pages
David Faure
faure at kde.org
Fri Dec 12 20:40:27 GMT 2008
On Monday 17 November 2008, sycao wrote:
> hi, I'm wondering if it's useful to provide thumbnails ability for
> konqueror, as many browsers have the feature. so I write a primitive
> thumbnail implementation, which provide basic functions such as show
> most visited pages and all opened tabs ( only khtml pages now ).
> clicking on a thumbnail representing the opened tab will just activate
> the associative tab. i'm very interested in it, and will do more work on
> it. if anyone has an idea or find it useful, please tell me. thanks.
Interesting, I think this goes well with Eduardo's plans (e.g. the webpage
showing the recently visited sites, and/or sites open during the last crash),
make sure to coordinate this with him.
About the patch:
Casting pointers to uint is wrong, pointers are 64 bits on amd64 machines
while uint is only 32 bits.
Instead, you can make a KonqView pointer from the id by doing reinterpret_cast<KonqView*>(id.toLong()) but of course the resulting pointer can be invalid, it has to be checked against the existing views.
To do that, this whole code (the loops and the gotos) can be simplified by just calling collector.collect() on m_pMainWindow, which is a container too.
Please use indexOf('(') instead of QRegExp.indexIn, QRegExp is really slow.
+ QRegExp re("konqtab://(.*)");
+ int idx = re.indexIn( url );
+ Q_ASSERT_X( idx != -1, "urlSelected", "konqtab url is invalid" );
+ QString id = url.mid( re.pos(1) );
Eek, please use KUrl::path to get a path from a url :-)
And use KUrl::setPath when constructing the URL, in order to get proper escaping
of special characters like '#'. (this means %1 instead of konqtab://%1 in the QString,
and using .arg(url.url()) to replace %1 with the full URL).
--
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kfm-devel
mailing list