errorOccured

Have controller link to neochatconnection for errorOccured rather than call directly to remove dependency on controller.

For all the same reasons as network/neochat!1926
This commit is contained in:
James Graham
2024-10-03 20:32:30 +00:00
parent 153cbeae8a
commit 773017c881
8 changed files with 32 additions and 19 deletions

View File

@@ -85,7 +85,7 @@ void LoginHelper::init()
m_connection = nullptr;
});
connect(m_connection, &Connection::networkError, this, [this](QString error, const QString &, int, int) {
Q_EMIT Controller::instance().errorOccured(i18n("Network Error"), std::move(error));
Q_EMIT m_connection->errorOccured(i18n("Network Error: %1", std::move(error)));
m_isLoggingIn = false;
Q_EMIT isLoggingInChanged();
});
@@ -93,14 +93,14 @@ void LoginHelper::init()
if (error == QStringLiteral("Invalid username or password")) {
setInvalidPassword(true);
} else {
Q_EMIT errorOccured(i18n("Login Failed: %1", error));
Q_EMIT loginErrorOccured(i18n("Login Failed: %1", error));
}
m_isLoggingIn = false;
Q_EMIT isLoggingInChanged();
});
connect(m_connection, &Connection::resolveError, this, [](QString error) {
Q_EMIT Controller::instance().errorOccured(i18n("Network Error"), std::move(error));
connect(m_connection, &Connection::resolveError, this, [this](QString error) {
Q_EMIT m_connection->errorOccured(i18n("Network Error: %1", std::move(error)));
});
connect(