diff options
author | Fabian Müller <fmueller@owncloud.com> | 2022-11-07 15:38:18 +0300 |
---|---|---|
committer | Fabian Müller <80399010+fmoc@users.noreply.github.com> | 2022-11-10 19:54:39 +0300 |
commit | 65a2efb2fadd6b4b9cb1a45910dd3f09d2d09118 (patch) | |
tree | 12311c4eac8f92dba6d182c2b5696fd3d4d8b6e0 | |
parent | 87a3f1e927a62616c9a7bad644328890a7eed5f4 (diff) |
Hide disabled spaces in spaces browser
-rw-r--r-- | src/gui/spaces/spacesbrowser.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/spaces/spacesbrowser.cpp b/src/gui/spaces/spacesbrowser.cpp index b112848b3..2fd19f529 100644 --- a/src/gui/spaces/spacesbrowser.cpp +++ b/src/gui/spaces/spacesbrowser.cpp @@ -77,7 +77,15 @@ void SpacesBrowser::setAccount(OCC::AccountPtr acc) QTimer::singleShot(0, this, [this] { auto drive = new OCC::GraphApi::Drives(_acc); connect(drive, &OCC::GraphApi::Drives::finishedSignal, this, [drive, this] { - _model->setDriveData(_acc, drive->drives()); + auto drives = drive->drives(); + + // hide disabled spaces + drives.erase(std::remove_if(drives.begin(), drives.end(), [](const OpenAPI::OAIDrive &drive) { + // this is how disabled spaces are represented in the graph API + return drive.getRoot().getDeleted().getState() == QStringLiteral("trashed"); + })); + + _model->setDriveData(_acc, drives); show(); }); drive->start(); |