Refactoring of signal/slots connection to new qt syntax

This commit is contained in:
Blue 2019-11-03 21:46:40 +03:00
parent 9d491e9e93
commit 0b57e6a77f
16 changed files with 81 additions and 83 deletions

View file

@ -30,15 +30,15 @@ Core::Conference::Conference(const QString& p_jid, const QString& p_account, boo
muc = true;
name = p_name;
connect(room, SIGNAL(joined()), this, SLOT(onRoomJoined()));
connect(room, SIGNAL(left()), this, SLOT(onRoomLeft()));
connect(room, SIGNAL(nameChanged(const QString&)), this, SLOT(onRoomNameChanged(const QString&)));
connect(room, SIGNAL(subjectChanged(const QString&)), this, SLOT(onRoomSubjectChanged(const QString&)));
connect(room, SIGNAL(participantAdded(const QString&)), this, SLOT(onRoomParticipantAdded(const QString&)));
connect(room, SIGNAL(participantChanged(const QString&)), this, SLOT(onRoomParticipantChanged(const QString&)));
connect(room, SIGNAL(participantRemoved(const QString&)), this, SLOT(onRoomParticipantRemoved(const QString&)));
connect(room, SIGNAL(nickNameChanged(const QString&)), this, SLOT(onRoomNickNameChanged(const QString&)));
connect(room, SIGNAL(error(const QXmppStanza::Error&)), this, SLOT(onRoomError(const QXmppStanza::Error&)));
connect(room, &QXmppMucRoom::joined, this, &Conference::onRoomJoined);
connect(room, &QXmppMucRoom::left, this, &Conference::onRoomLeft);
connect(room, &QXmppMucRoom::nameChanged, this, &Conference::onRoomNameChanged);
connect(room, &QXmppMucRoom::subjectChanged, this, &Conference::onRoomSubjectChanged);
connect(room, &QXmppMucRoom::participantAdded, this, &Conference::onRoomParticipantAdded);
connect(room, &QXmppMucRoom::participantChanged, this, &Conference::onRoomParticipantChanged);
connect(room, &QXmppMucRoom::participantRemoved, this, &Conference::onRoomParticipantRemoved);
connect(room, &QXmppMucRoom::nickNameChanged, this, &Conference::onRoomNickNameChanged);
connect(room, &QXmppMucRoom::error, this, &Conference::onRoomError);
room->setNickName(nick);
if (autoJoin) {

View file

@ -323,9 +323,9 @@ void Core::NetworkAccess::startDownload(const QString& messageId, const QString&
Download* dwn = new Download({{messageId}, 0, 0, true});
QNetworkRequest req(url);
dwn->reply = manager->get(req);
connect(dwn->reply, SIGNAL(downloadProgress(qint64, qint64)), SLOT(onDownloadProgress(qint64, qint64)));
connect(dwn->reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onRequestError(QNetworkReply::NetworkError)));
connect(dwn->reply, SIGNAL(finished()), SLOT(onRequestFinished()));
connect(dwn->reply, &QNetworkReply::downloadProgress, this, &NetworkAccess::onDownloadProgress);
connect(dwn->reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this, &NetworkAccess::onRequestError);
connect(dwn->reply, &QNetworkReply::finished, this, &NetworkAccess::onRequestFinished);
downloads.insert(std::make_pair(url, dwn));
emit downloadFileProgress(messageId, 0);
}