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 &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,
|
|||||||
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);
|
||||||
|
Reference in New Issue
Block a user