From 57f09e824aa9d207c70232f0c1421f4b8ad7c049 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Dec 2013 11:31:32 +0200 Subject: [PATCH] KDE paste protocol: Limit the title to 30 characters. Task-number: QTCREATORBUG-11065 Change-Id: I3d801e09f021913c750ec88028346bf54abccbf9 Reviewed-by: Robert Loehning --- src/plugins/cpaster/kdepasteprotocol.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cpaster/kdepasteprotocol.cpp b/src/plugins/cpaster/kdepasteprotocol.cpp index 1b101580dc9..3664c7dbb4e 100644 --- a/src/plugins/cpaster/kdepasteprotocol.cpp +++ b/src/plugins/cpaster/kdepasteprotocol.cpp @@ -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);