Commit 57f09e82 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

KDE paste protocol: Limit the title to 30 characters.



Task-number: QTCREATORBUG-11065
Change-Id: I3d801e09f021913c750ec88028346bf54abccbf9
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent b748c1b3
...@@ -111,6 +111,8 @@ void StickyNotesPasteProtocol::paste(const QString &text, ...@@ -111,6 +111,8 @@ void StickyNotesPasteProtocol::paste(const QString &text,
const QString &comment, const QString &comment,
const QString &description) const QString &description)
{ {
enum { maxDescriptionLength = 30 }; // Length of description is limited.
Q_UNUSED(username) Q_UNUSED(username)
Q_UNUSED(comment); Q_UNUSED(comment);
QTC_ASSERT(!m_pasteReply, return); QTC_ASSERT(!m_pasteReply, return);
...@@ -124,7 +126,7 @@ void StickyNotesPasteProtocol::paste(const QString &text, ...@@ -124,7 +126,7 @@ void StickyNotesPasteProtocol::paste(const QString &text,
pasteData += expiryParameter(expiryDays); pasteData += expiryParameter(expiryDays);
if (!description.isEmpty()) { if (!description.isEmpty()) {
pasteData += "&title="; pasteData += "&title=";
pasteData += QUrl::toPercentEncoding(description); pasteData += QUrl::toPercentEncoding(description.left(maxDescriptionLength));
} }
m_pasteReply = httpPost(m_hostUrl + QLatin1String("api/xml/create"), pasteData); m_pasteReply = httpPost(m_hostUrl + QLatin1String("api/xml/create"), pasteData);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment