<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/107138/">http://git.reviewboard.kde.org/r/107138/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On November 16th, 2012, 7:15 a.m., <b>Marko Käning</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/107138/diff/2/?file=92965#file92965line211" style="color: black; font-weight: bold; text-decoration: underline;">kmymoney/mymoney/mymoneypayee.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const QStringList& keys)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">211</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">m_matchKey</span> <span class="o">=</span> <span class="n">keys</span><span class="p">.</span><span class="n">join</span><span class="p">(</span><span class="s">";"</span><span class="p">);</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">211</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">QRegExp</span> <span class="n">validKeyRegExp</span><span class="p">(</span><span class="s">"[^ ]"</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I haven't tested this code, but I could imagine that it would be necessary to specify the regexp as "^[^ ]*$" in order to be sure that single or multiply occurring spaces get really excluded - but nothing else.
"[^ ]" would also match the strings " PAYMENT" and "PAYMENT " which you might not want to exclude.
(Well, I haven't looked into QRegExp though to check whether my above regexp is correct in this case.)</pre>
</blockquote>
<p>On November 16th, 2012, 9:33 p.m., <b>Łukasz Maszczyński</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Just to make sure we're on the same page: validKeyRegExp regexp shall match only if the payee string is _valid_, so if there's no match - the string shall be considered an _invalid_ payee matchstring.
Now, let's see what strings would be considered as (in)valid by both expressions:
[^ ] matches the following strings: "PAYEE", " PAYEE", "PAYEE ", "PA YEE", "P"
[^ ] does not match the following strings: " ", " ", ""
^[^ ]*$ matches the following strings: "PAYEE", "PA YEE", "P", ""
^[^ ]*$ does not match the following strings: " PAYEE", "PAYEE ", " ", " "
I believe the "[^ ]" regexp is correct.</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Sorry for the noise, I should have not commented on this issue, as I see now. I just didn't grasp what was actually required for the task you wanted to achieve. :)
Herewith I withdraw my remarks.</pre>
<br />
<p>- Marko</p>
<br />
<p>On October 30th, 2012, 6:46 p.m., Łukasz Maszczyński wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KMymoney.</div>
<div>By Łukasz Maszczyński.</div>
<p style="color: grey;"><i>Updated Oct. 30, 2012, 6:46 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">There are three possible options when it comes to payee matching for imported transactions:
1. no matching
2. by payee name
3. by list of keys
When the 3rd option is selected it's easy to make a mistake and add a single space as the match key - the user is unlikely to realize this, as "space key" is not visible on the list (it's just a space, right?) unless selected. The consequence of this mistake is that nearly all transactions will match the payee (to be precise: all transactions which contain at least one space in the 'payee' field).
The "new" regular expression in the patch requires payee match key to contain at least a single non-space character.
This patch changes the algorithm of checking the match key: instead of joining multiple match keys into a single string separated with semicolons and matching the whole string with a regular expression, each match key is checked with a regular expression separaterly (results in a simpler regular expression).
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">new UT written
make test
</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kmymoney/mymoney/mymoneypayee.cpp <span style="color: grey">(93e12c8)</span></li>
<li>kmymoney/mymoney/mymoneypayeetest.h <span style="color: grey">(d50d61d)</span></li>
<li>kmymoney/mymoney/mymoneypayeetest.cpp <span style="color: grey">(85ee7fd)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/107138/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>