CLOUD: Make Google Drive sort files list

GoogleDriveListDirectoryByIdRequest now uses "orderBy" field to specify
that we want the commonly used "alphabetical, folders first" order.

That's mostly needed for RemoteBrowserDialog, because Requests don't
care about the order, and this one is more user-friendly.
This commit is contained in:
Alexander Tkachev 2016-07-04 13:40:32 +06:00
parent 6faf2c2617
commit a37c639986

View file

@ -55,7 +55,7 @@ void GoogleDriveListDirectoryByIdRequest::start() {
}
void GoogleDriveListDirectoryByIdRequest::makeRequest(Common::String pageToken) {
Common::String url = "https://www.googleapis.com/drive/v3/files?spaces=drive&fields=files%28id,mimeType,modifiedTime,name,size%29,nextPageToken";
Common::String url = "https://www.googleapis.com/drive/v3/files?spaces=drive&fields=files%28id,mimeType,modifiedTime,name,size%29,nextPageToken&orderBy=folder,name";
//files(id,mimeType,modifiedTime,name,size),nextPageToken
if (pageToken != "") url += "&pageToken=" + pageToken;
url += "&q=%27" + _requestedId + "%27+in+parents";