Fix iconitemtest regression
ClosedPublic

Authored by joselema on Nov 7 2018, 5:45 PM.

Details

Reviewers
mart
apol
Summary

Hi,

after this commit
https://cgit.kde.org/plasma-framework.git/commit/?id=9f08668147d2e99f8b5069ff50d5c54e672a87af

The iconitemtest started to fail. As we can see from that commit the set of changes starts with this:

if (sourceString.endsWith(QLatin1String(".svg")) ||
    sourceString.endsWith(QLatin1String(".svgz"))) {
    m_icon = QIcon(localFile);
    m_imageIcon = QImage();
} else {
    m_icon = QIcon(localFile);
    m_imageIcon = QImage();
}

As we can see the code executed in the "if" block and the "else" block is exactly the same. My guess (and it's just a wild guess because I don't actually understand the code involved) is that you actually wanted to do this:

if (sourceString.endsWith(QLatin1String(".svg")) ||
    sourceString.endsWith(QLatin1String(".svgz"))) {
    m_icon = QIcon(localFile);
    m_imageIcon = QImage();
} else {
    m_icon = QIcon();
    m_imageIcon = QImage(localfile);
}

So I'm attaching a patch doing that ↑

Test Plan

I have just built the code with the patch, it fixes the test for me, but I'm not sure if the patch is correct.

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Lint Skipped
Unit
Unit Tests Skipped
joselema created this revision.Nov 7 2018, 5:45 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 7 2018, 5:45 PM
Restricted Application removed a subscriber: Frameworks. · View Herald Transcript
joselema requested review of this revision.Nov 7 2018, 5:45 PM
mart accepted this revision.Nov 8 2018, 4:37 AM
This revision is now accepted and ready to land.Nov 8 2018, 4:37 AM