Bug 349604 - main-menu doesn't handle labeled bookmarks
Summary: main-menu doesn't handle labeled bookmarks
Status: RESOLVED FIXED
: 327451 (view as bug list)
Alias: None
Product: openSUSE 11.0
Classification: openSUSE
Component: GNOME (show other bugs)
Version: Alpha 1
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Scott Reeves
QA Contact: E-mail List
URL:
Whiteboard: gnomeup-gnome-main-menu
Keywords:
Depends on:
Blocks: main-menu-behavior
  Show dependency treegraph
 
Reported: 2007-12-18 20:09 UTC by Forgotten User CRPsQFwJ3b
Modified: 2008-03-08 00:34 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Patch to fix the issue (1.70 KB, patch)
2007-12-18 22:02 UTC, Forgotten User CRPsQFwJ3b
Details | Diff
Updated patch (1.74 KB, patch)
2007-12-18 22:27 UTC, Forgotten User CRPsQFwJ3b
Details | Diff
Updated patch (1.85 KB, patch)
2007-12-19 00:47 UTC, Forgotten User CRPsQFwJ3b
Details | Diff
Updated patch (1.85 KB, patch)
2007-12-19 00:48 UTC, Forgotten User CRPsQFwJ3b
Details | Diff
Updated patch (2.64 KB, patch)
2007-12-19 01:05 UTC, Forgotten User CRPsQFwJ3b
Details | Diff
Updated patch (2.70 KB, patch)
2007-12-19 01:31 UTC, Forgotten User CRPsQFwJ3b
Details | Diff
updated patch to fix segfault (2.56 KB, patch)
2008-01-29 19:23 UTC, Scott Reeves
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Forgotten User CRPsQFwJ3b 2007-12-18 20:09:59 UTC
Main Menu doesn't know about labeled bookamrks in the form of:

file:///home/ivanz/Syberia%202%20Saves Syberia 2 Saves

and will handle that as a whole URI.
Comment 1 Forgotten User CRPsQFwJ3b 2007-12-18 22:02:12 UTC
Created attachment 188132 [details]
Patch to fix the issue

Attached a patch to fix the issue.
Comment 2 Forgotten User CRPsQFwJ3b 2007-12-18 22:27:25 UTC
Created attachment 188137 [details]
Updated patch
Comment 3 Forgotten User CRPsQFwJ3b 2007-12-19 00:11:41 UTC
*** Bug 327451 has been marked as a duplicate of this bug. ***
Comment 4 Federico Mena Quintero 2007-12-19 00:31:01 UTC
Thanks for the patch!  Now it just needs to actually use the label.  After calling create_item(), I think you can just do

  g_bookmark_file_set_title (priv->store, uri, label + 1);

Later, when update_items() runs, it will call g_bookmark_file_get_title() and retrieve the label that you set.
Comment 5 Forgotten User CRPsQFwJ3b 2007-12-19 00:47:32 UTC
Created attachment 188153 [details]
Updated patch

This one sets the title.
Comment 6 Forgotten User CRPsQFwJ3b 2007-12-19 00:48:03 UTC
Created attachment 188154 [details]
Updated patch
Comment 7 Forgotten User CRPsQFwJ3b 2007-12-19 01:05:16 UTC
Created attachment 188157 [details]
Updated patch

This final patch check for title changes in update_items so that the menu reflects the changes in real time. :) Should be ready to go upstream.
Comment 8 Forgotten User CRPsQFwJ3b 2007-12-19 01:31:15 UTC
Created attachment 188159 [details]
Updated patch

This one will compare title names only for USER_DIRS. Should be better optimization-wise. Cheers.
Comment 9 Federico Mena Quintero 2007-12-19 01:45:09 UTC
Excellent, there's a test package with your patch here:
http://download.opensuse.org/repositories/home:/federico-mena:/10.3/openSUSE_10.3/

I *think* you may be leaking "uri" in some cases, but I didn't look at the patch too closely :)  Let's talk about it tomorrow.
Comment 10 JP Rosevear 2008-01-22 00:36:08 UTC
For scott to push upstream.
Comment 11 Scott Reeves 2008-01-29 19:23:15 UTC
Created attachment 192206 [details]
updated patch to fix segfault

Thanks for the patch - couple of fixes to it.

Add a bookmark via nautilus and do not set a label initially. Then later if you edit that bookmark and add a label the patch will segfault in the strcmp in update_items as priv->items[i]->title is null

If you delete an existing title the patch will not update the display as it exits the check because title is null

If there is no title it needs to fall back and compare the uri for differences (for reordering which is not supported yet but will be)

updated patch to fix this.
Comment 12 Scott Reeves 2008-03-08 00:34:20 UTC
submitted to factory - v 0.9.9