Skip to content
Snippets Groups Projects
Commit f6fefdb8 authored by Emmanuel Lepage Vallee's avatar Emmanuel Lepage Vallee
Browse files

api: Do not use 'emit' and 'foreach' in exported headers

Refs #70358
parent a9d96ad7
Branches
Tags
No related merge requests found
...@@ -50,7 +50,7 @@ QMetaObject metaObject() ...@@ -50,7 +50,7 @@ QMetaObject metaObject()
template <class T> bool CollectionEditor<T>::batchSave(const QList<T*> contacts) template <class T> bool CollectionEditor<T>::batchSave(const QList<T*> contacts)
{ {
bool ret = true; bool ret = true;
foreach(const T* c, contacts) { for(const T* c : contacts) {
ret &= save(c); ret &= save(c);
} }
return ret; return ret;
...@@ -60,7 +60,7 @@ template <class T> bool CollectionEditor<T>::batchSave(const QList<T*> contacts) ...@@ -60,7 +60,7 @@ template <class T> bool CollectionEditor<T>::batchSave(const QList<T*> contacts)
template <class T> bool CollectionEditor<T>::batchRemove(const QList<T*> contacts) template <class T> bool CollectionEditor<T>::batchRemove(const QList<T*> contacts)
{ {
bool ret = true; bool ret = true;
foreach(const T* c, contacts) { for(const T* c : contacts) {
ret &= remove(c); ret &= remove(c);
} }
return ret; return ret;
......
...@@ -53,153 +53,153 @@ public: ...@@ -53,153 +53,153 @@ public:
[this] (const std::string &callID, const std::string &state, int code) { [this] (const std::string &callID, const std::string &state, int code) {
QTimer::singleShot(0, [this,callID, state, code] { QTimer::singleShot(0, [this,callID, state, code] {
LOG_DRING_SIGNAL3("callStateChanged",QString(callID.c_str()) , QString(state.c_str()) , code); LOG_DRING_SIGNAL3("callStateChanged",QString(callID.c_str()) , QString(state.c_str()) , code);
emit this->callStateChanged(QString(callID.c_str()), QString(state.c_str()), code); Q_EMIT this->callStateChanged(QString(callID.c_str()), QString(state.c_str()), code);
}); });
}), }),
exportable_callback<CallSignal::TransferFailed>( exportable_callback<CallSignal::TransferFailed>(
[this] () { [this] () {
QTimer::singleShot(0, [this] { QTimer::singleShot(0, [this] {
LOG_DRING_SIGNAL("transferFailed",""); LOG_DRING_SIGNAL("transferFailed","");
emit this->transferFailed(); Q_EMIT this->transferFailed();
}); });
}), }),
exportable_callback<CallSignal::TransferSucceeded>( exportable_callback<CallSignal::TransferSucceeded>(
[this] () { [this] () {
QTimer::singleShot(0, [this] { QTimer::singleShot(0, [this] {
LOG_DRING_SIGNAL("transferSucceeded",""); LOG_DRING_SIGNAL("transferSucceeded","");
emit this->transferSucceeded(); Q_EMIT this->transferSucceeded();
}); });
}), }),
exportable_callback<CallSignal::RecordPlaybackStopped>( exportable_callback<CallSignal::RecordPlaybackStopped>(
[this] (const std::string &filepath) { [this] (const std::string &filepath) {
QTimer::singleShot(0, [this,filepath] { QTimer::singleShot(0, [this,filepath] {
LOG_DRING_SIGNAL("recordPlaybackStopped",QString(filepath.c_str())); LOG_DRING_SIGNAL("recordPlaybackStopped",QString(filepath.c_str()));
emit this->recordPlaybackStopped(QString(filepath.c_str())); Q_EMIT this->recordPlaybackStopped(QString(filepath.c_str()));
}); });
}), }),
exportable_callback<CallSignal::VoiceMailNotify>( exportable_callback<CallSignal::VoiceMailNotify>(
[this] (const std::string &accountID, int count) { [this] (const std::string &accountID, int count) {
QTimer::singleShot(0, [this,accountID, count] { QTimer::singleShot(0, [this,accountID, count] {
LOG_DRING_SIGNAL2("voiceMailNotify",QString(accountID.c_str()), count); LOG_DRING_SIGNAL2("voiceMailNotify",QString(accountID.c_str()), count);
emit this->voiceMailNotify(QString(accountID.c_str()), count); Q_EMIT this->voiceMailNotify(QString(accountID.c_str()), count);
}); });
}), }),
exportable_callback<CallSignal::IncomingMessage>( exportable_callback<CallSignal::IncomingMessage>(
[this] (const std::string &callID, const std::string &from, const std::string &message) { [this] (const std::string &callID, const std::string &from, const std::string &message) {
QTimer::singleShot(0, [this,callID, from, message] { QTimer::singleShot(0, [this,callID, from, message] {
LOG_DRING_SIGNAL3("incomingMessage",QString(callID.c_str()),QString(from.c_str()),QString(message.c_str())); LOG_DRING_SIGNAL3("incomingMessage",QString(callID.c_str()),QString(from.c_str()),QString(message.c_str()));
emit this->incomingMessage(QString(callID.c_str()), QString(from.c_str()), QString(message.c_str())); Q_EMIT this->incomingMessage(QString(callID.c_str()), QString(from.c_str()), QString(message.c_str()));
}); });
}), }),
exportable_callback<CallSignal::IncomingCall>( exportable_callback<CallSignal::IncomingCall>(
[this] (const std::string &accountID, const std::string &callID, const std::string &from) { [this] (const std::string &accountID, const std::string &callID, const std::string &from) {
QTimer::singleShot(0, [this,accountID, callID, from] { QTimer::singleShot(0, [this,accountID, callID, from] {
LOG_DRING_SIGNAL3("incomingCall",QString(accountID.c_str()), QString(callID.c_str()), QString(from.c_str())); LOG_DRING_SIGNAL3("incomingCall",QString(accountID.c_str()), QString(callID.c_str()), QString(from.c_str()));
emit this->incomingCall(QString(accountID.c_str()), QString(callID.c_str()), QString(from.c_str())); Q_EMIT this->incomingCall(QString(accountID.c_str()), QString(callID.c_str()), QString(from.c_str()));
}); });
}), }),
exportable_callback<CallSignal::RecordPlaybackFilepath>( exportable_callback<CallSignal::RecordPlaybackFilepath>(
[this] (const std::string &callID, const std::string &filepath) { [this] (const std::string &callID, const std::string &filepath) {
QTimer::singleShot(0, [this,callID, filepath] { QTimer::singleShot(0, [this,callID, filepath] {
LOG_DRING_SIGNAL2("recordPlaybackFilepath",QString(callID.c_str()), QString(filepath.c_str())); LOG_DRING_SIGNAL2("recordPlaybackFilepath",QString(callID.c_str()), QString(filepath.c_str()));
emit this->recordPlaybackFilepath(QString(callID.c_str()), QString(filepath.c_str())); Q_EMIT this->recordPlaybackFilepath(QString(callID.c_str()), QString(filepath.c_str()));
}); });
}), }),
exportable_callback<CallSignal::ConferenceCreated>( exportable_callback<CallSignal::ConferenceCreated>(
[this] (const std::string &confID) { [this] (const std::string &confID) {
QTimer::singleShot(0, [this,confID] { QTimer::singleShot(0, [this,confID] {
LOG_DRING_SIGNAL("conferenceCreated",QString(confID.c_str())); LOG_DRING_SIGNAL("conferenceCreated",QString(confID.c_str()));
emit this->conferenceCreated(QString(confID.c_str())); Q_EMIT this->conferenceCreated(QString(confID.c_str()));
}); });
}), }),
exportable_callback<CallSignal::ConferenceChanged>( exportable_callback<CallSignal::ConferenceChanged>(
[this] (const std::string &confID, const std::string &state) { [this] (const std::string &confID, const std::string &state) {
QTimer::singleShot(0, [this,confID, state] { QTimer::singleShot(0, [this,confID, state] {
LOG_DRING_SIGNAL2("conferenceChanged",QString(confID.c_str()), QString(state.c_str())); LOG_DRING_SIGNAL2("conferenceChanged",QString(confID.c_str()), QString(state.c_str()));
emit this->conferenceChanged(QString(confID.c_str()), QString(state.c_str())); Q_EMIT this->conferenceChanged(QString(confID.c_str()), QString(state.c_str()));
}); });
}), }),
exportable_callback<CallSignal::UpdatePlaybackScale>( exportable_callback<CallSignal::UpdatePlaybackScale>(
[this] (const std::string &filepath, int position, int size) { [this] (const std::string &filepath, int position, int size) {
QTimer::singleShot(0, [this,filepath, position, size] { QTimer::singleShot(0, [this,filepath, position, size] {
LOG_DRING_SIGNAL3("updatePlaybackScale",QString(filepath.c_str()), position, size); LOG_DRING_SIGNAL3("updatePlaybackScale",QString(filepath.c_str()), position, size);
emit this->updatePlaybackScale(QString(filepath.c_str()), position, size); Q_EMIT this->updatePlaybackScale(QString(filepath.c_str()), position, size);
}); });
}), }),
exportable_callback<CallSignal::ConferenceRemoved>( exportable_callback<CallSignal::ConferenceRemoved>(
[this] (const std::string &confID) { [this] (const std::string &confID) {
QTimer::singleShot(0, [this,confID] { QTimer::singleShot(0, [this,confID] {
LOG_DRING_SIGNAL("conferenceRemoved",QString(confID.c_str())); LOG_DRING_SIGNAL("conferenceRemoved",QString(confID.c_str()));
emit this->conferenceRemoved(QString(confID.c_str())); Q_EMIT this->conferenceRemoved(QString(confID.c_str()));
}); });
}), }),
exportable_callback<CallSignal::NewCallCreated>( exportable_callback<CallSignal::NewCallCreated>(
[this] (const std::string &accountID, const std::string &callID, const std::string &to) { [this] (const std::string &accountID, const std::string &callID, const std::string &to) {
QTimer::singleShot(0, [this,accountID, callID, to] { QTimer::singleShot(0, [this,accountID, callID, to] {
LOG_DRING_SIGNAL3("newCallCreated",QString(accountID.c_str()), QString(callID.c_str()), QString(to.c_str())); LOG_DRING_SIGNAL3("newCallCreated",QString(accountID.c_str()), QString(callID.c_str()), QString(to.c_str()));
emit this->newCallCreated(QString(accountID.c_str()), QString(callID.c_str()), QString(to.c_str())); Q_EMIT this->newCallCreated(QString(accountID.c_str()), QString(callID.c_str()), QString(to.c_str()));
}); });
}), }),
exportable_callback<CallSignal::RecordingStateChanged>( exportable_callback<CallSignal::RecordingStateChanged>(
[this] (const std::string &callID, bool recordingState) { [this] (const std::string &callID, bool recordingState) {
QTimer::singleShot(0, [this,callID, recordingState] { QTimer::singleShot(0, [this,callID, recordingState] {
LOG_DRING_SIGNAL2("recordingStateChanged",QString(callID.c_str()), recordingState); LOG_DRING_SIGNAL2("recordingStateChanged",QString(callID.c_str()), recordingState);
emit this->recordingStateChanged(QString(callID.c_str()), recordingState); Q_EMIT this->recordingStateChanged(QString(callID.c_str()), recordingState);
}); });
}), }),
exportable_callback<CallSignal::SecureSdesOn>( exportable_callback<CallSignal::SecureSdesOn>(
[this] (const std::string &callID) { [this] (const std::string &callID) {
QTimer::singleShot(0, [this,callID] { QTimer::singleShot(0, [this,callID] {
LOG_DRING_SIGNAL("secureSdesOn",QString(callID.c_str())); LOG_DRING_SIGNAL("secureSdesOn",QString(callID.c_str()));
emit this->secureSdesOn(QString(callID.c_str())); Q_EMIT this->secureSdesOn(QString(callID.c_str()));
}); });
}), }),
exportable_callback<CallSignal::SecureSdesOff>( exportable_callback<CallSignal::SecureSdesOff>(
[this] (const std::string &callID) { [this] (const std::string &callID) {
QTimer::singleShot(0, [this,callID] { QTimer::singleShot(0, [this,callID] {
LOG_DRING_SIGNAL("secureSdesOff",QString(callID.c_str())); LOG_DRING_SIGNAL("secureSdesOff",QString(callID.c_str()));
emit this->secureSdesOff(QString(callID.c_str())); Q_EMIT this->secureSdesOff(QString(callID.c_str()));
}); });
}), }),
exportable_callback<CallSignal::SecureZrtpOn>( exportable_callback<CallSignal::SecureZrtpOn>(
[this] (const std::string &callID, const std::string &cipher) { [this] (const std::string &callID, const std::string &cipher) {
QTimer::singleShot(0, [this,callID,cipher] { QTimer::singleShot(0, [this,callID,cipher] {
LOG_DRING_SIGNAL2("secureZrtpOn",QString(callID.c_str()), QString(cipher.c_str())); LOG_DRING_SIGNAL2("secureZrtpOn",QString(callID.c_str()), QString(cipher.c_str()));
emit this->secureZrtpOn(QString(callID.c_str()), QString(cipher.c_str())); Q_EMIT this->secureZrtpOn(QString(callID.c_str()), QString(cipher.c_str()));
}); });
}), }),
exportable_callback<CallSignal::SecureZrtpOff>( exportable_callback<CallSignal::SecureZrtpOff>(
[this] (const std::string &callID) { [this] (const std::string &callID) {
QTimer::singleShot(0, [this,callID] { QTimer::singleShot(0, [this,callID] {
emit this->secureZrtpOff(QString(callID.c_str())); Q_EMIT this->secureZrtpOff(QString(callID.c_str()));
}); });
}), }),
exportable_callback<CallSignal::ShowSAS>( exportable_callback<CallSignal::ShowSAS>(
[this] (const std::string &callID, const std::string &sas, bool verified) { [this] (const std::string &callID, const std::string &sas, bool verified) {
QTimer::singleShot(0, [this,callID, sas, verified] { QTimer::singleShot(0, [this,callID, sas, verified] {
LOG_DRING_SIGNAL3("showSAS",QString(callID.c_str()), QString(sas.c_str()), verified); LOG_DRING_SIGNAL3("showSAS",QString(callID.c_str()), QString(sas.c_str()), verified);
emit this->showSAS(QString(callID.c_str()), QString(sas.c_str()), verified); Q_EMIT this->showSAS(QString(callID.c_str()), QString(sas.c_str()), verified);
}); });
}), }),
exportable_callback<CallSignal::ZrtpNotSuppOther>( exportable_callback<CallSignal::ZrtpNotSuppOther>(
[this] (const std::string &callID) { [this] (const std::string &callID) {
QTimer::singleShot(0, [this,callID] { QTimer::singleShot(0, [this,callID] {
LOG_DRING_SIGNAL("zrtpNotSuppOther",QString(callID.c_str())); LOG_DRING_SIGNAL("zrtpNotSuppOther",QString(callID.c_str()));
emit this->zrtpNotSuppOther(QString(callID.c_str())); Q_EMIT this->zrtpNotSuppOther(QString(callID.c_str()));
}); });
}), }),
exportable_callback<CallSignal::ZrtpNegotiationFailed>( exportable_callback<CallSignal::ZrtpNegotiationFailed>(
[this] (const std::string &callID, const std::string &reason, const std::string &severity) { [this] (const std::string &callID, const std::string &reason, const std::string &severity) {
QTimer::singleShot(0, [this,callID, reason, severity] { QTimer::singleShot(0, [this,callID, reason, severity] {
LOG_DRING_SIGNAL3("zrtpNegotiationFailed",QString(callID.c_str()), QString(reason.c_str()), QString(severity.c_str())); LOG_DRING_SIGNAL3("zrtpNegotiationFailed",QString(callID.c_str()), QString(reason.c_str()), QString(severity.c_str()));
emit this->zrtpNegotiationFailed(QString(callID.c_str()), QString(reason.c_str()), QString(severity.c_str())); Q_EMIT this->zrtpNegotiationFailed(QString(callID.c_str()), QString(reason.c_str()), QString(severity.c_str()));
}); });
}), }),
exportable_callback<CallSignal::RtcpReportReceived>( exportable_callback<CallSignal::RtcpReportReceived>(
[this] (const std::string &callID, const std::map<std::string, int>& report) { [this] (const std::string &callID, const std::map<std::string, int>& report) {
QTimer::singleShot(0, [this,callID, report] { QTimer::singleShot(0, [this,callID, report] {
LOG_DRING_SIGNAL2("onRtcpReportReceived",QString(callID.c_str()), convertStringInt(report)); LOG_DRING_SIGNAL2("onRtcpReportReceived",QString(callID.c_str()), convertStringInt(report));
emit this->onRtcpReportReceived(QString(callID.c_str()), convertStringInt(report)); Q_EMIT this->onRtcpReportReceived(QString(callID.c_str()), convertStringInt(report));
}); });
}) })
}; };
......
...@@ -61,25 +61,25 @@ public: ...@@ -61,25 +61,25 @@ public:
exportable_callback<ConfigurationSignal::VolumeChanged>( exportable_callback<ConfigurationSignal::VolumeChanged>(
[this] (const std::string &device, double value) { [this] (const std::string &device, double value) {
QTimer::singleShot(0, [this,device,value] { QTimer::singleShot(0, [this,device,value] {
emit this->volumeChanged(QString(device.c_str()), value); Q_EMIT this->volumeChanged(QString(device.c_str()), value);
}); });
}), }),
exportable_callback<ConfigurationSignal::AccountsChanged>( exportable_callback<ConfigurationSignal::AccountsChanged>(
[this] () { [this] () {
QTimer::singleShot(0, [this] { QTimer::singleShot(0, [this] {
emit this->accountsChanged(); Q_EMIT this->accountsChanged();
}); });
}), }),
exportable_callback<ConfigurationSignal::StunStatusFailed>( exportable_callback<ConfigurationSignal::StunStatusFailed>(
[this] (const std::string &reason) { [this] (const std::string &reason) {
QTimer::singleShot(0, [this, reason] { QTimer::singleShot(0, [this, reason] {
emit this->stunStatusFailure(QString(reason.c_str())); Q_EMIT this->stunStatusFailure(QString(reason.c_str()));
}); });
}), }),
exportable_callback<ConfigurationSignal::RegistrationStateChanged>( exportable_callback<ConfigurationSignal::RegistrationStateChanged>(
[this] (const std::string &accountID, const std::string& registration_state, unsigned detail_code, const std::string& detail_str) { [this] (const std::string &accountID, const std::string& registration_state, unsigned detail_code, const std::string& detail_str) {
QTimer::singleShot(0, [this, accountID, registration_state, detail_code, detail_str] { QTimer::singleShot(0, [this, accountID, registration_state, detail_code, detail_str] {
emit this->registrationStateChanged(QString(accountID.c_str()), Q_EMIT this->registrationStateChanged(QString(accountID.c_str()),
QString(registration_state.c_str()), QString(registration_state.c_str()),
detail_code, detail_code,
QString(detail_str.c_str())); QString(detail_str.c_str()));
...@@ -88,13 +88,13 @@ public: ...@@ -88,13 +88,13 @@ public:
exportable_callback<ConfigurationSignal::VolatileDetailsChanged>( exportable_callback<ConfigurationSignal::VolatileDetailsChanged>(
[this] (const std::string &accountID, const std::map<std::string, std::string>& details) { [this] (const std::string &accountID, const std::map<std::string, std::string>& details) {
QTimer::singleShot(0, [this, accountID, details] { QTimer::singleShot(0, [this, accountID, details] {
emit this->volatileAccountDetailsChanged(QString(accountID.c_str()), convertMap(details)); Q_EMIT this->volatileAccountDetailsChanged(QString(accountID.c_str()), convertMap(details));
}); });
}), }),
exportable_callback<ConfigurationSignal::Error>( exportable_callback<ConfigurationSignal::Error>(
[this] (int code) { [this] (int code) {
QTimer::singleShot(0, [this,code] { QTimer::singleShot(0, [this,code] {
emit this->errorAlert(code); Q_EMIT this->errorAlert(code);
}); });
}) })
}; };
......
...@@ -52,25 +52,25 @@ public: ...@@ -52,25 +52,25 @@ public:
exportable_callback<PresenceSignal::NewServerSubscriptionRequest>( exportable_callback<PresenceSignal::NewServerSubscriptionRequest>(
[this] (const std::string &buddyUri) { [this] (const std::string &buddyUri) {
QTimer::singleShot(0, [this,buddyUri] { QTimer::singleShot(0, [this,buddyUri] {
emit this->newServerSubscriptionRequest(QString(buddyUri.c_str())); Q_EMIT this->newServerSubscriptionRequest(QString(buddyUri.c_str()));
}); });
}), }),
exportable_callback<PresenceSignal::ServerError>( exportable_callback<PresenceSignal::ServerError>(
[this] (const std::string &accountID, const std::string &error, const std::string &msg) { [this] (const std::string &accountID, const std::string &error, const std::string &msg) {
QTimer::singleShot(0, [this,accountID, error, msg] { QTimer::singleShot(0, [this,accountID, error, msg] {
emit this->serverError(QString(accountID.c_str()), QString(error.c_str()), QString(msg.c_str())); Q_EMIT this->serverError(QString(accountID.c_str()), QString(error.c_str()), QString(msg.c_str()));
}); });
}), }),
exportable_callback<PresenceSignal::NewBuddyNotification>( exportable_callback<PresenceSignal::NewBuddyNotification>(
[this] (const std::string &accountID, const std::string &buddyUri, bool status, const std::string &lineStatus) { [this] (const std::string &accountID, const std::string &buddyUri, bool status, const std::string &lineStatus) {
QTimer::singleShot(0, [this,accountID, buddyUri, status, lineStatus] { QTimer::singleShot(0, [this,accountID, buddyUri, status, lineStatus] {
emit this->newBuddyNotification(QString(accountID.c_str()), QString(buddyUri.c_str()), status, QString(lineStatus.c_str())); Q_EMIT this->newBuddyNotification(QString(accountID.c_str()), QString(buddyUri.c_str()), status, QString(lineStatus.c_str()));
}); });
}), }),
exportable_callback<PresenceSignal::SubscriptionStateChanged>( exportable_callback<PresenceSignal::SubscriptionStateChanged>(
[this] (const std::string &accountID, const std::string &buddyUri, bool state) { [this] (const std::string &accountID, const std::string &buddyUri, bool state) {
QTimer::singleShot(0, [this,accountID, buddyUri, state] { QTimer::singleShot(0, [this,accountID, buddyUri, state] {
emit this->subscriptionStateChanged(QString(accountID.c_str()), QString(buddyUri.c_str()), state); Q_EMIT this->subscriptionStateChanged(QString(accountID.c_str()), QString(buddyUri.c_str()), state);
}); });
}) })
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment