Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML lines only partially recognised as URLs #302

Closed
philostein opened this issue May 8, 2011 · 15 comments
Closed

HTML lines only partially recognised as URLs #302

philostein opened this issue May 8, 2011 · 15 comments
Assignees
Labels

Comments

@philostein
Copy link
Contributor

@philostein philostein commented May 8, 2011

HTML 'a href=' lines in HTML files are recognised as URLs, but show a GenericDocument icon. They aren't recognised as available for custom text Actions in pane 2, and have to be '.'ed into first. Can this be changed?

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 8, 2011

Can you post up a sample HTML file that you're putting in the 1st pane? I'm
not 100% of what you're trying to do here :)

On 8 May 2011 15:25, philostein <
reply@reply.github.com>wrote:

HTML QSApp.com lines in HTML files are
recognised as URLs, but show a GenericDocument icon. They aren't recognised
as available for custom text Actions in pane 2, and have to be '.'ed into
first. Can this be changed?

Reply to this email directly or view it on GitHub:
#302

@philostein
Copy link
Contributor Author

@philostein philostein commented May 8, 2011

http://dl.dropbox.com/u/157506/HTML%20line%20URL.png

http://dl.dropbox.com/u/157506/Chrome%20history.html (Save link)

QS allows drilling into HTML files and recovering URLs from 'a href=' tags. It knows they're URLs, but doesn't provide the icon or text manipulation functions.

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 8, 2011

Gotcha.

It's probably just a matter of using
setObject:name forType:NSPasteboardFileType...

and then making sure the primary type is set to QSURLType wherever it is that QS does the 'right arrow into html file' stuff.

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 8, 2011

Pretty sure it's set in QSHTMLLinkParser.m, objectsFromData method

@ghost ghost assigned pjrobertson May 8, 2011
@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 8, 2011

Managed to fix the 'not being able to use text actions' problem by adding

[newObject setObject:url forType:QSTextType];
[newObject setPrimaryType:QSURLType];

Further complications with setting the icon - since QS tries to be clever and if the link is an image, it shows the icon of the image. I'd like to keep this in as it's pretty cool (otherwise this would also be an easy fix)

@philostein
Copy link
Contributor Author

@philostein philostein commented May 8, 2011

Great, just not a GenericDocument icon. If there's alternative differentiators to just URL, then it would seem like a good idea to keep them in!

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 8, 2011

@skurfer - you may be happy to know that part of a fix for the GenericDocument icon showing up for the URLs also fixed the problem with some web search object icons showing up as GenericDocuments.

QSHTMLParser.m:89 was always TRUE (the string always existed). The check needed to be to see if the imageurl actually had a length or not using

if(imageurl.length > 0)

@skurfer
Copy link
Member

@skurfer skurfer commented May 9, 2011

I hate the URL parser and I’m so glad you’re messing with it. I haven’t seen any problem with Search URL icons though. I thought it went away when you reverted one of your changes after discovering the case was already handled. Anyway, I look forward to a pull request on that frakking perl script. I even went as far as rewriting it in Python, but couldn’t get QS to run it. (This was probably 2 years ago.)

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 11, 2011

What were your problems with the URL parser, just out of interest?
Apart from the fix @fheckl made to it on the dev discussions, I wasn't thinking of modding it any more. When I did a quick Google search though, it did look like the perl extension being used wasn't the most appropriate

@skurfer
Copy link
Member

@skurfer skurfer commented May 12, 2011

A lot of it revolves around images. They show up on the wrong item, or they don’t show up at all. In the long run, I’d like to see more than just the one parser as described in #273.

Since ß59, I’ve just gotten the blank page icon for everything, but it was way down on the list of stuff I was worrying about. I tried the fix posted on the list, but I saw no difference. Again, low on the list, so I dropped it.

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 12, 2011

Fix on the list is only half way there. I've managed to get

a) Globe showing for all URLs
b) if a link () is a clickable image (e.g. link G img's images) then
the icon shows up as the image. This really sweet, but I think HenningJ
might need to work on some background process stuff, since if you have a
slow internet connection it can kill QS for a bit.

So pretty much fixed all the problems.

The reason I haven't committed it is because I wanted to play with custom
icons for web searches. But maybe this should be in another commit?

On 12 May 2011 12:51, skurfer <
reply@reply.github.com>wrote:

A lot of it revolves around images. They show up on the wrong item, or they
dont show up at all. In the long run, Id like to see more than just the
one parser as described in #273.

Since 59, Ive just gotten the blank page icon for everything, but it was
way down on the list of stuff I was worrying about. I tried the fix posted
on the list, but I saw no difference. Again, low on the list, so I dropped
it.

Reply to this email directly or view it on GitHub:
#302 (comment)

@skurfer
Copy link
Member

@skurfer skurfer commented May 12, 2011

Yeah, the new web search icon can be in another commit.

@pjrobertson
Copy link
Member

@pjrobertson pjrobertson commented May 12, 2011

@philostein - you're gonna love this when it's (hopefully - I still have to endure the torturous scrutiny of Rob and Henning on my pull request :P) in ß60 :)

@philostein
Copy link
Contributor Author

@philostein philostein commented May 12, 2011

Great guys, thanks for all your efforts! I know a lot of people are really surprised and impressed with all the web stuff QS can do. This is another chunk of icing on the cake.

@skurfer
Copy link
Member

@skurfer skurfer commented May 20, 2011

Fixed by… I don’t know… #316 maybe? :)

@skurfer skurfer closed this as completed May 20, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants