forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user