D20945: KContacts - fix compile warnings

Allen Winter noreply at phabricator.kde.org
Thu May 2 12:57:01 BST 2019


winterz added inline comments.

INLINE COMMENTS

> pino wrote in ldifconverter.cpp:114-121
> this will now return the result of the last contactGroupToLDIF call -- so, if contactGroupToLDIF returns false for any element but last of the list, the result is still true (like the current code, though)
> 
> IMHO there are two options:
> a) if the results of the various contactGroupToLDIF is not wanted/needed, cast them to (void)
> b) if the results matter, either make sure that at least one failure generates a failure result of the whole function, or stop and fail at the first contactGroupToLDIF call that returns false

right.  my reason for this bad code was that I was following other patterns in the file.
for example, see LDIFConverter::addresseeAndContactGroupToLDIF()

I think the return value should matter and we should do:
result ||= contactGroupToLDIF(*it, str);

except I don't know what that will break.
I will try that and see if at least the unit tests still pass

REPOSITORY
  R174 PIM: KContacts

REVISION DETAIL
  https://phabricator.kde.org/D20945

To: winterz, vkrause, mlaurent
Cc: pino, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190502/a75b0f7c/attachment.html>


More information about the kde-pim mailing list