changeset 352:383223b1dd34

Fix regex use (ach) for weeding out spurious warnings from incoming text
author Chris Cannam
date Wed, 16 Mar 2011 19:44:51 +0000
parents 39a616befdbd
children 93feb59187f5 f08ecba0f17b
files mainwindow.cpp
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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: