diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index a005e10fde6..ef467d2bca3 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -101,6 +101,8 @@ AndroidRunner::AndroidRunner(QObject *parent, QByteArray which = psProc.readAll(); m_isBusyBox = which.startsWith("busybox"); + m_checkPIDTimer.setInterval(1000); + connect(&m_adbLogcatProcess, SIGNAL(readyReadStandardOutput()), SLOT(logcatReadStandardOutput())); connect(&m_adbLogcatProcess, SIGNAL(readyReadStandardError()), SLOT(logcatReadStandardError())); connect(&m_checkPIDTimer, SIGNAL(timeout()), SLOT(checkPID())); @@ -154,8 +156,10 @@ void AndroidRunner::checkPID() return; QByteArray psOut = runPs(); m_processPID = extractPid(m_packageName, psOut); - if (m_processPID == -1) + if (m_processPID == -1) { + m_checkPIDTimer.stop(); emit remoteProcessFinished(tr("\n\n'%1' died.").arg(m_packageName)); + } } void AndroidRunner::forceStop() @@ -186,7 +190,6 @@ void AndroidRunner::start() { m_adbLogcatProcess.start(m_adb, selector() << _("logcat")); m_wasStarted = false; - m_checkPIDTimer.start(1000); // check if the application is alive every 1 seconds QtConcurrent::run(this, &AndroidRunner::asyncStart); } @@ -300,6 +303,8 @@ void AndroidRunner::asyncStart() return; } + QMetaObject::invokeMethod(&m_checkPIDTimer, "start"); + m_wasStarted = true; if (m_useCppDebugger) { // This will be funneled to the engine to actually start and attach diff --git a/src/plugins/cpaster/kdepasteprotocol.cpp b/src/plugins/cpaster/kdepasteprotocol.cpp index 0a717847e93..2f62b80ca9f 100644 --- a/src/plugins/cpaster/kdepasteprotocol.cpp +++ b/src/plugins/cpaster/kdepasteprotocol.cpp @@ -195,7 +195,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 619c2238cad..a7de02335a4 100644 --- a/src/plugins/cpaster/pastebindotcomprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcomprotocol.cpp @@ -317,12 +317,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("