From bfa0bad74cfd9e4e7b7df490ab0d8e2609b1da62 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Fri, 14 Jun 2013 15:49:38 +0200 Subject: [PATCH 1/3] AndroidRunner: Fix CheckPidTimer to not fire forever - Only start the timer after we are sure that the app is running. - Stop the timer if we detect that the app was closed. Task-number: QTCREATORBUG-9545 Change-Id: I7d08b759d3aa5baaa3f82ee09aefb17e7c5fb512 Reviewed-by: Paul Olav Tvete Reviewed-by: hjk Reviewed-by: Eike Ziller --- src/plugins/android/androidrunner.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/android/androidrunner.cpp b/src/plugins/android/androidrunner.cpp index f820a738355..732863168bb 100644 --- a/src/plugins/android/androidrunner.cpp +++ b/src/plugins/android/androidrunner.cpp @@ -86,6 +86,8 @@ AndroidRunner::AndroidRunner(QObject *parent, AndroidRunConfiguration *runConfig 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())); @@ -139,8 +141,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() @@ -171,7 +175,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); } @@ -285,6 +288,8 @@ void AndroidRunner::asyncStart() return; } + QMetaObject::invokeMethod(&m_checkPIDTimer, "start"); + m_wasStarted = true; if (m_useCppDebugger || m_useQmlDebugger) { // This will be funneled to the engine to actually start and attach From 396cedf3c5c00b9d51bf612d0da0b5f52aae51e5 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 18 Jun 2013 10:37:00 +0200 Subject: [PATCH 2/3] QmlDesigner: use correct icon for vertical slider Task-number: QTCREATORBUG-9558 Change-Id: Ib06006ea986eea307bfb6fc3289dce7468de0b48 Reviewed-by: Eike Ziller Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/componentsplugin/components.metainfo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/componentsplugin/components.metainfo b/src/plugins/qmldesigner/componentsplugin/components.metainfo index 2e775a4acb1..b73172380ab 100644 --- a/src/plugins/qmldesigner/componentsplugin/components.metainfo +++ b/src/plugins/qmldesigner/componentsplugin/components.metainfo @@ -155,12 +155,12 @@ MetaInfo { Type { name: "QtQuick.Controls.Slider" - icon: ":/componentsplugin/images/sliderh16.png" + icon: ":/componentsplugin/images/slider16.png" ItemLibraryEntry { name: "Slider (Horizontal)" category: "Qt Quick - Controls" - libraryIcon: ":/componentsplugin/images/sliderh.png" + libraryIcon: ":/componentsplugin/images/slider.png" version: "1.0" requiredImport: "QtQuick.Controls" } From 1477729aa0590a6f5041164f56d8c7e8e8249d2e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 17 Jun 2013 12:00:17 +0200 Subject: [PATCH 3/3] Fix broken list requests in CodePaster. Pastebin.com-support: Remove header from list data. KDE Paste: Add trailing slash to prevent redirection. Task-number: QTCREATORBUG-9547 Change-Id: If47c4bc64767efb6f1a17db22ff9e0dbee3841bc Reviewed-by: Michael Bruning Reviewed-by: Robert Loehning Reviewed-by: Eike Ziller --- src/plugins/cpaster/kdepasteprotocol.cpp | 3 ++- .../cpaster/pastebindotcomprotocol.cpp | 20 ++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) 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(""); + if (tablePos < 0) { + *errorMessage = QLatin1String("Could not locate beginning of table."); + return rc; + } + data.remove(0, tablePos); + QXmlStreamReader reader(data); ParseState state = OutSideTable; int tableRow = 0; int tableColumn = 0; @@ -401,6 +410,8 @@ static inline QStringList parseLists(QIODevice *io) break; } // switch reader state } + if (reader.hasError()) + *errorMessage = QString::fromLatin1("Error at line %1:%2").arg(reader.lineNumber()).arg(reader.errorString()); return rc; } @@ -411,7 +422,10 @@ void PasteBinDotComProtocol::listFinished() if (debug) qDebug() << "listFinished: error" << m_listReply->errorString(); } else { - QStringList list = parseLists(m_listReply); + QString errorMessage; + const QStringList list = parseLists(m_listReply, &errorMessage); + if (list.isEmpty()) + qWarning().nospace() << "Failed to read list from " << PASTEBIN_BASE << ':' << errorMessage; emit listDone(name(), list); if (debug) qDebug() << list;