comparison src/mainwindow.cpp @ 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
comparison
equal deleted inserted replaced
642:b16e8ef6919b 661:005b4530c6ee
2107 // check was successful but there are no changes 2107 // check was successful but there are no changes
2108 // pending. This is the only case where we need to remove 2108 // pending. This is the only case where we need to remove
2109 // warning messages, because it's the only case where a 2109 // warning messages, because it's the only case where a
2110 // non-zero code can be returned even though the command 2110 // non-zero code can be returned even though the command
2111 // has for our purposes succeeded 2111 // has for our purposes succeeded
2112 QString replaced = stdErr; 2112 QStringList lines = stdErr.split(QRegExp("[\\r\\n]+"));
2113 while (1) { 2113 QString replaced;
2114 QString r1 = replaced; 2114 foreach (QString line, lines) {
2115 r1.replace(QRegExp("warning: [^\\n]*"), ""); 2115 line.replace(QRegExp("^.*warning: [^\\n]*"), "");
2116 if (r1 == replaced) break; 2116 if (line != "") {
2117 replaced = r1.trimmed(); 2117 replaced += line + "\n";
2118 }
2118 } 2119 }
2119 if (replaced == "") { 2120 if (replaced == "") {
2120 showIncoming(""); 2121 showIncoming("");
2121 return; 2122 return;
2122 } 2123 }