diff options
Diffstat (limited to 'src/plugins/valgrind/xmlprotocol')
-rw-r--r-- | src/plugins/valgrind/xmlprotocol/error.cpp | 18 | ||||
-rw-r--r-- | src/plugins/valgrind/xmlprotocol/modelhelpers.cpp | 10 | ||||
-rw-r--r-- | src/plugins/valgrind/xmlprotocol/parser.cpp | 3 | ||||
-rw-r--r-- | src/plugins/valgrind/xmlprotocol/stackmodel.cpp | 3 | ||||
-rw-r--r-- | src/plugins/valgrind/xmlprotocol/suppression.cpp | 5 | ||||
-rw-r--r-- | src/plugins/valgrind/xmlprotocol/threadedparser.cpp | 4 |
6 files changed, 18 insertions, 25 deletions
diff --git a/src/plugins/valgrind/xmlprotocol/error.cpp b/src/plugins/valgrind/xmlprotocol/error.cpp index 744cd87d67..f7c8cbca35 100644 --- a/src/plugins/valgrind/xmlprotocol/error.cpp +++ b/src/plugins/valgrind/xmlprotocol/error.cpp @@ -224,29 +224,23 @@ QString Error::toXml() const } foreach (const Stack &stack, d->stacks) { - if (!stack.auxWhat().isEmpty()) { + if (!stack.auxWhat().isEmpty()) stream << " <auxwhat>" << stack.auxWhat() << "</auxwhat>\n"; - } stream << " <stack>\n"; foreach (const Frame &frame, stack.frames()) { stream << " <frame>\n"; stream << " <ip>0x" << QString::number(frame.instructionPointer(), 16) << "</ip>\n"; - if (!frame.object().isEmpty()) { + if (!frame.object().isEmpty()) stream << " <obj>" << frame.object() << "</obj>\n"; - } - if (!frame.functionName().isEmpty()) { + if (!frame.functionName().isEmpty()) stream << " <fn>" << frame.functionName() << "</fn>\n"; - } - if (!frame.directory().isEmpty()) { + if (!frame.directory().isEmpty()) stream << " <dir>" << frame.directory() << "</dir>\n"; - } - if (!frame.file().isEmpty()) { + if (!frame.file().isEmpty()) stream << " <file>" << frame.file() << "</file>\n"; - } - if (frame.line() != -1) { + if (frame.line() != -1) stream << " <line>" << frame.line() << "</line>"; - } stream << " </frame>\n"; } diff --git a/src/plugins/valgrind/xmlprotocol/modelhelpers.cpp b/src/plugins/valgrind/xmlprotocol/modelhelpers.cpp index 89fc938c84..78e5982a25 100644 --- a/src/plugins/valgrind/xmlprotocol/modelhelpers.cpp +++ b/src/plugins/valgrind/xmlprotocol/modelhelpers.cpp @@ -45,7 +45,7 @@ QString toolTipForFrame(const Frame &frame) if (!frame.file().isEmpty()) { location = frame.directory() + QDir::separator() + frame.file(); if (frame.line() > 0) - location += ':' + QString::number(frame.line()); + location += QLatin1Char(':') + QString::number(frame.line()); } typedef QPair<QString, QString> StringPair; @@ -60,14 +60,14 @@ QString toolTipForFrame(const Frame &frame) if (frame.instructionPointer()) lines << qMakePair(QCoreApplication::translate("Valgrind::XmlProtocol", "Instruction pointer:"), - QString::fromAscii("0x%1").arg(frame.instructionPointer(), 0, 16)); + QString::fromLatin1("0x%1").arg(frame.instructionPointer(), 0, 16)); if (!frame.object().isEmpty()) lines << qMakePair(QCoreApplication::translate("Valgrind::XmlProtocol", "Object:"), frame.object()); - QString html = "<html>" + QString html = QLatin1String("<html>" "<head>" "<style>dt { font-weight:bold; } dd { font-family: monospace; }</style>\n" - "<body><dl>"; + "<body><dl>"); foreach (const StringPair &pair, lines) { html += QLatin1String("<dt>"); @@ -76,7 +76,7 @@ QString toolTipForFrame(const Frame &frame) html += pair.second; html += QLatin1String("</dd>\n"); } - html += "</dl></body></html>"; + html += QLatin1String("</dl></body></html>"); return html; } diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp index 5b0372076c..ca76a006f5 100644 --- a/src/plugins/valgrind/xmlprotocol/parser.cpp +++ b/src/plugins/valgrind/xmlprotocol/parser.cpp @@ -221,9 +221,8 @@ QXmlStreamReader::TokenType Parser::Private::blockingReadNext() QIODevice *dev = reader.device(); QAbstractSocket *sock = qobject_cast<QAbstractSocket *>(dev); - if (!sock || sock->state() != QAbstractSocket::ConnectedState) { + if (!sock || sock->state() != QAbstractSocket::ConnectedState) throw ParserException(dev->errorString()); - } } } else if (reader.hasError()) { throw ParserException(reader.errorString()); //TODO add line, column? diff --git a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp index 099aa99b4f..cdabdc1665 100644 --- a/src/plugins/valgrind/xmlprotocol/stackmodel.cpp +++ b/src/plugins/valgrind/xmlprotocol/stackmodel.cpp @@ -219,8 +219,9 @@ void StackModel::setError(const Error &error) { if (d->error == error) return; + beginResetModel(); d->error = error; - reset(); + endResetModel(); } void StackModel::clear() diff --git a/src/plugins/valgrind/xmlprotocol/suppression.cpp b/src/plugins/valgrind/xmlprotocol/suppression.cpp index 135174b101..e55b9e0ff7 100644 --- a/src/plugins/valgrind/xmlprotocol/suppression.cpp +++ b/src/plugins/valgrind/xmlprotocol/suppression.cpp @@ -105,11 +105,10 @@ void SuppressionFrame::setObject(const QString &obj) QString SuppressionFrame::toString() const { - if (!d->fun.isEmpty()) { + if (!d->fun.isEmpty()) return QLatin1String("fun:") + d->fun; - } else { + else return QLatin1String("obj:") + d->obj; - } } class Suppression::Private : public QSharedData diff --git a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp index f1340bb414..991a1564d9 100644 --- a/src/plugins/valgrind/xmlprotocol/threadedparser.cpp +++ b/src/plugins/valgrind/xmlprotocol/threadedparser.cpp @@ -39,7 +39,7 @@ #include <QIODevice> #include <QMetaType> #include <QThread> -#include <QSharedPointer> +#include <QPointer> namespace { @@ -74,7 +74,7 @@ public: Private() {} - QWeakPointer<Thread> parserThread; + QPointer<Thread> parserThread; QString errorString; }; |