Review Request 127658: Fix Coverty Scan ID 1342595 - Dereference before null check
Andreas Cord-Landwehr
cordlandwehr at kde.org
Sun May 1 13:40:19 UTC 2016
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127658/#review95055
-----------------------------------------------------------
Ship it!
Yes, also the git history indicuates that a lot of code was copied when the class was created.
The refactoring & cleanup is really a big improvement.
- Andreas Cord-Landwehr
On April 15, 2016, 8:47 nachm., Hartmut Riesenbeck wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127658/
> -----------------------------------------------------------
>
> (Updated April 15, 2016, 8:47 nachm.)
>
>
> Review request for KDE Edu.
>
>
> Repository: parley
>
>
> Description
> -------
>
> Refactoring of class Collection. The pointer access before null check
> is located in the close() method wich is called in the destructor.
> Further invetigation showed that this call is useless because the
> KEduVocDocument is opened read only (see LibKEduVocDocument::close()).
> The close method call was removed.
>
> While further refactoring more unused fuctionality was removed.
>
> I'am not shure if this refactoring is too radical. Please correct me if I deleted too much.
>
> The Collection class is only used for counting the vocabulary expression states in the files shown on the dashboard page. So I removed all the functionality which is not used anywhere else in the source code. This makes the Collection class lightweigt, more simple and easy to understand.
>
> + Since the only Collection objects are constructed in dashboard.cpp the second constructor with pointer argument was removed.
> + Now KEduVocDocument files are only opened readonly. This makes closing, auto backup and the change signals useless.
> + Also the fetch grammar functionallity is not used.
>
> The TODO in collection.cpp line 134 seems to me already be done, so I removed it. Please correct me if I'm wrong.
>
>
> Diffs
> -----
>
> src/collection/collection.h 4e91603eea5a33af781104fcb856f4483b1ab5b8
> src/collection/collection.cpp 004d85fe411c882b541d0e1f8ecbfdf213d528c3
> src/dashboard/dashboard.cpp 4e60b10a1501a20d0f4741344035a5bc9b400d14
>
> Diff: https://git.reviewboard.kde.org/r/127658/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Hartmut Riesenbeck
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20160501/572ba482/attachment.html>
More information about the kde-edu
mailing list