diff --git a/src/plugins/cpaster/kdepasteprotocol.cpp b/src/plugins/cpaster/kdepasteprotocol.cpp index 468146de2d5..0fc08232d1b 100644 --- a/src/plugins/cpaster/kdepasteprotocol.cpp +++ b/src/plugins/cpaster/kdepasteprotocol.cpp @@ -199,7 +199,8 @@ void KdePasteProtocol::list() { QTC_ASSERT(!m_listReply, return); - QString url = QLatin1String(hostUrlC) + QLatin1String("api/xml/all"); + // Trailing slash is important to prevent redirection. + QString url = QLatin1String(hostUrlC) + QLatin1String("api/xml/all/"); m_listReply = httpGet(url); connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished())); if (debug) diff --git a/src/plugins/cpaster/pastebindotcomprotocol.cpp b/src/plugins/cpaster/pastebindotcomprotocol.cpp index 32462ea60cb..04a0c0c88b6 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp @@ -308,12 +308,21 @@ static inline ParseState nextClosingState(ParseState current, const QStringRef & return ParseError; } -static inline QStringList parseLists(QIODevice *io) +static inline QStringList parseLists(QIODevice *io, QString *errorMessage) { enum { maxEntries = 200 }; // Limit the archive, which can grow quite large. QStringList rc; - QXmlStreamReader reader(io); + // Read answer and delete part up to the main table since the input form has + // parts that can no longer be parsed using XML parsers () + QByteArray data = io->readAll(); + const int tablePos = data.indexOf("