Move login and registration to login

To make this work `AccountManager` is split off from controller taking all the code around `AccountRegister` and is added to LibNeoChat as it makes sense to have this functionality there.
This commit is contained in:
James Graham
2025-04-13 11:23:17 +00:00
parent b9ffe12154
commit 866fee2ea3
17 changed files with 544 additions and 271 deletions

View File

@@ -45,10 +45,13 @@
#include <Quotient/networkaccessmanager.h>
#include "accountmanager.h"
#include "blurhashimageprovider.h"
#include "colorschemer.h"
#include "controller.h"
#include "logger.h"
#include "login.h"
#include "registration.h"
#include "roommanager.h"
#include "sharehandler.h"
#include "windowcontroller.h"
@@ -208,7 +211,6 @@ int main(int argc, char *argv[])
about.setupCommandLine(&parser);
parser.process(app);
about.processCommandLine(&parser);
Controller::setTestMode(parser.isSet("test"_L1));
#ifdef HAVE_KUNIFIEDPUSH
if (parser.isSet(dbusActivatedOption)) {
@@ -232,6 +234,11 @@ int main(int argc, char *argv[])
KDBusService service(KDBusService::Unique);
#endif
const auto accountManager = std::make_unique<AccountManager>(parser.isSet("test"_L1));
Controller::instance().setAccountManager(accountManager.get());
LoginHelper::instance().setAccountManager(accountManager.get());
Registration::instance().setAccountManager(accountManager.get());
Q_IMPORT_QML_PLUGIN(org_kde_neochat_settingsPlugin)
Q_IMPORT_QML_PLUGIN(org_kde_neochat_timelinePlugin)
Q_IMPORT_QML_PLUGIN(org_kde_neochat_devtoolsPlugin)