mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix wrong thread for configuringStaus connect
This commit is contained in:
parent
480704664e
commit
971e7a7201
1 changed files with 17 additions and 16 deletions
|
|
@ -390,6 +390,23 @@ void App::setSelf(QSharedPointer<App>(me)) {
|
|||
mCoreModelConnection->invokeToCore([this, n] { mEventCountNotifier->notifyEventCount(n); });
|
||||
});
|
||||
|
||||
// Config error message
|
||||
mCoreModelConnection->makeConnectToModel(
|
||||
&CoreModel::configuringStatus, [this](const std::shared_ptr<linphone::Core> &core,
|
||||
linphone::ConfiguringState status, const std::string &message) {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (status == linphone::ConfiguringState::Failed) {
|
||||
mCoreModelConnection->invokeToCore([this, message]() {
|
||||
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
||||
//: Error
|
||||
Utils::showInformationPopup(
|
||||
tr("info_popup_error_title"),
|
||||
tr("info_popup_configuration_failed_message").arg(Utils::coreStringToAppString(message)),
|
||||
false);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//---------------------------------------------------------------------------------------------
|
||||
mCliModelConnection = SafeConnection<App, CliModel>::create(me, CliModel::getInstance());
|
||||
mCliModelConnection->makeConnectToCore(&App::receivedMessage, [this](int, const QByteArray &byteArray) {
|
||||
|
|
@ -471,22 +488,6 @@ void App::initCore() {
|
|||
if (mParser->isSet("verbose")) QtLogger::enableVerbose(true);
|
||||
if (mParser->isSet("qt-logs-only")) QtLogger::enableQtOnly(true);
|
||||
|
||||
// Config error message
|
||||
connect(CoreModel::getInstance().get(), &CoreModel::configuringStatus, this,
|
||||
[this](const std::shared_ptr<linphone::Core> &core, linphone::ConfiguringState status,
|
||||
const std::string &message) {
|
||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||
if (CoreModel::getInstance()->mConfigStatus == linphone::ConfiguringState::Failed) {
|
||||
QMetaObject::invokeMethod(thread(), [this, message]() {
|
||||
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
||||
//: Error
|
||||
Utils::showInformationPopup(
|
||||
tr("info_popup_error_title"),
|
||||
tr("info_popup_configuration_failed_message").arg(Utils::coreStringToAppString(message)),
|
||||
false);
|
||||
});
|
||||
}
|
||||
});
|
||||
QMetaObject::invokeMethod(
|
||||
mLinphoneThread->getThreadId(),
|
||||
[this, settings = mSettings]() mutable {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue