Second batch of coverity fixes.
Details
Diff Detail
- Repository
- R261 KMyMoney
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Compiling this patch, I get the following warnings (I think I mentioned the result one already):
/home/thb/devel/kmymoney/kmymoney/dialogs/kequitypriceupdatedlg.cpp:525:9: warning: variable 'result' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (item) ^~~~ /home/thb/devel/kmymoney/kmymoney/dialogs/kequitypriceupdatedlg.cpp:534:7: note: uninitialized use occurs here if (result == KMessageBox::No) { ^~~~~~ /home/thb/devel/kmymoney/kmymoney/dialogs/kequitypriceupdatedlg.cpp:525:5: note: remove the 'if' if its condition is always true if (item) ^~~~~~~~~ /home/thb/devel/kmymoney/kmymoney/dialogs/kequitypriceupdatedlg.cpp:523:13: note: initialize the variable 'result' to silence this warning int result; ^ = 0
But it compiles otherwise. I have not run it.
kmymoney/dialogs/kequitypriceupdatedlg.cpp | ||
---|---|---|
523–524 | result should be initialized here to a default in case item is zero | |
kmymoney/dialogs/stdtransactioneditor.cpp | ||
532–533 | Shouldn't that be if (category && category->completion()) | |
kmymoney/plugins/csv/import/core/csvimportercore.h | ||
196 | Better format it as follows (this applies to other spots as well) explicit PricesProfile() : CSVProfile() , m_donAks(0) , m_priceFraction(2) : : | |
kmymoney/reports/tests/reportstestcommon.cpp | ||
138–139 | Is this indented correctly? It does not show here, hence I am asking. |
kmymoney/dialogs/kequitypriceupdatedlg.cpp | ||
---|---|---|
523–524 | Simple return should do it. | |
kmymoney/dialogs/stdtransactioneditor.cpp | ||
532–533 | It should be, but Coverity doesn't report that and that's my only goal. | |
kmymoney/plugins/csv/import/core/csvimportercore.h | ||
196 | I didn't know it. It looks like it's against the rules to start new line with punctuation mark. What's the advantage of formatting it your way? If it has any advantage then I would suggest to do it from no on forward. | |
kmymoney/reports/tests/reportstestcommon.cpp | ||
138–139 | It wasn't. |
Otherwise, it works for me.
kmymoney/plugins/csv/import/core/csvimportercore.h | ||
---|---|---|
196 | It easier to move stuff around and add to the end. You don't need to change any existing code. |
kmymoney/plugins/csv/import/core/csvimportercore.h | ||
---|---|---|
196 | In my opinion the effort is equal and you have lot less whitespaces. I like my way better, as it resembles common writing rules and ":" looks like written in Python. |
According to kdelibs style (https://community.kde.org/Policies/Kdelibs_Coding_Style), which is derived from Qt style, constructor initializers are formatted with ',' as suffix, not as prefix. You may run the astyle command at the mentioned page to see this.