changeset 661:005b4530c6ee

Be more flexible about the sorts of warning message we can remove in incoming
author Chris Cannam
date Fri, 09 Nov 2012 14:48:02 +0000
parents b16e8ef6919b
children 43c61fd6fea4
files src/mainwindow.cpp
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/mainwindow.cpp	Fri Oct 19 12:08:11 2012 +0100
+++ b/src/mainwindow.cpp	Fri Nov 09 14:48:02 2012 +0000
@@ -2109,12 +2109,13 @@
             // warning messages, because it's the only case where a
             // non-zero code can be returned even though the command
             // has for our purposes succeeded
-            QString replaced = stdErr;
-            while (1) {
-                QString r1 = replaced;
-                r1.replace(QRegExp("warning: [^\\n]*"), "");
-                if (r1 == replaced) break;
-                replaced = r1.trimmed();
+            QStringList lines = stdErr.split(QRegExp("[\\r\\n]+"));
+            QString replaced;
+            foreach (QString line, lines) {
+                line.replace(QRegExp("^.*warning: [^\\n]*"), "");
+                if (line != "") {
+                    replaced += line + "\n";
+                }
             }
             if (replaced == "") {
                 showIncoming("");