<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://git.reviewboard.kde.org/r/111748/">http://git.reviewboard.kde.org/r/111748/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Plasma, Marco Martin and Sebastian Kügler.</div>
<div>By Eike Hein.</div>
<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;">DeclarativeMimeData::setData() is QString type, QString data, while QMimeData::setData() is QString type, QByteArray data. The former ends up calling the latter with data.toLatin1().
I have a need to set a QByteArray payload in the taskbar - X11 WIds, as understood e.g. by pagers.
The proposed patch changes the DeclarativeMimeData::setData() signature to QString type, QVariant data. The implementation checks whether the QVariant is a byte array, and if so, hands it to the base class implementation. If it's not a byte array, it checks if it can be converted to a QString, and if so, hands the string version's toLatin1() to the base class. If the QVariant is neither a byte array nor convertable to a string, nothing is done.
This means behavior changes as follows:
- Byte array support is back.
- Anything that QVariant knows how to convert to a QString is converted. This maybe subtly different from how QML "casts" to QString, but I think fits the original sentiment of changing the signature to use QString.
- Non-bytearray/string-convertable data is silently dropped.
If this patch is accepted, I would like to backport it to KDE/4.11 as well and make use of the improved implementation to restore drag-task-to-pager behavior in the new QML task manager.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">I haven't even built the thing. It's terribad.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=322567">322567</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/declarativeimports/draganddrop/DeclarativeMimeData.h <span style="color: grey">(ec725af)</span></li>
<li>src/declarativeimports/draganddrop/DeclarativeMimeData.cpp <span style="color: grey">(e7cab10)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/111748/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>