Browse Source

Restore backward compatibility with qt 5.12.0

pull/142/head
lucretius 3 months ago
parent
commit
063303413c
  1. 14
      src/connection.cpp

14
src/connection.cpp

@ -116,7 +116,7 @@ void ConnectionLoader::ShowProgress()
DEBUG("Created syncTimer");
connection->doRPC("sync", "", [=](auto) {
qDebug()<< "Finished syncing";
isSyncing->storeRelaxed(false);
isSyncing->store(false);
syncTimer->deleteLater();
this->doRPCSetConnectionShield(connection);
}, [=](auto) {
@ -124,7 +124,7 @@ void ConnectionLoader::ShowProgress()
});
QObject::connect(syncTimer, &QTimer::timeout, [=]() {
if (!isSyncing || !isSyncing->loadRelaxed()) {
if (!isSyncing || !isSyncing->load()) {
DEBUG("Syncing complete or isSyncing is null, stopping timer");
syncTimer->stop();
return;
@ -218,7 +218,7 @@ void ConnectionLoader::doAutoConnect()
auto connection = makeConnection(config);
auto me = this;
qDebug() << __func__ << ": server=" << config->server
<< " connection=" << connection << " me=" << me << Qt::endl;
<< " connection=" << connection << " me=" << me << endl;
// After the lib is initialized, try to do get info
connection->doRPC("info", "", [=](auto reply) {
@ -226,7 +226,7 @@ void ConnectionLoader::doAutoConnect()
connection->setInfo(reply);
DEBUG("getting Connection reply");
isSyncing = new QAtomicInteger<bool>();
isSyncing->storeRelaxed(true);
isSyncing->store(true);
DEBUG("isSyncing set to true");
// Do a sync at startup
@ -234,7 +234,7 @@ void ConnectionLoader::doAutoConnect()
DEBUG("Beginning sync at startup");
connection->doRPC("sync", "", [=](auto) {
qDebug()<<"finished syncing startup";
isSyncing->storeRelaxed(false);
isSyncing->store(false);
// Cancel the timer
syncTimer->deleteLater();
// When sync is done, set the connection
@ -245,7 +245,7 @@ void ConnectionLoader::doAutoConnect()
QTimer::singleShot(5000, [=]() { // 5-second delay
connection->doRPC("sync", "", [=](auto) mutable {
qDebug()<<"sync success with server=" << config->server;
isSyncing->storeRelaxed(false);
isSyncing->store(false);
// Cancel the timer
syncTimer->deleteLater();
// When sync is done, set the connection
@ -259,7 +259,7 @@ void ConnectionLoader::doAutoConnect()
// While it is syncing, we'll show the status updates while it is alive.
QObject::connect(syncTimer, &QTimer::timeout, [=]() {
DEBUG("Check the sync status");
if (isSyncing != nullptr && isSyncing->loadRelaxed()) {
if (isSyncing != nullptr && isSyncing->load()) {
DEBUG("Getting the sync status");
try {
connection->doRPC("syncstatus", "", [=](json reply) {

Loading…
Cancel
Save