Fix deadlocks and qml errors.
This commit is contained in:
parent
6cfb26ba1b
commit
6176f1971c
9 changed files with 62 additions and 44 deletions
|
|
@ -85,16 +85,18 @@ ConferenceInfoCore::ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo>
|
||||||
}
|
}
|
||||||
mConferenceInfoState = LinphoneEnums::fromLinphone(conferenceInfo->getState());
|
mConferenceInfoState = LinphoneEnums::fromLinphone(conferenceInfo->getState());
|
||||||
} else {
|
} else {
|
||||||
auto defaultAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
|
App::postModelSync([this]() {
|
||||||
if (defaultAccount) {
|
auto defaultAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
|
||||||
auto accountAddress = defaultAccount->getContactAddress();
|
if (defaultAccount) {
|
||||||
if (accountAddress) {
|
auto accountAddress = defaultAccount->getContactAddress();
|
||||||
auto cleanedClonedAddress = accountAddress->clone();
|
if (accountAddress) {
|
||||||
cleanedClonedAddress->clean();
|
auto cleanedClonedAddress = accountAddress->clone();
|
||||||
mOrganizerAddress = Utils::coreStringToAppString(cleanedClonedAddress->asStringUriOnly());
|
cleanedClonedAddress->clean();
|
||||||
qDebug() << "set organizer address" << mOrganizerAddress;
|
mOrganizerAddress = Utils::coreStringToAppString(cleanedClonedAddress->asStringUriOnly());
|
||||||
|
qDebug() << "set organizer address" << mOrganizerAddress;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(this, &ConferenceInfoCore::endDateTimeChanged,
|
connect(this, &ConferenceInfoCore::endDateTimeChanged,
|
||||||
|
|
@ -146,7 +148,7 @@ void ConferenceInfoCore::setSelf(SafeSharedPointer<ConferenceInfoCore> me) {
|
||||||
void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
|
void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
|
||||||
if (me) {
|
if (me) {
|
||||||
if (mConferenceInfoModel) {
|
if (mConferenceInfoModel) {
|
||||||
mCoreModelConnection = nullptr;
|
mConfInfoModelConnection = nullptr;
|
||||||
mConfInfoModelConnection = QSharedPointer<SafeConnection<ConferenceInfoCore, ConferenceInfoModel>>(
|
mConfInfoModelConnection = QSharedPointer<SafeConnection<ConferenceInfoCore, ConferenceInfoModel>>(
|
||||||
new SafeConnection<ConferenceInfoCore, ConferenceInfoModel>(me, mConferenceInfoModel),
|
new SafeConnection<ConferenceInfoCore, ConferenceInfoModel>(me, mConferenceInfoModel),
|
||||||
&QObject::deleteLater);
|
&QObject::deleteLater);
|
||||||
|
|
@ -175,9 +177,10 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
|
||||||
mConfInfoModelConnection->makeConnectToModel(&ConferenceInfoModel::conferenceInfoDeleted,
|
mConfInfoModelConnection->makeConnectToModel(&ConferenceInfoModel::conferenceInfoDeleted,
|
||||||
&ConferenceInfoCore::removed);
|
&ConferenceInfoCore::removed);
|
||||||
|
|
||||||
mConfInfoModelConnection->makeConnectToModel(
|
mConfInfoModelConnection->makeConnectToModel(&ConferenceInfoModel::stateChanged,
|
||||||
&ConferenceInfoModel::stateChanged,
|
[this](linphone::ConferenceScheduler::State state) {
|
||||||
[this](linphone::ConferenceScheduler::State state) { qDebug() << "conf state changed"; });
|
qDebug() << "conf state changed:" << (int)state;
|
||||||
|
});
|
||||||
mConfInfoModelConnection->makeConnectToModel(
|
mConfInfoModelConnection->makeConnectToModel(
|
||||||
&ConferenceInfoModel::invitationsSent,
|
&ConferenceInfoModel::invitationsSent,
|
||||||
[this](const std::list<std::shared_ptr<linphone::Address>> &failedInvitations) {
|
[this](const std::list<std::shared_ptr<linphone::Address>> &failedInvitations) {
|
||||||
|
|
@ -332,7 +335,7 @@ void ConferenceInfoCore::addParticipant(const QString &address) {
|
||||||
}
|
}
|
||||||
QVariantMap participant;
|
QVariantMap participant;
|
||||||
auto displayNameObj = Utils::getDisplayName(address);
|
auto displayNameObj = Utils::getDisplayName(address);
|
||||||
if (displayNameObj) participant["displayName"] = displayNameObj->getValue();
|
participant["displayName"] = displayNameObj ? displayNameObj->getValue() : "";
|
||||||
participant["address"] = address;
|
participant["address"] = address;
|
||||||
participant["role"] = (int)LinphoneEnums::ParticipantRole::Listener;
|
participant["role"] = (int)LinphoneEnums::ParticipantRole::Listener;
|
||||||
mParticipants.append(participant);
|
mParticipants.append(participant);
|
||||||
|
|
@ -515,8 +518,11 @@ void ConferenceInfoCore::save() {
|
||||||
}
|
}
|
||||||
thisCopy->writeIntoModel(mConferenceInfoModel);
|
thisCopy->writeIntoModel(mConferenceInfoModel);
|
||||||
thisCopy->deleteLater();
|
thisCopy->deleteLater();
|
||||||
confSchedulerModel->setInfo(linphoneConf);
|
mCoreModelConnection->invokeToCore([this, confSchedulerModel, linphoneConf]() {
|
||||||
mCoreModelConnection->invokeToCore([this]() { setSelf(mCoreModelConnection->mCore); });
|
setSelf(mCoreModelConnection->mCore);
|
||||||
|
mCoreModelConnection->invokeToModel(
|
||||||
|
[this, confSchedulerModel, linphoneConf]() { confSchedulerModel->setInfo(linphoneConf); });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ std::shared_ptr<CoreModel> CoreModel::getInstance() {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<linphone::Core> CoreModel::getCore() {
|
std::shared_ptr<linphone::Core> CoreModel::getCore() {
|
||||||
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
return mCore;
|
return mCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -281,12 +281,17 @@ QString Utils::generateLinphoneSipAddress(const QString &uri) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Utils::findAvatarByAddress(const QString &address) {
|
QString Utils::findAvatarByAddress(const QString &address) {
|
||||||
auto defaultFriendList = CoreModel::getInstance()->getCore()->getDefaultFriendList();
|
QString avatar;
|
||||||
if (!defaultFriendList) return QString();
|
|
||||||
auto linphoneAddr = ToolModel::interpretUrl(address);
|
App::postModelSync([address, avatar]() mutable {
|
||||||
auto linFriend = CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
auto defaultFriendList = CoreModel::getInstance()->getCore()->getDefaultFriendList();
|
||||||
if (linFriend) return Utils::coreStringToAppString(linFriend->getPhoto());
|
if (!defaultFriendList) return;
|
||||||
return QString();
|
auto linphoneAddr = ToolModel::interpretUrl(address);
|
||||||
|
auto linFriend = CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
|
||||||
|
if (linFriend) avatar = Utils::coreStringToAppString(linFriend->getPhoto());
|
||||||
|
});
|
||||||
|
|
||||||
|
return avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Utils::generateSavedFilename(const QString &from, const QString &to) {
|
QString Utils::generateSavedFilename(const QString &from, const QString &to) {
|
||||||
|
|
|
||||||
|
|
@ -39,13 +39,17 @@ bool Thread::isInLinphoneThread() {
|
||||||
|
|
||||||
bool Thread::mustBeInLinphoneThread(const QString &context) {
|
bool Thread::mustBeInLinphoneThread(const QString &context) {
|
||||||
bool isLinphoneThread = isInLinphoneThread();
|
bool isLinphoneThread = isInLinphoneThread();
|
||||||
if (!isLinphoneThread) qCritical() << "[Thread] Not processing in Linphone thread from " << context;
|
if (!isLinphoneThread) { // Bracket to easier debugging.
|
||||||
|
qCritical() << "[Thread] Not processing in Linphone thread from " << context;
|
||||||
|
}
|
||||||
return isLinphoneThread;
|
return isLinphoneThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Thread::mustBeInMainThread(const QString &context) {
|
bool Thread::mustBeInMainThread(const QString &context) {
|
||||||
if (!qApp) return true;
|
if (!qApp) return true;
|
||||||
bool isMainThread = QThread::currentThread() == qApp->thread();
|
bool isMainThread = QThread::currentThread() == qApp->thread();
|
||||||
if (!isMainThread) qCritical() << "[Thread] Not processing in Main thread from " << context;
|
if (!isMainThread) {
|
||||||
|
qCritical() << "[Thread] Not processing in Main thread from " << context;
|
||||||
|
}
|
||||||
return isMainThread;
|
return isMainThread;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -232,9 +232,6 @@ Item {
|
||||||
model: MagicSearchProxy {
|
model: MagicSearchProxy {
|
||||||
searchText: searchBarText.length === 0 ? "*" : searchBarText
|
searchText: searchBarText.length === 0 ? "*" : searchBarText
|
||||||
}
|
}
|
||||||
onContactSelected: (contact) => {
|
|
||||||
if (contact.core.allAddresses.length > 1) {
|
|
||||||
startCallPopup.contact = contact
|
|
||||||
onSelectedContactChanged: {
|
onSelectedContactChanged: {
|
||||||
if (selectedContact) {
|
if (selectedContact) {
|
||||||
if (selectedContact.core.allAddresses.length > 1) {
|
if (selectedContact.core.allAddresses.length > 1) {
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ Control.ComboBox {
|
||||||
visible: source != ""
|
visible: source != ""
|
||||||
width: visible ? 20 * DefaultStyle.dp : 0
|
width: visible ? 20 * DefaultStyle.dp : 0
|
||||||
sourceSize.width: 20 * DefaultStyle.dp
|
sourceSize.width: 20 * DefaultStyle.dp
|
||||||
source: modelData.img ? modelData.img : ""
|
source: modelData && modelData.img ? modelData.img : ""
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: visible ? 10 * DefaultStyle.dp : 0
|
anchors.leftMargin: visible ? 10 * DefaultStyle.dp : 0
|
||||||
|
|
@ -137,11 +137,11 @@ Control.ComboBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: modelData.text
|
text: modelData
|
||||||
? modelData.text
|
? modelData.text
|
||||||
: modelData
|
? modelData.text
|
||||||
? modelData
|
: modelData
|
||||||
: ""
|
: ""
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 1
|
maximumLineCount: 1
|
||||||
wrapMode: Text.WrapAnywhere
|
wrapMode: Text.WrapAnywhere
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ ListView {
|
||||||
property int delegateLeftMargin: 0
|
property int delegateLeftMargin: 0
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
|
|
||||||
property var delegateButtons
|
property var delegateButtons: []
|
||||||
|
|
||||||
property FriendGui selectedContact: model.getAt(currentIndex) || null
|
property FriendGui selectedContact: model.getAt(currentIndex) || null
|
||||||
|
|
||||||
|
|
@ -120,20 +120,25 @@ ListView {
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
id: actionsRow
|
||||||
z: 1
|
z: 1
|
||||||
height: parent.height
|
anchors.fill: parent
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: 5 * DefaultStyle.dp
|
anchors.rightMargin: 5 * DefaultStyle.dp
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
RowLayout{
|
||||||
children: mainItem.delegateButtons || []
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
children: mainItem.delegateButtons
|
||||||
|
}
|
||||||
PopupButton {
|
PopupButton {
|
||||||
id: friendPopup
|
id: friendPopup
|
||||||
z: 1
|
z: 1
|
||||||
hoverEnabled: mainItem.hoverEnabled
|
Layout.rightMargin: 5 * DefaultStyle.dp
|
||||||
visible: mainItem.contactMenuVisible && (contactArea.containsMouse || hovered || popup.opened) && (!delegateButtons || delegateButtons.children.length === 0)
|
Layout.alignment: Qt.AlignVCenter
|
||||||
popup.x: 0
|
popup.x: 0
|
||||||
popup.padding: 10 * DefaultStyle.dp
|
popup.padding: 10 * DefaultStyle.dp
|
||||||
Layout.rightMargin: 5 * DefaultStyle.dp
|
hoverEnabled: mainItem.hoverEnabled
|
||||||
|
visible: mainItem.contactMenuVisible && (contactArea.containsMouse || hovered || popup.opened) && (!mainItem.delegateButtons || mainItem.delegateButtons.length === 0)
|
||||||
|
|
||||||
popup.contentItem: ColumnLayout {
|
popup.contentItem: ColumnLayout {
|
||||||
Button {
|
Button {
|
||||||
background: Item{}
|
background: Item{}
|
||||||
|
|
|
||||||
|
|
@ -334,7 +334,7 @@ ColumnLayout {
|
||||||
model: mainItem.conferenceInfoGui.core.participants
|
model: mainItem.conferenceInfoGui.core.participants
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
height: 56 * DefaultStyle.dp
|
height: 56 * DefaultStyle.dp
|
||||||
width: parent.width
|
width: participantList.width
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
Avatar {
|
Avatar {
|
||||||
|
|
@ -374,4 +374,4 @@ ColumnLayout {
|
||||||
Item {
|
Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
external/linphone-sdk
vendored
2
external/linphone-sdk
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 98c2b724e1a045eb46ccba23a912ba6e1ac0647d
|
Subproject commit 0dda330ac9ccd7f5b495ac147e88ff7dbb620762
|
||||||
Loading…
Reference in a new issue