1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 12:03:18 +02:00

project: don't use Qt keywords for signal/slot/emit

Gitlab: #320
Change-Id: Ia2a16a05be3fd6452a39df999660a5c8440eea13
This commit is contained in:
Mingrui Zhang 2021-03-29 16:51:53 -04:00 committed by Andreas Traczyk
parent 4ce208ec33
commit 2e60568307
39 changed files with 132 additions and 126 deletions

View file

@ -29,6 +29,9 @@ set(QML_LIBS
Qt5::DBus
Qt5::Core)
# library compatibility (boost, libnotify, etc.)
add_definitions(-DQT_NO_KEYWORDS)
set(COMMON_SOURCES
${SRC_DIR}/bannedlistmodel.cpp
${SRC_DIR}/accountlistmodel.cpp

View file

@ -6,6 +6,9 @@ win32-msvc {
CONFIG += suppress_vcproj_warnings c++17 qtquickcompiler
# library compatibility (boost, libnotify, etc.)
CONFIG += no_keywords
QTQUICK_COMPILER_SKIPPED_RESOURCES += resources.qrc
# compiler options

View file

@ -32,7 +32,7 @@ public:
: QAbstractListModel(parent) {};
~AbstractListModelBase() = default;
signals:
Q_SIGNALS:
void lrcInstanceChanged();
protected:

View file

@ -79,13 +79,13 @@ AccountAdapter::connectFailure()
&lrc::api::NewAccountModel::accountRemoved,
[this](const QString& accountId) {
Q_UNUSED(accountId);
emit reportFailure();
Q_EMIT reportFailure();
});
Utils::oneShotConnect(&lrcInstance_->accountModel(),
&lrc::api::NewAccountModel::invalidAccountDetected,
[this](const QString& accountId) {
Q_UNUSED(accountId);
emit reportFailure();
Q_EMIT reportFailure();
});
}
@ -113,8 +113,8 @@ AccountAdapter::createJamiAccount(QString registeredName,
&lrc::api::NewAccountModel::profileUpdated,
[this, showBackup, addedAccountId = accountId](const QString& accountId) {
if (addedAccountId == accountId) {
emit lrcInstance_->accountListChanged();
emit accountAdded(accountId,
Q_EMIT lrcInstance_->accountListChanged();
Q_EMIT accountAdded(accountId,
showBackup,
lrcInstance_->accountModel().getAccountList().indexOf(
accountId));
@ -126,8 +126,8 @@ AccountAdapter::createJamiAccount(QString registeredName,
settings["password"].toString(),
registeredName);
} else {
emit lrcInstance_->accountListChanged();
emit accountAdded(accountId,
Q_EMIT lrcInstance_->accountListChanged();
Q_EMIT accountAdded(accountId,
showBackup,
lrcInstance_->accountModel().getAccountList().indexOf(accountId));
}
@ -161,8 +161,8 @@ AccountAdapter::createSIPAccount(const QVariantMap& settings)
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
emit lrcInstance_->accountListChanged();
emit accountAdded(accountId,
Q_EMIT lrcInstance_->accountListChanged();
Q_EMIT accountAdded(accountId,
false,
lrcInstance_->accountModel().getAccountList().indexOf(
accountId));
@ -195,11 +195,11 @@ AccountAdapter::createJAMSAccount(const QVariantMap& settings)
confProps.Ringtone.ringtonePath = Utils::GetRingtonePath();
lrcInstance_->accountModel().setAccountConfig(accountId, confProps);
emit accountAdded(accountId,
Q_EMIT accountAdded(accountId,
false,
lrcInstance_->accountModel().getAccountList().indexOf(
accountId));
emit lrcInstance_->accountListChanged();
Q_EMIT lrcInstance_->accountListChanged();
});
connectFailure();
@ -215,7 +215,7 @@ void
AccountAdapter::deleteCurrentAccount()
{
lrcInstance_->accountModel().removeAccount(lrcInstance_->getCurrAccId());
emit lrcInstance_->accountListChanged();
Q_EMIT lrcInstance_->accountListChanged();
}
bool
@ -368,14 +368,14 @@ AccountAdapter::connectAccount(const QString& accountId)
= QObject::connect(accInfo.accountModel,
&lrc::api::NewAccountModel::accountStatusChanged,
[this](const QString& accountId) {
emit accountStatusChanged(accountId);
Q_EMIT accountStatusChanged(accountId);
});
accountProfileUpdatedConnection_
= QObject::connect(accInfo.accountModel,
&lrc::api::NewAccountModel::profileUpdated,
[this](const QString& accountId) {
emit accountStatusChanged(accountId);
Q_EMIT accountStatusChanged(accountId);
});
contactAddedConnection_
@ -396,7 +396,7 @@ AccountAdapter::connectAccount(const QString& accountId)
/*
* Update conversation.
*/
emit updateConversationForAddedContact();
Q_EMIT updateConversationForAddedContact();
}
});
@ -413,7 +413,7 @@ AccountAdapter::connectAccount(const QString& accountId)
[this](const QString& contactUri,
bool banned) {
if (!banned)
emit contactUnbanned();
Q_EMIT contactUnbanned();
});
} catch (...) {
qWarning() << "Couldn't get account: " << accountId;
@ -426,5 +426,5 @@ AccountAdapter::setProperties(const QString& accountId)
setProperty("currentAccountId", accountId);
auto accountType = lrcInstance_->getAccountInfo(accountId).profileInfo.type;
setProperty("currentAccountType", lrc::api::profile::to_string(accountType));
emit deviceModelChanged();
Q_EMIT deviceModelChanged();
}

