# HG changeset patch # User Chris Cannam # Date 1300304691 0 # Node ID 383223b1dd345754f676586fb27ed8e1b7352a11 # Parent 39a616befdbd156ca5f0089f64e0ab82a6312373 Fix regex use (ach) for weeding out spurious warnings from incoming text diff -r 39a616befdbd -r 383223b1dd34 mainwindow.cpp --- a/mainwindow.cpp Wed Mar 16 14:22:48 2011 +0000 +++ b/mainwindow.cpp Wed Mar 16 19:44:51 2011 +0000 @@ -1779,9 +1779,20 @@ case ACT_INCOMING: // returns non-zero code and no output if the check was // successful but there are no changes pending - if (output.replace(QRegExp("(^|\\n)warning: [^\\n]*\\n"), "").trimmed() == "") { - showIncoming(""); - return; + { + QString replaced = output; + while (1) { + QString r1 = replaced; + r1.replace(QRegExp("warning: [^\\n]*"), ""); + if (r1 == replaced) break; + replaced = r1.trimmed(); + } +// DEBUG << "incoming: text is " << output << endl; +// DEBUG << "replaced is " << replaced << endl; + if (replaced == "") { + showIncoming(""); + return; + } } break; // go on to default report case ACT_QUERY_HEADS: