diff options
author | Christian Kamm <mail@ckamm.de> | 2017-03-20 16:28:32 +0300 |
---|---|---|
committer | ckamm <mail@ckamm.de> | 2017-03-21 19:07:35 +0300 |
commit | f67989afea6c2c98b6a3d2f4ee12ca0b01df97c8 (patch) | |
tree | ab656e3473fce7bd8575365c06f366f63c3c7d08 /src/gui/folderman.h | |
parent | 14fef4a0d3d259b538f59c8831cf65719c642f3c (diff) |
Wizards: Never propose an existing folder for syncing #5597
Diffstat (limited to 'src/gui/folderman.h')
-rw-r--r-- | src/gui/folderman.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/folderman.h b/src/gui/folderman.h index 7386335b4..2545c8838 100644 --- a/src/gui/folderman.h +++ b/src/gui/folderman.h @@ -124,11 +124,24 @@ public: * Check if @a path is a valid path for a new folder considering the already sync'ed items. * Make sure that this folder, or any subfolder is not sync'ed already. * + * Note that different accounts are allowed to sync to the same folder. + * * \a forNewDirectory is internal and is used for recursion. * * @returns an empty string if it is allowed, or an error if it is not allowed */ - QString checkPathValidityForNewFolder(const QString &path, const QUrl& serverUrl = QUrl(), bool forNewDirectory = false); + QString checkPathValidityForNewFolder(const QString &path, const QUrl& serverUrl = QUrl(), bool forNewDirectory = false) const; + + /** + * Attempts to find a non-existing, acceptable path for creating a new sync folder. + * + * Uses \a basePath as the baseline. It'll return this path if it's acceptable. + * + * Note that this can fail. If someone syncs ~ and \a basePath is ~/ownCloud, no + * subfolder of ~ would be a good candidate. When that happens \a basePath + * is returned. + */ + QString findGoodPathForNewSyncFolder(const QString &basePath, const QUrl &serverUrl) const; /** * While ignoring hidden files can theoretically be switched per folder, |