View file

@ -44,7 +44,7 @@ public:
lrc::api::NewAccountModel* getModel();
lrc::api::NewDeviceModel* getDeviceModel();
signals:
Q_SIGNALS:
void modelChanged();
void deviceModelChanged();
void currentAccountIdChanged();
@ -100,7 +100,7 @@ public:
Q_INVOKABLE void setCurrAccAvatar(bool fromFile, const QString& source);
signals:
Q_SIGNALS:
// Trigger other components to reconnect account related signals.
void accountStatusChanged(QString accountId = {});
@ -111,7 +111,7 @@ signals:
void accountAdded(QString accountId, bool showBackUp, int index);
void contactUnbanned();
private slots:
private Q_SLOTS:
void onCurrentAccountChanged();
private:

View file

@ -31,7 +31,7 @@ public:
enum Role { DeviceName = Qt::UserRole + 1, RawDeviceName };
Q_ENUM(Role)
signals:
Q_SIGNALS:
void typeChanged();
public:

View file

@ -127,7 +127,7 @@ AvAdapter::captureScreen(int screenNumber)
buffer.open(QIODevice::WriteOnly);
pixmap.save(&buffer, "PNG");
emit screenCaptured(screenNumber, Utils::byteArrayToBase64String(buffer.data()));
Q_EMIT screenCaptured(screenNumber, Utils::byteArrayToBase64String(buffer.data()));
});
}
@ -140,7 +140,7 @@ AvAdapter::captureAllScreens()
QList<QPixmap> scrs;
int width = 0, height = 0, currentPoint = 0;
foreach (auto scr, screens) {
for(auto scr : screens) {
QPixmap pix = scr->grabWindow(0);
width += pix.width();
if (height < pix.height())
@ -152,7 +152,7 @@ AvAdapter::captureAllScreens()
QPainter painter(&final);
final.fill(Qt::black);
foreach (auto scr, scrs) {
for(auto scr : scrs) {
painter.drawPixmap(QPoint(currentPoint, 0), scr);
currentPoint += scr.width();
}
@ -160,7 +160,7 @@ AvAdapter::captureAllScreens()
QBuffer buffer;
buffer.open(QIODevice::WriteOnly);
final.save(&buffer, "PNG");
emit screenCaptured(-1, Utils::byteArrayToBase64String(buffer.data()));
Q_EMIT screenCaptured(-1, Utils::byteArrayToBase64String(buffer.data()));
});
}
@ -276,7 +276,7 @@ AvAdapter::slotDeviceEvent()
}
}
emit videoDeviceListChanged(currentDeviceListSize == 0);
Q_EMIT videoDeviceListChanged(currentDeviceListSize == 0);
deviceListSize_ = currentDeviceListSize;
}

View file

@ -32,7 +32,7 @@ public:
explicit AvAdapter(LRCInstance* instance, QObject* parent = nullptr);
~AvAdapter() = default;
signals:
Q_SIGNALS:
// Emitted when the size of the video capture device list changes.
void videoDeviceListChanged(bool listIsEmpty);

View file

@ -145,8 +145,8 @@ CallAdapter::onShowIncomingCallView(const QString& accountId, const QString& con
return;
}
}
emit callSetupMainViewRequired(accountId, convInfo.uid);
emit lrcInstance_->updateSmartList();
Q_EMIT callSetupMainViewRequired(accountId, convInfo.uid);
Q_EMIT lrcInstance_->updateSmartList();
return;
}
@ -155,7 +155,7 @@ CallAdapter::onShowIncomingCallView(const QString& accountId, const QString& con
if (call.isOutgoing) {
if (isCallSelected) {
emit callSetupMainViewRequired(accountId, convInfo.uid);
Q_EMIT callSetupMainViewRequired(accountId, convInfo.uid);
}
} else {
auto accountProperties = lrcInstance_->accountModel().getAccountConfig(selectedAccountId);
@ -180,10 +180,10 @@ CallAdapter::onShowIncomingCallView(const QString& accountId, const QString& con
showNotification(accountId, convInfo.uid);
return;
} else {
emit callSetupMainViewRequired(accountId, convInfo.uid);
Q_EMIT callSetupMainViewRequired(accountId, convInfo.uid);
}
} else {
emit callSetupMainViewRequired(accountId, convInfo.uid);
Q_EMIT callSetupMainViewRequired(accountId, convInfo.uid);
}
} else { // Not current conversation
if (currentConvHasCall) {
@ -195,12 +195,12 @@ CallAdapter::onShowIncomingCallView(const QString& accountId, const QString& con
return;
}
}
emit callSetupMainViewRequired(accountId, convInfo.uid);
Q_EMIT callSetupMainViewRequired(accountId, convInfo.uid);
}
}
}
emit callStatusChanged(static_cast<int>(call.status), accountId, convInfo.uid);
emit lrcInstance_->updateSmartList();
Q_EMIT callStatusChanged(static_cast<int>(call.status), accountId, convInfo.uid);
Q_EMIT lrcInstance_->updateSmartList();
}
void
@ -212,7 +212,7 @@ CallAdapter::onShowCallView(const QString& accountId, const QString& convUid)
}
updateCall(convInfo.uid, accountId);
emit callSetupMainViewRequired(accountId, convInfo.uid);
Q_EMIT callSetupMainViewRequired(accountId, convInfo.uid);
}
void
@ -232,7 +232,7 @@ CallAdapter::updateCall(const QString& convUid, const QString& accountId, bool f
}
updateCallOverlay(convInfo);
emit previewVisibilityNeedToChange(shouldShowPreview(forceCallOnly));
Q_EMIT previewVisibilityNeedToChange(shouldShowPreview(forceCallOnly));
if (call->status == lrc::api::call::Status::IN_PROGRESS) {
lrcInstance_->renderer()->addDistantRenderer(call->id);
@ -334,10 +334,10 @@ CallAdapter::showNotification(const QString& accountId, const QString& convUid)
if (convInfo.uid.isEmpty()) {
return;
}
emit lrcInstance_->notificationClicked();
emit callSetupMainViewRequired(convInfo.accountId, convInfo.uid);
Q_EMIT lrcInstance_->notificationClicked();
Q_EMIT callSetupMainViewRequired(convInfo.accountId, convInfo.uid);
};
emit lrcInstance_->updateSmartList();
Q_EMIT lrcInstance_->updateSmartList();
systemTray_->showNotification(tr("is calling you"), from, onClicked);
}
@ -366,7 +366,7 @@ CallAdapter::connectCallModel(const QString& accountId)
map.push_back(QVariant(data));
updateCallOverlay(convInfo);
}
emit updateParticipantsInfos(map, accountId, confId);
Q_EMIT updateParticipantsInfos(map, accountId, confId);
}
});
@ -383,7 +383,7 @@ CallAdapter::connectCallModel(const QString& accountId)
*/
const auto& convInfo = lrcInstance_->getConversationFromCallId(callId);
if (!convInfo.uid.isEmpty()) {
emit callStatusChanged(static_cast<int>(call.status), accountId, convInfo.uid);
Q_EMIT callStatusChanged(static_cast<int>(call.status), accountId, convInfo.uid);
updateCallOverlay(convInfo);
}
@ -395,7 +395,7 @@ CallAdapter::connectCallModel(const QString& accountId)
case lrc::api::call::Status::TIMEOUT:
case lrc::api::call::Status::TERMINATING: {
lrcInstance_->renderer()->removeDistantRenderer(callId);
emit callSetupMainViewRequired(accountId, convInfo.uid);
Q_EMIT callSetupMainViewRequired(accountId, convInfo.uid);
if (convInfo.uid.isEmpty()) {
break;
}
@ -472,9 +472,9 @@ CallAdapter::connectCallModel(const QString& accountId)
}
}
if (!peers.isEmpty()) {
emit remoteRecordingChanged(peers, true);
Q_EMIT remoteRecordingChanged(peers, true);
} else if (!state) {
emit remoteRecordingChanged(peers, false);
Q_EMIT remoteRecordingChanged(peers, false);
}
}
});
@ -517,7 +517,7 @@ CallAdapter::updateCallOverlay(const lrc::api::conversation::Info& convInfo)
? QString()
: accInfo.contactModel->bestNameForContact(convInfo.participants[0]);
emit updateOverlay(isPaused,
Q_EMIT updateOverlay(isPaused,
isAudioOnly,
isAudioMuted,
isVideoMuted,
@ -812,7 +812,7 @@ CallAdapter::holdThisCallToggle()
if (callModel->hasCall(callId)) {
callModel->togglePause(callId);
}
emit showOnHoldLabel(true);
Q_EMIT showOnHoldLabel(true);
}
void
@ -852,7 +852,7 @@ CallAdapter::videoPauseThisCallToggle()
if (callModel->hasCall(callId)) {
callModel->toggleMedia(callId, lrc::api::NewCallModel::Media::VIDEO);
}
emit previewVisibilityNeedToChange(shouldShowPreview(false));
Q_EMIT previewVisibilityNeedToChange(shouldShowPreview(false));
}
void
@ -866,7 +866,7 @@ CallAdapter::setTime(const QString& accountId, const QString& convUid)
if (callInfo.status == lrc::api::call::Status::IN_PROGRESS
|| callInfo.status == lrc::api::call::Status::PAUSED) {
auto timeString = lrcInstance_->getCurrentCallModel()->getFormattedCallDuration(callId);
emit updateTimeText(timeString);
Q_EMIT updateTimeText(timeString);
}
}

