Fix warning when reading plugin metadata
ClosedPublic

Authored by nicolasfella on Jun 21 2019, 3:01 PM.

Details

Summary

X-Purpose-PluginTypes is a StringList, not a String. Use an appropriate way of reading it.

Test Plan

Share file in Dolphin. Don't get org.kde.kcoreaddons: Expected JSON property "X-Purpose-PluginTypes" to be a single string. but it is a stringlist anymore.

Diff Detail

Repository
R495 Purpose Library
Branch
warning
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13092
Build 13110: arc lint + arc unit
nicolasfella created this revision.Jun 21 2019, 3:01 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJun 21 2019, 3:01 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
nicolasfella requested review of this revision.Jun 21 2019, 3:01 PM
nicolasfella retitled this revision from Fix warning when reading plugin metadata # NEW DIFFERENTIAL REVISION # Describe the changes in this new revision. # # Included commits in branch warning: # # bcbf41157e8b Fix warning when reading plugin metadata # # arc could not identify... to Fix warning when reading plugin metadata.Jun 21 2019, 3:01 PM
nicolasfella edited the summary of this revision. (Show Details)
nicolasfella edited the test plan for this revision. (Show Details)
nicolasfella added reviewers: apol, aacid.
nicolasfella edited the test plan for this revision. (Show Details)
  • Whitespace
aacid added a comment.Jun 21 2019, 3:32 PM

You only changed the debug line?

Doesn't feel like the right fix

nicolasfella added a comment.EditedJun 21 2019, 3:37 PM

It is the only place I found where KPluginMetaData.value is called on a list.

The other places where .value() is used is on QJsonObjects which handle lists just fine

aacid added a comment.Jun 21 2019, 4:11 PM

Right, i see the point now, would make more sense to change the line to

qDebug() << "discarding" << meta.name() << obj.value(QStringLiteral("X-Purpose-PluginTypes")).toArray() << "doesn't contain" << m_pluginType;

?

apol accepted this revision.Jun 21 2019, 10:02 PM

Improving the string like Albert says could make sense. Also porting to qCDebug. :)

This revision is now accepted and ready to land.Jun 21 2019, 10:02 PM
This revision was automatically updated to reflect the committed changes.