KDE paste protocol: Limit the title to 30 characters.

Task-number: QTCREATORBUG-11065
Change-Id: I3d801e09f021913c750ec88028346bf54abccbf9
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
Friedemann Kleint
2013-12-12 11:31:32 +02:00
parent b748c1b3d2
commit 57f09e824a

View File

@@ -111,6 +111,8 @@ void StickyNotesPasteProtocol::paste(const QString &text,
const QString &comment,
const QString &description)
{
enum { maxDescriptionLength = 30 }; // Length of description is limited.
Q_UNUSED(username)
Q_UNUSED(comment);
QTC_ASSERT(!m_pasteReply, return);
@@ -124,7 +126,7 @@ void StickyNotesPasteProtocol::paste(const QString &text,
pasteData += expiryParameter(expiryDays);
if (!description.isEmpty()) {
pasteData += "&title=";
pasteData += QUrl::toPercentEncoding(description);
pasteData += QUrl::toPercentEncoding(description.left(maxDescriptionLength));
}
m_pasteReply = httpPost(m_hostUrl + QLatin1String("api/xml/create"), pasteData);