View file

@ -77,7 +77,7 @@ public:
const QString& accountId = {},
bool forceCallOnly = false);
signals:
Q_SIGNALS:
void callStatusChanged(int index, const QString& accountId, const QString& convUid);
void updateConversationSmartList();
void updateParticipantsInfos(const QVariantList& infos,
@ -99,7 +99,7 @@ signals:
const QString& bestName);
void remoteRecordingChanged(const QStringList& peers, bool state);
public slots:
public Q_SLOTS:
void onShowIncomingCallView(const QString& accountId, const QString& convUid);
void onShowCallView(const QString& accountId, const QString& convUid);
void onAccountChanged();

View file

@ -119,7 +119,7 @@ ConnectivityMonitor::ConnectivityMonitor(QObject* parent)
if (SUCCEEDED(hr)) {
cookie_ = NULL;
netEventHandler_ = new NetworkEventHandler;
netEventHandler_->setOnConnectivityChangedCallBack([this] { emit connectivityChanged(); });
netEventHandler_->setOnConnectivityChangedCallBack([this] { Q_EMIT connectivityChanged(); });
hr = pConnectPoint_->Advise((IUnknown*) netEventHandler_, &cookie_);
} else {
destroy();

View file

@ -30,7 +30,7 @@ public:
bool isOnline();
signals:
Q_SIGNALS:
void connectivityChanged();
private:
@ -55,7 +55,7 @@ public:
bool isOnline();
signals:
Q_SIGNALS:
void connectivityChanged();
};
#endif // Q_OS_WIN

View file

@ -178,7 +178,7 @@ ContactAdapter::contactSelected(int index)
lrcInstance_->accountModel().setDefaultModerator(lrcInstance_->getCurrAccId(),
contactUri,
true);
emit defaultModeratorsUpdated();
Q_EMIT defaultModeratorsUpdated();
} break;
default:

View file

@ -88,6 +88,6 @@ private:
QStringList defaultModerators_;
signals:
Q_SIGNALS:
void defaultModeratorsUpdated();
};

View file

