ListRevisions Method

Lists revisions for a file path or file resource Id.

Syntax

int ListRevisions(const QString& qsFileResource);

Remarks

This method lists revisions for a specific file path or for a specific file resource Id. This method is not supported for folder resources.

FileResource must be a file path, an Id-based relative file path, or a file resource Id.

Calling this method will fire the ResourceList event once for each resource, and will also populate the Resource* properties.

The MaxRevisionResults configuration setting controls the maximum number of results returned. (Note that unlike the class's other listing methods, the results returned by this method are never paged; MaxRevisionResults specifies the overall limit rather than the page size limit.)

Path-based vs. Id-based Revision Histories

When listing revisions, the server can return the revision history either by path or by Id. A path's revision history will include revisions for any and all files that have been located there; while an Id's revision history will only return revisions for the associated file resource (regardless of where it's been located over time).

By default, the class chooses which mode the server should use automatically each time ListRevisions is called based on the kind of resource identifier passed for the FileResource parameter. If a path (or an Id-based relative path) is provided, it chooses the path-based mode; and if a file resource Id is provided, it chooses the Id-based mode.

The ListRevisionsMode configuration setting can be used to explicitly control which revision listing mode the server should use.

// ResourceList event handler.
dropbox.OnResourceList += (s, e) => {
  Console.WriteLine(e.Name + ", Revision: " + e.Revision);
};

dropbox.ListRevisions("/work_stuff/serious_business/best_cat_pictures.zip");

for (int i = 0; i < dropbox.Resources.Count; i++) {
  // Process resource revisions here.
}

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Qt Edition - Version 20.0 [Build 8265]