[Kmymoney-devel] Re: Review Request: csvplugin update to add additional unit test, and improve field delimiter handling

Thomas Baumgart thb at net-bembel.de
Thu Oct 14 13:36:11 CEST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5463/#review8146
-----------------------------------------------------------


A first quick run-through w/o even compiling the s/w.


/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvprocessing.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8417>

    I am missing the corresponding delete in the dtor



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvprocessing.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8419>

    Ah, here is the initilization. Please use a setter/getter if you want to access member vars outside of the object.



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvutil.h
<http://svn.reviewboard.kde.org/r/5463/#comment8420>

    Members should be non-public. Use getter/setter methods



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvutil.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8421>

    Initialize members here if they don't have auto-initialization, e.g. 'int', 'double', etc.



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvutil.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8418>

    Where is the initialization of m_fieldDelimerIndex?



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investprocessing.h
<http://svn.reviewboard.kde.org/r/5463/#comment8425>

    Members should be non-public



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investprocessing.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8422>

    Missing call of base class ctor here.



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investprocessing.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8426>

    This only modifies 10 widgets whereas enableInputs modifies 17.
    
    Better use a single method and pass it true/false as parameter, eg.
    
    enableInputs(bool enable) {...}
    
    disableInputs() { enableInputs(false); }
    
    enableInputs() { enableInputs(true); }
    
    This avoids the error prone job of maintaining two lists.



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investprocessing.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8427>

    better pass column as "const QString& column"



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investprocessing.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8428>

    better pass aName as "const QString& aName"



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/redefinedlg.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8429>

    Better pass type as "const QString& type"



/trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/redefinedlg.cpp
<http://svn.reviewboard.kde.org/r/5463/#comment8430>

    Use i18n here (and all other translatable strings)


- Thomas


On 2010-09-27 16:53:42, Allan Anderson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5463/
> -----------------------------------------------------------
> 
> (Updated 2010-09-27 16:53:42)
> 
> 
> Review request for kmymoney.
> 
> 
> Summary
> -------
> 
> The initial intention was to add an additional unit test, which involved removing data line parsing from the displayLine() routine into a small separate class to enable access from the unit test routine.  This led to benefits in two other areas.  
> 
> One csv test file I have had a comma as thousand separator, which was conflicting with the comma field separator.  Initially, I looked at this from the point of view of field separators and concocted a separator which successfully dealt with the issue.  However, I realised that the same odd separator might not work in another similar situation.  So, I've improved the detection and handling of this issue.
> 
> This then led to changes in csvProcessing() and investProcessing(), removing redundant code and improving efficiency slightly.
> 
> Two UIs have had a now unneeded field separator combobox item removed.  Some minor purely cosmetic changes also have been made.
> 
> 
> Diffs
> -----
> 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/CMakeLists.txt 1180212 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvimporterdlgdecl.ui 1180212 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvprocessing.h 1180212 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvprocessing.cpp 1180212 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvutil.h PRE-CREATION 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/csvutil.cpp PRE-CREATION 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investmentdlgdecl.ui 1180212 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investprocessing.h 1180212 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/investprocessing.cpp 1180212 
>   /trunk/extragear/office/kmymoney/kmymoney/plugins/csvimport/redefinedlg.cpp 1180212 
> 
> Diff: http://svn.reviewboard.kde.org/r/5463/diff
> 
> 
> Testing
> -------
> 
> The new parsedatatest() unit test runs successfully.  Krazy and astyle have been run. Functional testing done with various csv format files.
> 
> 
> Thanks,
> 
> Allan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kmymoney-devel/attachments/20101014/f37acb4e/attachment-0001.htm 


More information about the KMyMoney-devel mailing list