Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add important documentation on the async nature of Vfs::startImpl() #12078

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/common/vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ class OCSYNC_EXPORT Vfs : public QObject
/** Initializes interaction with the VFS provider.
*
* The plugin-specific work is done in startImpl().
*
* \warning Please read the comments to \a startImpl() about the
* asynchronous behaviour!
*/
void start(const VfsSetupParams &params);

Expand Down Expand Up @@ -267,6 +270,16 @@ public Q_SLOTS:
*
* Usually some registration needs to be done with the backend. This function
* should take care of it if necessary.
*
* \note The implementation is allowed to run asynchronously, meaning the method
* can return before the start is fully complete. On completion, the
* \a started() signal is emitted.
* \warning For VFS implementations: the rest of the code in the client assumes
* that it is safe to do multiple calls to this method, EVEN IF A PREVIOUS
* START IS NOT FULLY FINISHED. If ANY synchronization needs to be done
* (e.g. reading/writing to the Windows registry, or searching for
* StorageProvider information), this has to be implemented in the
* plugin itself.
*/
virtual void startImpl(const VfsSetupParams &params) = 0;

Expand Down
Loading