comparison mainwindow.cpp @ 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 076c2b3de51b
children 93feb59187f5
comparison
equal deleted inserted replaced
351:39a616befdbd 352:383223b1dd34
1777 enableDisableActions(); 1777 enableDisableActions();
1778 break; // go on to default report 1778 break; // go on to default report
1779 case ACT_INCOMING: 1779 case ACT_INCOMING:
1780 // returns non-zero code and no output if the check was 1780 // returns non-zero code and no output if the check was
1781 // successful but there are no changes pending 1781 // successful but there are no changes pending
1782 if (output.replace(QRegExp("(^|\\n)warning: [^\\n]*\\n"), "").trimmed() == "") { 1782 {
1783 showIncoming(""); 1783 QString replaced = output;
1784 return; 1784 while (1) {
1785 QString r1 = replaced;
1786 r1.replace(QRegExp("warning: [^\\n]*"), "");
1787 if (r1 == replaced) break;
1788 replaced = r1.trimmed();
1789 }
1790 // DEBUG << "incoming: text is " << output << endl;
1791 // DEBUG << "replaced is " << replaced << endl;
1792 if (replaced == "") {
1793 showIncoming("");
1794 return;
1795 }
1785 } 1796 }
1786 break; // go on to default report 1797 break; // go on to default report
1787 case ACT_QUERY_HEADS: 1798 case ACT_QUERY_HEADS:
1788 // fails if repo is empty; we don't care (if there's a genuine 1799 // fails if repo is empty; we don't care (if there's a genuine
1789 // problem, something else will fail too). Pretend it 1800 // problem, something else will fail too). Pretend it