Cancel task if conversion to XML fail
Needs RevisionPublic

Authored by ognarb on Nov 8 2019, 12:21 PM.

Details

Reviewers
dvratil
Group Reviewers
KDE PIM
Test Plan

Build without warning

Diff Detail

Repository
R44 KDE PIM Runtime
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18597
Build 18615: arc lint + arc unit
ognarb created this revision.Nov 8 2019, 12:21 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptNov 8 2019, 12:21 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
ognarb requested review of this revision.Nov 8 2019, 12:21 PM
ognarb edited the test plan for this revision. (Show Details)

Did you tested it ?

bool ContactGroupTool::convertToXml(const ContactGroup &group, QIODevice *device, QString *errorMessage)
{
    Q_UNUSED(errorMessage);

    XmlContactGroupWriter writer;
    writer.write(group, device);

    return true;
}

errorMessage was never used. So you will report an empty string.

What is the test case for this bug ?

why creating a errorMessage ?

ognarb added a comment.Nov 8 2019, 2:24 PM

Did you tested it ?

bool ContactGroupTool::convertToXml(const ContactGroup &group, QIODevice *device, QString *errorMessage)
 {
     Q_UNUSED(errorMessage);
 
     XmlContactGroupWriter writer;
     writer.write(group, device);
 
     return true;
 }

errorMessage was never used. So you will report an empty string.

What is the test case for this bug ?

So if the method never fail we should probably add this quite useful information in the doc and add a TODO KF6 to change the method signature

dvratil requested changes to this revision.Nov 11 2019, 6:49 AM
dvratil added a subscriber: dvratil.
dvratil added inline comments.
resources/contacts/contactsresource.cpp
256

Don't allocate QString on heap or use QScopedPointer/std::unqiue_ptr. Preferably just allocate it on stack and just pass a pointer to it to the function.

307

Same as above.

This revision now requires changes to proceed.Nov 11 2019, 6:49 AM