Cancel task if conversion to XML fail
Needs RevisionPublic

Authored by ognarb on Fri, Nov 8, 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.Fri, Nov 8, 12:21 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptFri, Nov 8, 12:21 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
ognarb requested review of this revision.Fri, Nov 8, 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.Fri, Nov 8, 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.Mon, Nov 11, 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.Mon, Nov 11, 6:49 AM