Skip to content

Commit 58d21cb

Browse files
authored
Add important documentation on the async nature of Vfs::startImpl() (#12078)
This is to inform/warn VFS implementors of the fact that starting the VFS implementation is assumed to possibly start in the background. But more importantly: the client will not "wait" for one VFS instance to be started before calling `start` on a second instance. Meaning: synchronization (when needed) has to be done by the VFS impementation itself.
1 parent 41f81e5 commit 58d21cb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/common/vfs.h

+13
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ class OCSYNC_EXPORT Vfs : public QObject
155155
/** Initializes interaction with the VFS provider.
156156
*
157157
* The plugin-specific work is done in startImpl().
158+
*
159+
* \warning Please read the comments to \a startImpl() about the
160+
* asynchronous behaviour!
158161
*/
159162
void start(const VfsSetupParams &params);
160163

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

0 commit comments

Comments
 (0)