Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/util/processlinemaker.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 32 | public: | |||
---|---|---|---|---|---|
47 | } | 47 | } | ||
48 | 48 | | |||
49 | static QStringList streamToStrings(QByteArray &data) | 49 | static QStringList streamToStrings(QByteArray &data) | ||
50 | { | 50 | { | ||
51 | QStringList lineList; | 51 | QStringList lineList; | ||
52 | int pos; | 52 | int pos; | ||
53 | while ( (pos = data.indexOf('\n')) != -1) { | 53 | while ( (pos = data.indexOf('\n')) != -1) { | ||
54 | if (pos > 0 && data.at(pos - 1) == '\r') | 54 | if (pos > 0 && data.at(pos - 1) == '\r') | ||
55 | lineList << QString::fromLocal8Bit(data, pos - 1); | 55 | lineList << QString::fromLocal8Bit(data.constData(), pos - 1); | ||
56 | else | 56 | else | ||
57 | lineList << QString::fromLocal8Bit(data, pos); | 57 | lineList << QString::fromLocal8Bit(data.constData(), pos); | ||
58 | data.remove(0, pos+1); | 58 | data.remove(0, pos+1); | ||
59 | } | 59 | } | ||
60 | return lineList; | 60 | return lineList; | ||
61 | } | 61 | } | ||
62 | 62 | | |||
63 | void processStdOut() | 63 | void processStdOut() | ||
64 | { | 64 | { | ||
65 | emit p->receivedStdoutLines(streamToStrings(stdoutbuf)); | 65 | emit p->receivedStdoutLines(streamToStrings(stdoutbuf)); | ||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |