Skip to content

Commit 9635a50

Browse files
committed
Always group in the sidebar when that is available
And remove all traces of `groupInSidebar`.
1 parent 5c31b29 commit 9635a50

File tree

7 files changed

+6
-39
lines changed

7 files changed

+6
-39
lines changed

src/common/vfs.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,9 @@ const VfsPluginManager &VfsPluginManager::instance()
276276
return *_instance;
277277
}
278278

279-
VfsSetupParams::VfsSetupParams(Account *account, const QUrl &baseUrl, bool groupInSidebar, SyncEngine *syncEngine)
279+
VfsSetupParams::VfsSetupParams(Account *account, const QUrl &baseUrl, SyncEngine *syncEngine)
280280
: account(account)
281281
, _baseUrl(baseUrl)
282-
, _groupInSidebar(groupInSidebar)
283282
, _syncEngine(syncEngine)
284283
{
285284
}

src/common/vfs.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SyncEngine;
4444
/** Collection of parameters for initializing a Vfs instance. */
4545
struct OCSYNC_EXPORT VfsSetupParams
4646
{
47-
explicit VfsSetupParams(Account *account, const QUrl &baseUrl, bool groupInSidebar, SyncEngine *syncEngine);
47+
explicit VfsSetupParams(Account *account, const QUrl &baseUrl, SyncEngine *syncEngine);
4848
/** The full path to the folder on the local filesystem
4949
*
5050
* Always ends with /.
@@ -81,16 +81,10 @@ struct OCSYNC_EXPORT VfsSetupParams
8181
return _baseUrl;
8282
}
8383

84-
bool groupInSidebar() const
85-
{
86-
return _groupInSidebar;
87-
}
88-
8984
SyncEngine *syncEngine() const;
9085

9186
private:
9287
QUrl _baseUrl;
93-
bool _groupInSidebar = false;
9488
SyncEngine *_syncEngine;
9589
};
9690

src/gui/folder.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ void Folder::startVfs()
503503
return;
504504
}
505505

506-
VfsSetupParams vfsParams(_accountState->account(), webDavUrl(), groupInSidebar(), _engine.get());
506+
VfsSetupParams vfsParams(_accountState->account(), webDavUrl(), _engine.get());
507507
vfsParams.filesystemPath = path();
508508
vfsParams.remotePath = remotePathTrailingSlash();
509509
vfsParams.journal = &_journal;
@@ -1227,15 +1227,4 @@ QString FolderDefinition::displayName() const
12271227
return _displayName;
12281228
}
12291229

1230-
bool Folder::groupInSidebar() const
1231-
{
1232-
if (_accountState && _accountState->account() && _accountState->account()->hasDefaultSyncRoot()) {
1233-
// QFileInfo is horrible and "/foo/" is treated different to "/foo"
1234-
const QString parentDir = QFileInfo(Utility::stripTrailingSlash(path())).dir().path();
1235-
// If parentDir == home, we would add the home dir to the sidebar.
1236-
return QFileInfo(parentDir) != QFileInfo(QDir::homePath()) && FileSystem::isChildPathOf(parentDir, _accountState->account()->defaultSyncRoot());
1237-
}
1238-
return false;
1239-
}
1240-
12411230
} // namespace OCC

src/gui/folder.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,6 @@ class OWNCLOUDGUI_EXPORT Folder : public QObject
323323
/** Whether this folder should show selective sync ui */
324324
bool supportsSelectiveSync() const;
325325

326-
/**
327-
* Whether to register the parent folder of our sync root in the explorer
328-
* The default behaviour is to register alls spaces in a common dir in the home folder
329-
* in that case we only display that common dir in the Windows sidebar.
330-
* With the legacy behaviour we only have one dir which we will register with Windows
331-
*/
332-
bool groupInSidebar() const;
333-
334326
/**
335327
* The folder is deployed by an admin
336328
* We will hide the remove option and the disable/enable vfs option.

src/gui/folderman.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,7 @@ Folder *FolderMan::addFolderFromScratch(AccountState *accountState, FolderDefini
960960
auto newFolder = addFolder(accountState, folderDefinition);
961961

962962
if (newFolder) {
963-
// With spaces we only handle the main folder
964-
if (!newFolder->groupInSidebar()) {
963+
if (newFolder->vfs().mode() != Vfs::WindowsCfApi) {
965964
Utility::setupFavLink(folderDefinition.localPath());
966965
}
967966
qCDebug(lcFolderMan) << "Local sync folder" << folderDefinition.localPath() << "successfully created!";

src/plugins/vfs/win/vfs_win.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,7 @@ void VfsWinPrivate::registerFolder(const VfsSetupParams &params)
609609
// A Uri to a cloud storage recycle bin.
610610
//providerInfo.RecycleBinUri(L"recycle bin");
611611

612-
qCInfo(lcVfs)<<"winvfs: groupInsidebar:"<<params.groupInSidebar();
613-
if (!params.groupInSidebar()) {
614-
qCWarning(lcVfs) << "groupInsidebar info: parent dir:" << QFileInfo(Utility::stripTrailingSlash(syncRoot)).dir().path()
615-
<< "home path:" << QDir::homePath()
616-
<< "default sync root:" << params.account->defaultSyncRoot();
617-
}
618-
providerInfo.ShowSiblingsAsGroup(params.groupInSidebar());
612+
providerInfo.ShowSiblingsAsGroup(true);
619613

620614
// Prepage the key from the shell property store we'll use to determine
621615
// availability.

test/testutils/syncenginetestutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ void FakeFolder::switchToVfs(QSharedPointer<OCC::Vfs> vfs)
927927
opts._vfs = vfs;
928928
_syncEngine->setSyncOptions(opts);
929929

930-
OCC::VfsSetupParams vfsParams(account(), account()->davUrl(), false, &syncEngine());
930+
OCC::VfsSetupParams vfsParams(account(), account()->davUrl(), &syncEngine());
931931
vfsParams.filesystemPath = localPath();
932932
vfsParams.remotePath = QLatin1Char('/');
933933
vfsParams.journal = _journalDb.get();

0 commit comments

Comments
 (0)