Closed Bug 154856 Opened 22 years ago Closed 22 years ago

Contextual "Bookmark This Link..." command doesn't work

Categories

(Camino Graveyard :: General, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bugzilla, Assigned: bryner)

Details

Attachments

(1 file, 1 obsolete file)

found using 2002.06.27.05 chimera bits.

1. go to any web page with links, such as http://mozilla.org/
2. bring up the context menu for a link, eg, the "Testing" link on the left side.
3. select "Bookmar This Link"

expected: the Bookmarks dlg should appear (or, at the very least, the page
should be automatically added to your bookmarks).

actual results: nothing happens. the link is not in the Bookmarks menu, nor is
it in the bookmarks tab of the Sidebar.

unimplemented feature?
QA Contact: winnie → sairuh
Blocks: 154286
Confirmed using Chimera/20020625.
Summary: bookmark this link doesn't work → Contextual "Bookmark This Link..." command doesn't work
Taking, I've got a preliminary patch.
Assignee: saari → bryner
Status: NEW → ASSIGNED
Attached patch patch (obsolete) — Splinter Review
Comment on attachment 89746 [details] [diff] [review]
patch

some comments:

+    if (aURL) {

you should check both aURL and aTitle, no? It won't crash, but it will create a
garbage title if a caller doesn't happen to specify a valid title.

+      PRUnichar* bookmarkURLStr = nsMemory::Alloc((length + 1) *
sizeof(PRUnichar));
+      [aURL getCharacters:bookmarkURLStr];
...

I think ben wrote a utility routine to go from a NSString to a nsString. You
should use that instead.

Other than that, looks good.
> you should check both aURL and aTitle, no? It won't crash, but it will create a
> garbage title if a caller doesn't happen to specify a valid title.

Right, my assumption was that a caller wouldn't be doing that.

> I think ben wrote a utility routine to go from a NSString to a nsString. You
> should use that instead.

Ok.  I had to inline the utility function in StringUtils.h or else I would get
duplicate symbols (it was only used from one file previously).
Attached patch patch #2Splinter Review
addressing pink's comments
Attachment #89746 - Attachment is obsolete: true
Comment on attachment 89753 [details] [diff] [review]
patch #2

r=pink. not sure why all the code is in the header, maybe we should revisit it
being inline.
Attachment #89753 - Flags: review+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Verified with 07-02 build on OS 10.1.5.  context menu "bookmark this link"
works.  Checked that the new bookmark appears both in the bookmarks menu and in
the sidebar.
Status: RESOLVED → VERIFIED
No longer blocks: 154286
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: