<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://svn.reviewboard.kde.org/r/6035/">http://svn.reviewboard.kde.org/r/6035/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On December 3rd, 2010, 6:43 p.m., <b>Stephen Kelly</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">It wasn't so much forgotten as omitted because of complexity and weird UI.
Drops can be released directly on an item, or between two items.
If a drop on a kdescendantsproxymodel is released on an item it is reasonably clear that the dropped data should be made a child of the item it is dropped on.
In that case, dropMimeData is called with row == -1, column == -1 and parent == the drop target.
If a drop on a kdescendantsproxymodel is released between two items it is not clear where it should be invoked in the source model.
Consider this source tree:
- A
- - B
- - C
- D
- E
If I take E and drag it onto A, it becomes a sibling of C. Fair enough. If I instead drop it between A and B I'll get a visual indicator of a horizontal line indicating whether it is to be dropped below A (result is it goes above D as a sibling of A), or above B (result is it goes above B as a first child of A).
In general, if I drop between two adjacent items the result will be that the new (or moved) item will appear between them.
Consider what would happen in the proxy model case:
- A
- B
- C
- D
- E
Dropping E between A and B could result in E being between A and B (and change the structure of the source model such that E is a child of A (Weird - not what the user did), or it would appear between C and D as a child of the parent of A (Weird - not where the user dropped it, and it also changes the structure of the source model, which is not what the user is looking at).
Even dropping on the target itself would be weird. If you drop E on B, it becomes a child of B in the source model, but it appears as the next sibling of B in the proxy. Therefore it teaches the user that if they want E to appear below a certain item, they should drop it on that item (the user doesn't see the changes to the source model, except maybe somewhere else in the application).
KDescendantsProxyModel is a bit of a special case in this regard because it completely changes the structural representation of the source model. dropMimeData also changes the structure of the model, so this method is incompatible with this class.
Finally, I couldn't think of any way to use the class where you would want to do this, so I just left it out.
So I'm -1 on this patch.
Thanks all the same. It's good to know other people are watching the code I'm writing to try to make it better.
Steve.
PS:
I've just read the dropMimeData doc entry, and it's wrong and misleading. Don't rely on it too much. It is not the responsibility of the view to decide where things go in the model for one thing.</pre>
</blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Isn't this model supposed to be used for threading of (email) discussions? If yes, then I know of a use case for drop support: Allow fixing of broken threads, i.e. allow manual adjustment of the threads.
Example:
- A
- - B
- C
- D
where D is a reply to B, but Kontact failed to recognize this. To fix this I'd like to drop D on B (or below B, but I'd be okay with dropping between items not being possible).
</pre>
<br />
<p>- Ingo</p>
<br />
<p>On December 3rd, 2010, 4:37 p.m., Mario Bensi wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://svn.reviewboard.kde.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for kdelibs and Stephen Kelly.</div>
<div>By Mario Bensi.</div>
<p style="color: grey;"><i>Updated 2010-12-03 16:37:47</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">bug fix : add a forgotten method in KDescendantsProxyModel to forward the DropMimeData to the sourceModel
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>trunk/KDE/kdelibs/kdeui/itemviews/kdescendantsproxymodel.h <span style="color: grey">(1203163)</span></li>
<li>trunk/KDE/kdelibs/kdeui/itemviews/kdescendantsproxymodel.cpp <span style="color: grey">(1203318)</span></li>
</ul>
<p><a href="http://svn.reviewboard.kde.org/r/6035/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>