Port away from and remove Controller::initiated
This commit is contained in:
@@ -68,7 +68,6 @@ Controller::Controller(QObject *parent)
|
|||||||
connect(c, &Connection::connected, this, [c, this]() {
|
connect(c, &Connection::connected, this, [c, this]() {
|
||||||
m_accountRegistry.add(c);
|
m_accountRegistry.add(c);
|
||||||
c->syncLoop();
|
c->syncLoop();
|
||||||
Q_EMIT initiated();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +219,6 @@ void Controller::invokeLogin()
|
|||||||
Q_EMIT accountsLoadingChanged();
|
Q_EMIT accountsLoadingChanged();
|
||||||
if (connection->userId() == id) {
|
if (connection->userId() == id) {
|
||||||
setActiveConnection(connection);
|
setActiveConnection(connection);
|
||||||
connectSingleShot(connection, &NeoChatConnection::syncDone, this, &Controller::initiated);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(connection, &NeoChatConnection::loginError, this, [this, connection](const QString &error, const QString &) {
|
connect(connection, &NeoChatConnection::loginError, this, [this, connection](const QString &error, const QString &) {
|
||||||
@@ -236,7 +234,6 @@ void Controller::invokeLogin()
|
|||||||
Q_EMIT errorOccured(i18n("Login Failed: %1", error), {});
|
Q_EMIT errorOccured(i18n("Login Failed: %1", error), {});
|
||||||
connection->logout(true);
|
connection->logout(true);
|
||||||
}
|
}
|
||||||
Q_EMIT initiated();
|
|
||||||
});
|
});
|
||||||
connect(connection, &NeoChatConnection::networkError, this, [this](const QString &error, const QString &, int, int) {
|
connect(connection, &NeoChatConnection::networkError, this, [this](const QString &error, const QString &, int, int) {
|
||||||
Q_EMIT errorOccured(i18n("Network Error: %1", error), {});
|
Q_EMIT errorOccured(i18n("Network Error: %1", error), {});
|
||||||
@@ -245,9 +242,6 @@ void Controller::invokeLogin()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (accounts.isEmpty()) {
|
|
||||||
Q_EMIT initiated();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QKeychain::ReadPasswordJob *Controller::loadAccessTokenFromKeyChain(const AccountSettings &account)
|
QKeychain::ReadPasswordJob *Controller::loadAccessTokenFromKeyChain(const AccountSettings &account)
|
||||||
|
|||||||
@@ -142,7 +142,6 @@ Q_SIGNALS:
|
|||||||
void errorOccured(const QString &error, const QString &detail);
|
void errorOccured(const QString &error, const QString &detail);
|
||||||
void connectionAdded(NeoChatConnection *connection);
|
void connectionAdded(NeoChatConnection *connection);
|
||||||
void connectionDropped(NeoChatConnection *connection);
|
void connectionDropped(NeoChatConnection *connection);
|
||||||
void initiated();
|
|
||||||
void activeConnectionChanged();
|
void activeConnectionChanged();
|
||||||
void userConsentRequired(QUrl url);
|
void userConsentRequired(QUrl url);
|
||||||
void accountsLoadingChanged();
|
void accountsLoadingChanged();
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ void LoginHelper::init()
|
|||||||
|
|
||||||
connectSingleShot(m_connection, &Connection::syncDone, this, [this]() {
|
connectSingleShot(m_connection, &Connection::syncDone, this, [this]() {
|
||||||
Q_EMIT loaded();
|
Q_EMIT loaded();
|
||||||
Q_EMIT Controller::instance().initiated();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ LoginStep {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: Controller
|
target: Controller
|
||||||
function onInitiated() {
|
function onConnectionAdded(connection) {
|
||||||
root.closeDialog()
|
connection.syncDone.connect(() => root.closeDialog())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ void Registration::registerAccount()
|
|||||||
Controller::instance().addConnection(connection);
|
Controller::instance().addConnection(connection);
|
||||||
Controller::instance().setActiveConnection(connection);
|
Controller::instance().setActiveConnection(connection);
|
||||||
connectSingleShot(connection, &Connection::syncDone, this, []() {
|
connectSingleShot(connection, &Connection::syncDone, this, []() {
|
||||||
Q_EMIT Controller::instance().initiated();
|
|
||||||
Q_EMIT LoginHelper::instance().loaded();
|
Q_EMIT LoginHelper::instance().loaded();
|
||||||
});
|
});
|
||||||
m_connection = nullptr;
|
m_connection = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user