diff options
author | Michael Schuster <michael@schuster.ms> | 2020-01-17 22:21:42 +0300 |
---|---|---|
committer | Michael Schuster <michael@schuster.ms> | 2020-01-17 22:21:42 +0300 |
commit | 3ae55c2555fcbf1633a9b8f74b19c92f4c414624 (patch) | |
tree | 2ea1b8eed92c6dbd64b38bb6bf1b828890e1de03 | |
parent | b47adb7aebea838d4b4106cfb211e9c447db9d7e (diff) |
AccountState: Add helper to find navigation App
Signed-off-by: Michael Schuster <michael@schuster.ms>
-rw-r--r-- | src/gui/accountstate.cpp | 12 | ||||
-rw-r--r-- | src/gui/accountstate.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 899a7728c..1491db714 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -477,6 +477,18 @@ AccountAppList AccountState::appList() const return _apps; } +AccountApp* AccountState::findApp(const QString &appId) const +{ + if(!appId.isEmpty()) { + foreach(AccountApp *app, appList()) { + if(app->id() == appId) + return app; + } + } + + return nullptr; +} + /*-------------------------------------------------------------------------------------*/ AccountApp::AccountApp(const QString &name, const QUrl &url, diff --git a/src/gui/accountstate.h b/src/gui/accountstate.h index c89c664b0..433fb5116 100644 --- a/src/gui/accountstate.h +++ b/src/gui/accountstate.h @@ -106,6 +106,7 @@ public: bool hasTalk() const; AccountAppList appList() const; + AccountApp* findApp(const QString &appId) const; /** A user-triggered sign out which disconnects, stops syncs * for the account and forgets the password. */ |