Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2022-07-01 13:31:07 +0300
committerHannah von Reth <vonreth@kde.org>2022-07-05 11:23:43 +0300
commit8776d4c78f5e01aecaf88b826c1c06d2a00ef8bf (patch)
tree9185471f43d4d70dd5c2e6ba98ec94f407253c97 /src
parente53c12e8c0c417acf1d4b249ac7b2277ead9693e (diff)
Fix unit tests
Diffstat (limited to 'src')
-rw-r--r--src/gui/accountstate.cpp8
-rw-r--r--src/gui/folderman.h6
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp
index 86b0e5b70..a4cef5fb2 100644
--- a/src/gui/accountstate.cpp
+++ b/src/gui/accountstate.cpp
@@ -105,12 +105,16 @@ AccountState::AccountState(AccountPtr account)
_state = State::SignedOut;
});
- FolderMan::instance()->socketApi()->registerAccount(account);
+ if (FolderMan::instance()) {
+ FolderMan::instance()->socketApi()->registerAccount(account);
+ }
}
AccountState::~AccountState()
{
- FolderMan::instance()->socketApi()->unregisterAccount(account());
+ if (FolderMan::instance()) {
+ FolderMan::instance()->socketApi()->unregisterAccount(account());
+ }
}
AccountStatePtr AccountState::loadFromSettings(AccountPtr account, const QSettings &settings)
diff --git a/src/gui/folderman.h b/src/gui/folderman.h
index 9b9e50af5..3ec1ce778 100644
--- a/src/gui/folderman.h
+++ b/src/gui/folderman.h
@@ -88,6 +88,12 @@ public:
static bool prepareFolder(const QString &folder);
~FolderMan() override;
+
+ /**
+ * Helper to access the FolderMan instance
+ * Warning: may be null in unit tests
+ */
+ // TODO: use acces throug ocApp and remove that instance pointer
static FolderMan *instance();
int setupFolders();