Check for the correct "kind" strings in src/drive/parentreference.cpp and src/drive/app.cpp
ClosedPublic

Authored by martijnschmidt on Jan 9 2018, 8:51 PM.

Details

Summary

LibKGAPI does a sanity check on the data that was received from the Google API to make sure it contains the expected kind of resources.

In src/drive/parentreference.cpp the "kind" string that the code looks for was "kind#parentList" rather than "drive#parentList" as actually returned by the Google API. Therefore, further data processing was aborted and the class would always return an empty ParentReferencesList result. After correcting this I was able to fetch the desired non-empty output.

I looked for similar occurrences elsewhere in the code and found that src/drive/app.cpp was affected by the same problem.

References:
https://phabricator.kde.org/T3443
https://developers.google.com/drive/v2/reference/parents/list
https://developers.google.com/drive/v2/reference/apps

Diff Detail

Repository
R477 KGAPI Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
martijnschmidt requested review of this revision.Jan 9 2018, 8:51 PM
martijnschmidt created this revision.
dvratil accepted this revision.Jan 10 2018, 10:34 AM

Nice catch, thank you!

Do you have commit rights? If not, I can push it for you.

This revision is now accepted and ready to land.Jan 10 2018, 10:34 AM

I don't have commit rights - this is my 2nd KDE patch ever, so please go ahead and push it to the repository. Thanks! :)

@martijnschmidt What's the email you want to use for the commit authorship?

Restricted Application added a project: KDE PIM. · View Herald TranscriptJan 20 2018, 10:06 PM
Restricted Application added a subscriber: KDE PIM. · View Herald Transcript

@martijnschmidt What's the email you want to use for the commit authorship?

@elvisangelaccio martijn.schmidt@gmail.com would be fine!

This revision was automatically updated to reflect the committed changes.