2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Allow several accounts in Core::App.

This commit is contained in:
John Preston
2020-06-15 20:25:02 +04:00
parent 815e26eea5
commit 6fc5e22882
36 changed files with 834 additions and 267 deletions

View File

@@ -36,6 +36,7 @@ void quit();
} // namespace App
namespace Main {
class Accounts;
class Account;
class Session;
} // namespace Main
@@ -150,10 +151,12 @@ public:
return *_databases;
}
// Account component.
[[nodiscard]] Main::Account &activeAccount() const {
return *_account;
// Accounts component.
[[nodiscard]] Main::Accounts &accounts() const {
return *_accounts;
}
[[nodiscard]] Main::Account &activeAccount() const;
[[nodiscard]] bool someSessionExists() const;
[[nodiscard]] bool exportPreventsQuit();
// Main::Session component.
@@ -278,7 +281,7 @@ private:
const std::unique_ptr<Storage::Databases> _databases;
const std::unique_ptr<Ui::Animations::Manager> _animationsManager;
const std::unique_ptr<MTP::DcOptions> _dcOptions;
const std::unique_ptr<Main::Account> _account;
const std::unique_ptr<Main::Accounts> _accounts;
std::unique_ptr<Window::Controller> _window;
std::unique_ptr<Media::View::OverlayWidget> _mediaView;
const std::unique_ptr<Lang::Instance> _langpack;