Review Request 127658: Fix Coverty Scan ID 1342595 - Dereference before null check

Hartmut Riesenbeck hartmut.riesenbeck at gmx.de
Sun May 1 20:21:54 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127658/
-----------------------------------------------------------

(Updated May 1, 2016, 8:21 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Edu.


Changes
-------

Submitted with commit ffa77071600a4eb8a55f3ff11e5630b729c8ea21 by Hartmut Riesenbeck to branch master.


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/e95cbd21/attachment.html>


More information about the kde-edu mailing list