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

@@ -6,7 +6,6 @@
#include <QImageReader>
#include <QJsonDocument>
#include "controller.h"
#include "jobs/neochatchangepasswordjob.h"
#include "jobs/neochatdeactivateaccountjob.h"
#include "neochatconfig.h"
@@ -345,8 +344,8 @@ void NeoChatConnection::createRoom(const QString &name, const QString &topic, co
}
});
}
connect(job, &CreateRoomJob::failure, this, [job] {
Q_EMIT Controller::instance().errorOccured(i18n("Room creation failed: %1", job->errorString()), {});
connect(job, &CreateRoomJob::failure, this, [this, job] {
Q_EMIT errorOccured(i18n("Room creation failed: %1", job->errorString()));
});
connect(
this,
@@ -382,8 +381,8 @@ void NeoChatConnection::createSpace(const QString &name, const QString &topic, c
}
});
}
connect(job, &CreateRoomJob::failure, this, [job] {
Q_EMIT Controller::instance().errorOccured(i18n("Space creation failed: %1", job->errorString()), {});
connect(job, &CreateRoomJob::failure, this, [this, job] {
Q_EMIT errorOccured(i18n("Space creation failed: %1", job->errorString()));
});
connect(
this,