parent
38afdeeb8e
commit
24fc466630
|
@ -1 +1 @@
|
||||||
Subproject commit f9dccac588f2aa1c809018c0c5eb606a1470d2c5
|
Subproject commit 52081fe91724e5f2a82c55f0e6230d8841dd859a
|
|
@ -11,4 +11,4 @@ Primary=#344955
|
||||||
Accent=#673AB7
|
Accent=#673AB7
|
||||||
;Foreground=#1D333E
|
;Foreground=#1D333E
|
||||||
;Background=#161616
|
;Background=#161616
|
||||||
Font/Family=Roboto
|
Font/Family="Roboto,Noto Color Emoji"
|
||||||
|
|
|
@ -42,7 +42,6 @@ Controller::Controller(QObject* parent)
|
||||||
|
|
||||||
Controller::~Controller() {
|
Controller::~Controller() {
|
||||||
for (Connection* c : m_connections) {
|
for (Connection* c : m_connections) {
|
||||||
c->saveState();
|
|
||||||
c->stopSync();
|
c->stopSync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,10 +77,9 @@ void Controller::loginWithCredentials(QString serverAddr, QString user,
|
||||||
[=](QString error, QString, int, int) {
|
[=](QString error, QString, int, int) {
|
||||||
emit errorOccured("Network Error", error);
|
emit errorOccured("Network Error", error);
|
||||||
});
|
});
|
||||||
connect(conn, &Connection::loginError,
|
connect(conn, &Connection::loginError, [=](QString error, QString) {
|
||||||
[=](QString error, QString) {
|
emit errorOccured("Login Failed", error);
|
||||||
emit errorOccured("Login Failed", error);
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,9 +112,7 @@ void Controller::addConnection(Connection* c) {
|
||||||
connect(c, &Connection::syncDone, this, [=] {
|
connect(c, &Connection::syncDone, this, [=] {
|
||||||
emit syncDone();
|
emit syncDone();
|
||||||
c->sync(30000);
|
c->sync(30000);
|
||||||
|
c->saveState();
|
||||||
static int counter = 0;
|
|
||||||
if (++counter % 17 == 2) c->saveState();
|
|
||||||
});
|
});
|
||||||
connect(c, &Connection::loggedOut, this, [=] { dropConnection(c); });
|
connect(c, &Connection::loggedOut, this, [=] { dropConnection(c); });
|
||||||
|
|
||||||
|
@ -149,10 +145,9 @@ void Controller::invokeLogin() {
|
||||||
c->loadState();
|
c->loadState();
|
||||||
addConnection(c);
|
addConnection(c);
|
||||||
});
|
});
|
||||||
connect(c, &Connection::loginError,
|
connect(c, &Connection::loginError, [=](QString error, QString) {
|
||||||
[=](QString error, QString) {
|
emit errorOccured("Login Failed", error);
|
||||||
emit errorOccured("Login Failed", error);
|
});
|
||||||
});
|
|
||||||
connect(c, &Connection::networkError,
|
connect(c, &Connection::networkError,
|
||||||
[=](QString error, QString, int, int) {
|
[=](QString error, QString, int, int) {
|
||||||
emit errorOccured("Network Error", error);
|
emit errorOccured("Network Error", error);
|
||||||
|
|
Loading…
Reference in New Issue