[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Feature Request: thumbnails of web pages
From:       sycao <sycao () redflag-linux ! com>
Date:       2008-12-16 4:04:29
Message-ID: 494728CD.7090900 () redflag-linux ! com
[Download RAW message or body]

David Faure wrote:
> 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.
> 
That's great. I'v got some others thoughts about how does my thumbnail 
patch go further.
> 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. 
> 
Yes, that's correct, thanks. I checked my own svn and found that I used 
collect(m_pMainWindow)
the first time and then replaced it with unnecessarily complicated one. 
I just forgot why. Acutally
I want to locate a 'tab' which may contains the requested view.
> 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 :-)
> 
> 
I think you are right, and also I am refactoring the thumbnail storage 
code to be more efficient.
> 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).
> 
> 
Yes, I know the problem. I have to take care of all possible urls in 
chinese, so I'll fix it around
my patch. I made a plan about thumbnail functionality, I'll share with 
you later.

Best regards,
Siyuan Cao


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic