Closed Bug 143094 Opened 23 years ago Closed 23 years ago

[chimera] Better error checking on drag&drop

Categories

(Camino Graveyard :: Bookmarks, defect)

PowerPC
macOS
defect
Not set
blocker

Tracking

(Not tracked)

VERIFIED FIXED
Chimera0.3

People

(Reporter: mikepinkerton, Assigned: Brade)

References

Details

Attachments

(2 files, 3 obsolete files)

patch from richards9@mac.com, coming up
Attached patch some better error handling (obsolete) — Splinter Review
haven't looked at the patch at all.
Big thanks to richards@mac.com for cleaning up my slop. Some quick comments after scanning over the patch: * Looks like you have tabs turned on in Project Builder (the default setting). Could you please turn off tabs and replace all the tabs in your patch with 2-space indentation? * In response to your comment about mouseUp and dragging - dragging must start while the mouse is down - try dragging anything in the OS and you'll see. * That O(n^2) operation in writeItems could be mightly slow if you are dragging a lot of bookmarks. I am curious if it perceptibly affects the start of a drag if you have a large bookmarks file and try to drag a bunch of it around. * Some of your method names start with lowercase, some uppercase. Could you try to fit with the convention of the class? I guess it's confusing since Apple uses lowercase but some of Hyatt's classes use uppercase (like BookmarksService).
I've fixed all the issues except for the o(n^2) thing. I'm not sure if I'm going to fix it, or just cut out that functionality. What that operation does, is it removes a node from the drag if that node's parent is also being dragged. So, for example, if you expanded an item in the list, and then dragged that item, and several of it's children, this ensures that when you drop, the children will still be inside of that folder. If I removed that line, the children would be placed out on the same level as the folder. The current slow implementation is a little more forgiving when it comes to preserving any existing orginization, while the latter is arguably a bit more powerful for the user. Any opinions on how it should work?
how does it work in other apps, ie, what is the expected behavior from the user perspective? i would argue that the current behavior is more common and most expected. Usually whenever i've written dnd code in the past, i remove children from the list if the parent is dragged too.
fixed the issues brought up in the bug comments: indenting and tabs fixed method capitalization fixed commented out o(n^2) code. this should get fixed in the future, but it's not too important right now added new argument to BookmarksService::BookmarkAdded/Changed/Remote to determine if it should flush the bookmarks. There were LOTS of extraneous flushes when drag-and-dropping a large number of bookmarks. Drops should be much faster now.
Keywords: patch, review
i noticed there are parts of this patch that are now outdated and have been removed from the relevant files. can i get an updated patch? also, how does this patch relate to bug 149920? does it address it at all?
Attached patch updated bookmarks patch (obsolete) — Splinter Review
The patch has indeed bitrotted. An updated version is attached. Regarding bug 149920, that brings up two issues that can cause bookmarks to be lost, and then two crashes that can result afterwards. Both of those issues are fixed in this patch.
Attachment #85731 - Attachment is obsolete: true
looking at the patch, I see a couple blocks that are commented out with /* */ can these be removed or converted to #ifdef WHEN_WE_HAVE_A_PERFORMANCE_FIX or something like that?
Attachment #82834 - Attachment is obsolete: true
Attachment #88173 - Attachment is obsolete: true
*** Bug 149920 has been marked as a duplicate of this bug. ***
richard, i noticed this patch disables dragging items on the personal toolbar to re-arrange them. was this intended, or an oversight? i'm about to land this and would like to know.
As I recall, when I wrote this code, dragging from the toolbar hadn't even been implemented yet, so this probably needs to get fixed before it's added to the tree.
over to brade. richard: in the patch you removed the method that the personal toolbar relied on to start a drag. why? upping to blocker status, it fixes several dataloss bugs
Assignee: hewitt → brade
Severity: normal → blocker
Target Milestone: --- → Chimera0.3
This patch was initially written almost a month and a half ago, before Chimera had any bookmark d&d at all. That effort was duplicated (someone else beat me to it), so I merged what I liked from the existing implementation (which had several major oversights in it, the dataloss bugs) into my own, and submitted it. All of the functionality in the removed methods (at that time) was covered elsewhere. Unfortunatly, I haven't tracked how the codebase has changed since then, and what might rely on those methods. My general reasoning was that the BookmarksService class was serving as a data model, so I moved anything having to do with drag&drop specifically out of it, and into the BookmarksDataSource and CHBookmarksToolbar classes. Only functions having specifically to do with editing the bookmarks database were left in the BookmarksService class. I'll have a look at how dragging from the toolbar works today and see what can be done.
I didn't hook up dragging from the toolbar because of quirky event issues with the cocoa buttons on the toolbar. The drag events are never fired on these buttons, because they are killed off by the buttons' own handling of the mouse down event. The only solution I can think of is to stop using cocoa buttons and make up our own button class.
Blocks: 145175
ohhhhhh, i see. so the bugs that had to do with dragging things onto themselves from the personal toolbar are drags from the bookmarks pane. ah-ha! i'll try to land this one today, then.
landed.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verfied Project X trunk build 6/28/02
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: