Skip to content

FileFetchJob: fix static initialization order problem

Elvis Angelaccio requested to merge work/bug-480063 into master

BasicFields/AccessFields/SharingFields are declared as static members, but in their definitions they require other static members.

This is a classic static initialization order problem. In particular it may happen that when BasicFields is defined, the Id/Title/.../Permissions members have not been defined yet: BasicFields then becomes a QStringList containing 8 empty QStrings.

This is what caused bug #480063 where the following broken query string was sent to google (by a FileFetchJob triggered by kio-gdrive):

fields=etag,kind,nextLink,nextPageToken,selfLink,items(,,,,,,,,labels,exportLinks,lastViewedByMeDate,alternateLink,kind)

The bug has been fixed with commit b57168b1 in the 24.08 release branch.

This commit adapts the fix for the master branch, where we can drop the duplicated strings and just break the public API: this shouldn't be a problem because kio-gdrive should be the only-user and has the same release schedule as libkgapi.

CCBUG: 480063

Edited by Elvis Angelaccio

Merge request reports

Loading