From: Michael Schuster Date: Fri, 17 Jan 2020 19:21:42 +0000 (+0100) Subject: AccountState: Add helper to find navigation App X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~413^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3ae55c2555fcbf1633a9b8f74b19c92f4c414624;p=nextcloud-desktop.git AccountState: Add helper to find navigation App Signed-off-by: Michael Schuster --- 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. */