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

@@ -18,18 +18,22 @@ namespace Window {
class Controller final {
public:
explicit Controller(not_null<Main::Account*> account);
Controller();
~Controller();
Controller(const Controller &other) = delete;
Controller &operator=(const Controller &other) = delete;
Main::Account &account() const {
return *_account;
}
void showAccount(not_null<Main::Account*> account);
not_null<::MainWindow*> widget() {
return &_widget;
}
Main::Account &account() const {
Expects(_account != nullptr);
return *_account;
}
SessionController *sessionController() const {
return _sessionController.get();
}
@@ -74,10 +78,11 @@ private:
anim::type animated);
void checkThemeEditor();
not_null<Main::Account*> _account;
Main::Account *_account = nullptr;
::MainWindow _widget;
std::unique_ptr<SessionController> _sessionController;
rpl::lifetime _accountLifetime;
rpl::lifetime _lifetime;
};