@ -47,12 +47,12 @@ ConversationsAdapter::safeInit()
SmartListModel::Type::CONVERSATION,
lrcInstance_);
emit modelChanged(QVariant::fromValue(conversationSmartListModel_));
Q_EMIT modelChanged(QVariant::fromValue(conversationSmartListModel_));
connect(&lrcInstance_->behaviorController(),
&BehaviorController::showChatView,
[this](const QString& accountId, const QString& convId) {
emit showConversation(accountId, convId);
Q_EMIT showConversation(accountId, convId);
});
connect(&lrcInstance_->behaviorController(),
@ -75,7 +75,7 @@ void
ConversationsAdapter::backToWelcomePage()
{
deselectConversation();
emit navigateToWelcomePageRequested();
Q_EMIT navigateToWelcomePageRequested();
}
void
@ -115,7 +115,7 @@ ConversationsAdapter::selectConversation(const QString& accountId, const QString
}
if (!convInfo.uid.isEmpty()) {
emit showConversation(lrcInstance_->getCurrAccId(), convInfo.uid);
Q_EMIT showConversation(lrcInstance_->getCurrAccId(), convInfo.uid);
}
}
@ -158,12 +158,12 @@ ConversationsAdapter::onNewUnreadInteraction(const QString& accountId,
auto& accInfo = lrcInstance_->getAccountInfo(accountId);
auto from = accInfo.contactModel->bestNameForContact(interaction.authorUri);
auto onClicked = [this, accountId, convUid, uri = interaction.authorUri] {
emit lrcInstance_->notificationClicked();
Q_EMIT lrcInstance_->notificationClicked();
const auto& convInfo = lrcInstance_->getConversationFromConvUid(convUid, accountId);
if (!convInfo.uid.isEmpty()) {
selectConversation(accountId, convInfo.uid);
emit lrcInstance_->updateSmartList();
emit modelSorted(convInfo.uid);
Q_EMIT lrcInstance_->updateSmartList();
Q_EMIT modelSorted(convInfo.uid);
}
};
@ -214,7 +214,7 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
== lrc::api::profile::Type::TEMPORARY) {
return;
}
emit modelSorted(QVariant::fromValue(convInfo.uid));
Q_EMIT modelSorted(QVariant::fromValue(convInfo.uid));
});
contactProfileUpdatedConnection_
@ -222,14 +222,14 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
&lrc::api::ContactModel::profileUpdated,
[this](const QString& contactUri) {
conversationSmartListModel_->updateContactAvatarUid(contactUri);
emit updateListViewRequested();
Q_EMIT updateListViewRequested();
});
modelUpdatedConnection_ = QObject::connect(currentConversationModel,
&lrc::api::ConversationModel::conversationUpdated,
[this](const QString&) {
updateConversationsFilterWidget();
emit updateListViewRequested();
Q_EMIT updateListViewRequested();
});
filterChangedConnection_
@ -239,8 +239,8 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
conversationSmartListModel_->fillConversationsList();
updateConversationsFilterWidget();
if (!lrcInstance_->getCurrentConvUid().isEmpty())
emit indexRepositionRequested();
emit updateListViewRequested();
Q_EMIT indexRepositionRequested();
Q_EMIT updateListViewRequested();
});
newConversationConnection_ = QObject::connect(currentConversationModel,
@ -271,7 +271,7 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
searchStatusChangedConnection_
= QObject::connect(currentConversationModel,
&lrc::api::ConversationModel::searchStatusChanged,
[this](const QString& status) { emit showSearchStatus(status); });
[this](const QString& status) { Q_EMIT showSearchStatus(status); });
// This connection is ideal when separated search results list.
// This signal is guaranteed to fire just after filterChanged during a search if results are
@ -283,7 +283,7 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
&lrc::api::ConversationModel::searchResultUpdated,
[this]() {
conversationSmartListModel_->fillConversationsList();
emit updateListViewRequested();
Q_EMIT updateListViewRequested();
});
if (updateFilter) {

View file

@ -50,7 +50,7 @@ public:
Q_INVOKABLE void refill();
Q_INVOKABLE void updateConversationsFilterWidget();
signals:
Q_SIGNALS:
void showConversation(const QString& accountId, const QString& convUid);
void showConversationTabs(bool visible);
void showSearchStatus(const QString& status);
@ -62,7 +62,7 @@ signals:
void currentTypeFilterChanged();
void indexRepositionRequested();
private slots:
private Q_SLOTS:
void onCurrentAccountIdChanged();
void onNewUnreadInteraction(const QString& accountId,
const QString& convUid,

View file

@ -31,12 +31,12 @@ DBusErrorHandler::errorCallback()
qDebug() << "Dring has possibly crashed, "
"or has been killed... will wait 2.5 seconds and try to reconnect";
emit showDaemonReconnectPopup(true);
Q_EMIT showDaemonReconnectPopup(true);
QTimer::singleShot(2500, [this]() {
if ((!lrc::api::Lrc::isConnected()) || (!lrc::api::Lrc::dbusIsValid())) {
qDebug() << "Could not reconnect to the daemon";
emit daemonReconnectFailed();
Q_EMIT daemonReconnectFailed();
} else {
static_cast<DBusErrorHandler&>(GlobalInstances::dBusErrorHandler())
.finishedHandlingError();
@ -87,7 +87,7 @@ void
DBusErrorHandler::finishedHandlingError()
{
handlingError = false;
emit showDaemonReconnectPopup(false);
Q_EMIT showDaemonReconnectPopup(false);
}
} // namespace Interfaces

View file

@ -37,7 +37,7 @@ public:
void finishedHandlingError();
signals:
Q_SIGNALS:
void showDaemonReconnectPopup(bool visible);
void daemonReconnectFailed();

View file

@ -91,7 +91,7 @@ DistantRenderer::paint(QPainter* painter)
if (tempXOffset != xOffset_ or tempYOffset != yOffset_
or static_cast<int>(scaledWidth_ * 1000) != tempScaledWidth
or static_cast<int>(scaledHeight_ * 1000) != tempScaledHeight) {
emit offsetChanged();
Q_EMIT offsetChanged();
}
painter->drawImage(QRect(xOffset_,
yOffset_,

View file

@ -42,7 +42,7 @@ public:
Q_INVOKABLE double getScaledWidth() const;
Q_INVOKABLE double getScaledHeight() const;
signals:
Q_SIGNALS:
void offsetChanged();
void lrcInstanceChanged();

View file

@ -255,7 +255,7 @@ public:
// Last selected account should be set as preferred.
accountModel().setTopAccount(accountId);
emit currentAccountChanged();
Q_EMIT currentAccountChanged();
}
const QString& getCurrentConvUid()
@ -393,7 +393,7 @@ public:
return callId;
}
signals:
Q_SIGNALS:
void accountListChanged();
void currentAccountChanged();
void restoreAppRequested();

View file

@ -257,7 +257,7 @@ MainApplication::init()
void
MainApplication::restoreApp()
{
emit lrcInstance_->restoreAppRequested();
Q_EMIT lrcInstance_->restoreAppRequested();
}
void

View file

@ -47,11 +47,11 @@ public:
if (ratio != devicePixelRatio_) {
devicePixelRatio_ = ratio;
emit devicePixelRatioChanged();
Q_EMIT devicePixelRatioChanged();
}
}
signals:
Q_SIGNALS:
void devicePixelRatioChanged();
private:

View file

@ -198,7 +198,7 @@ MessagesAdapter::slotSendMessageContentSaved(const QString& content)
auto restoredContent = lrcInstance_->getContentDraft(lrcInstance_->getCurrentConvUid(),
lrcInstance_->getCurrAccId());
setSendMessageContent(restoredContent);
emit needToUpdateSmartList();
Q_EMIT needToUpdateSmartList();
}
void
@ -207,7 +207,7 @@ MessagesAdapter::slotUpdateDraft(const QString& content)
if (!LastConvUid_.isEmpty()) {
lrcInstance_->setContentDraft(LastConvUid_, lrcInstance_->getCurrAccId(), content);
}
emit needToUpdateSmartList();
Q_EMIT needToUpdateSmartList();
}
void
@ -668,7 +668,7 @@ MessagesAdapter::acceptInvitation(const QString& convUid)
lrcInstance_->getCurrentConversationModel()->makePermanent(currentConvUid);
if (convUid == currentConvUid_)
currentConvUid_.clear();
emit invitationAccepted();
Q_EMIT invitationAccepted();
}
void
@ -679,7 +679,7 @@ MessagesAdapter::refuseInvitation(const QString& convUid)
setInvitation(false);
if (convUid == currentConvUid_)
currentConvUid_.clear();
emit navigateToWelcomePageRequested();
Q_EMIT navigateToWelcomePageRequested();
}
void
@ -690,8 +690,8 @@ MessagesAdapter::blockConversation(const QString& convUid)
setInvitation(false);
if (convUid == currentConvUid_)
currentConvUid_.clear();
emit contactBanned();
emit navigateToWelcomePageRequested();
Q_EMIT contactBanned();
Q_EMIT navigateToWelcomePageRequested();
}
void

View file

@ -91,13 +91,13 @@ protected:
void setSendMessageContent(const QString& content);
void contactIsComposing(const QString& uid, const QString& contactUri, bool isComposing);
signals:
Q_SIGNALS:
void needToUpdateSmartList();
void contactBanned();
void navigateToWelcomePageRequested();
void invitationAccepted();
public slots:
public Q_SLOTS:
void slotSendMessageContentSaved(const QString& content);
void slotUpdateDraft(const QString& content);
void slotMessagesCleared();

View file

@ -32,7 +32,7 @@ NetWorkManager::NetWorkManager(ConnectivityMonitor* cm, QObject* parent)
, connectivityMonitor_(cm)
, lastConnectionState_(cm->isOnline())
{
emit statusChanged(GetStatus::IDLE);
Q_EMIT statusChanged(GetStatus::IDLE);
connect(connectivityMonitor_, &ConnectivityMonitor::connectivityChanged, [this] {
cancelRequest();
@ -51,7 +51,7 @@ void
NetWorkManager::get(const QUrl& url, const DoneCallBack& doneCb, const QString& path)
{
if (!connectivityMonitor_->isOnline()) {
emit errorOccured(GetError::DISCONNECTED);
Q_EMIT errorOccured(GetError::DISCONNECTED);
return;
}
@ -69,7 +69,7 @@ NetWorkManager::get(const QUrl& url, const DoneCallBack& doneCb, const QString&
file_.reset(new QFile(path + "/" + fileName));
if (!file_->open(QIODevice::WriteOnly)) {
emit errorOccured(GetError::ACCESS_DENIED);
Q_EMIT errorOccured(GetError::ACCESS_DENIED);
file_.reset(nullptr);
return;
}
@ -78,7 +78,7 @@ NetWorkManager::get(const QUrl& url, const DoneCallBack& doneCb, const QString&
QNetworkRequest request(url);
reply_ = manager_->get(request);
emit statusChanged(GetStatus::STARTED);
Q_EMIT statusChanged(GetStatus::STARTED);
connect(reply_,
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
@ -91,7 +91,7 @@ NetWorkManager::get(const QUrl& url, const DoneCallBack& doneCb, const QString&
reset(true);
qWarning() << Q_FUNC_INFO << "NetworkError: "
<< QMetaEnum::fromType<QNetworkReply::NetworkError>().valueToKey(error);
emit errorOccured(GetError::NETWORK_ERROR);
Q_EMIT errorOccured(GetError::NETWORK_ERROR);
});
connect(reply_, &QNetworkReply::finished, [this, doneCb, path]() {
@ -100,7 +100,7 @@ NetWorkManager::get(const QUrl& url, const DoneCallBack& doneCb, const QString&
if (path.isEmpty())
response = QString(reply_->readAll());
reset(!path.isEmpty());
emit statusChanged(GetStatus::FINISHED);
Q_EMIT statusChanged(GetStatus::FINISHED);
if (doneCb)
doneCb(response);
});
@ -147,7 +147,7 @@ NetWorkManager::onSslErrors(const QList<QSslError>& sslErrors)
}
errorsString += error.errorString();
}
emit errorOccured(GetError::SSL_ERROR, errorsString);
Q_EMIT errorOccured(GetError::SSL_ERROR, errorsString);
return;
#else
Q_UNUSED(sslErrors);
@ -172,6 +172,6 @@ NetWorkManager::cancelRequest()
{
if (reply_) {
reply_->abort();
emit errorOccured(GetError::CANCELED);
Q_EMIT errorOccured(GetError::CANCELED);
}
}

View file

@ -55,12 +55,12 @@ public:
*/
Q_INVOKABLE void cancelRequest();
signals:
Q_SIGNALS:
void statusChanged(GetStatus error);
void downloadProgressChanged(qint64 bytesRead, qint64 totalBytes);
void errorOccured(GetError error, const QString& msg = {});
private slots:
private Q_SLOTS:
void onSslErrors(const QList<QSslError>& sslErrors);
void onHttpReadyRead();

View file

@ -49,7 +49,7 @@ protected:
Q_INVOKABLE QVariant getPluginPreferencesCategories(const QString& pluginId,
bool removeLast = false);
signals:
Q_SIGNALS:
void pluginHandlersUpdateStatus();
void preferenceChanged(QString pluginId);
void pluginUninstalled();

View file

@ -118,7 +118,7 @@ PhotoboothPreviewRender::PhotoboothPreviewRender(QQuickItem* parent)
connect(this, &PreviewRenderer::lrcInstanceChanged, [this] {
if (lrcInstance_)
connect(lrcInstance_->renderer(), &RenderManager::previewRenderingStopped, [this]() {
emit hideBooth();
Q_EMIT hideBooth();
});
});
}

View file

@ -36,7 +36,7 @@ public:
explicit PreviewRenderer(QQuickItem* parent = nullptr);
~PreviewRenderer();
signals:
Q_SIGNALS:
void lrcInstanceChanged();
protected:
@ -59,7 +59,7 @@ public:
explicit VideoCallPreviewRenderer(QQuickItem* parent = nullptr);
virtual ~VideoCallPreviewRenderer();
signals:
Q_SIGNALS:
void previewImageScalingFactorChanged();
private:
@ -77,7 +77,7 @@ public:
Q_INVOKABLE QString takePhoto(int size);
signals:
Q_SIGNALS:
void hideBooth();
private:

View file

@ -85,7 +85,7 @@ public:
}
~OneShotConnection() = default;
public slots:
public Q_SLOTS:
void onTriggered()
{
if (connection_) {

View file

@ -163,7 +163,7 @@ FrameWrapper::slotFrameUpdated(const QString& id)
image_.reset(new QImage((uchar*) buffer_.data(), width, height, imageFormat));
}
}
emit frameUpdated(id);
Q_EMIT frameUpdated(id);
}
void
@ -183,7 +183,7 @@ FrameWrapper::slotRenderingStopped(const QString& id)
image_.reset();
}
emit renderingStopped(id);
Q_EMIT renderingStopped(id);
}
RenderManager::RenderManager(AVModel& avModel)
@ -195,13 +195,13 @@ RenderManager::RenderManager(AVModel& avModel)
&FrameWrapper::frameUpdated,
[this](const QString& id) {
Q_UNUSED(id);
emit previewFrameUpdated();
Q_EMIT previewFrameUpdated();
});
QObject::connect(previewFrameWrapper_.get(),
&FrameWrapper::renderingStopped,
[this](const QString& id) {
Q_UNUSED(id);
emit previewRenderingStopped();
Q_EMIT previewRenderingStopped();
});
previewFrameWrapper_->connectStartRendering();
@ -266,7 +266,7 @@ RenderManager::addDistantRenderer(const QString& id)
distantConnectionMap_[id].updated = QObject::connect(dfw.get(),
&FrameWrapper::frameUpdated,
[this](const QString& id) {
emit distantFrameUpdated(id);
Q_EMIT distantFrameUpdated(id);
});
/*

View file

@ -81,7 +81,7 @@ public:
void frameMutexUnlock();
signals:
Q_SIGNALS:
/*
* Emitted each time a frame is ready to be displayed.
* @param id of the renderer
@ -93,7 +93,7 @@ signals:
*/
void renderingStopped(const QString& id);
public slots:
public Q_SLOTS:
/*
* Used to listen to AVModel::rendererStarted.
* @param id of the renderer
@ -212,7 +212,7 @@ public:
*/
QImage* getPreviewFrame();
signals:
Q_SIGNALS:
/*
* Emitted when the preview has a new frame ready.

View file

@ -39,7 +39,7 @@ public:
bool tryToRun();
void release();
private slots:
private Q_SLOTS:
void tryRestorePrimaryInstance();
private:

View file

@ -83,7 +83,7 @@ UpdateManager::checkForUpdates(bool quiet)
if (latestVersionString.isEmpty()) {
qWarning() << "Error checking version";
if (!quiet)
emit updateCheckReplyReceived(false);
Q_EMIT updateCheckReplyReceived(false);
return;
}
auto currentVersion = QString(VERSION_STRING).toULongLong();
@ -91,11 +91,11 @@ UpdateManager::checkForUpdates(bool quiet)
qDebug() << "latest: " << latestVersion << " current: " << currentVersion;
if (latestVersion > currentVersion) {
qDebug() << "New version found";
emit updateCheckReplyReceived(true, true);
Q_EMIT updateCheckReplyReceived(true, true);
} else {
qDebug() << "No new version found";
if (!quiet)
emit updateCheckReplyReceived(true, false);
Q_EMIT updateCheckReplyReceived(true, false);
}
});
}
@ -112,10 +112,10 @@ UpdateManager::applyUpdates(bool beta)
&NetWorkManager::downloadProgressChanged,
this,
&UpdateManager::updateDownloadProgressChanged);
emit updateDownloadStarted();
Q_EMIT updateDownloadStarted();
break;
case GetStatus::FINISHED:
emit updateDownloadFinished();
Q_EMIT updateDownloadFinished();
break;
default:
break;
@ -129,7 +129,7 @@ UpdateManager::applyUpdates(bool beta)
downloadUrl,
[this, downloadUrl](const QString&) {
lrcInstance_->reset();
emit lrcInstance_->quitEngineRequested();
Q_EMIT lrcInstance_->quitEngineRequested();
auto args = QString(" /passive /norestart WIXNONUILAUNCH=1");
QProcess process;
process.start("powershell ",

View file

@ -40,7 +40,7 @@ public:
Q_INVOKABLE void setAutoUpdateCheck(bool state);
Q_INVOKABLE bool isCurrentVersionBeta();
signals:
Q_SIGNALS:
void updateCheckReplyReceived(bool ok, bool found = false);
void updateCheckErrorOccurred(GetError error);
void updateDownloadStarted();

View file

@ -221,6 +221,6 @@ VideoFormatFpsModel::setCurrentResolution(QString resNew)
if (currentResolution_ != resNew) {
currentResolution_ = resNew;
reset();
emit currentResolutionChanged(resNew);
Q_EMIT currentResolutionChanged(resNew);
}
}

View file

@ -62,7 +62,7 @@ public:
QString getCurrentResolution();
void setCurrentResolution(QString resNew);
signals:
Q_SIGNALS:
void currentResolutionChanged(QString resNew);
private:

View file

@ -9,7 +9,7 @@ class Setup : public QObject
public:
Setup() {}
public slots:
public Q_SLOTS:
void qmlEngineAvailable(QQmlEngine *engine)
{