Display all participants count in ICS (all = SDK participants + organizer)

This commit is contained in:
Julien Wadel 2022-12-05 15:13:10 +01:00
parent e7767224a0
commit 6f673554e4
4 changed files with 26 additions and 5 deletions

View file

@ -207,11 +207,29 @@ QVariantList ConferenceInfoModel::getParticipants() const{
}
return addresses;
}
QVariantList ConferenceInfoModel::getAllParticipants() const{
QVariantList addresses = getParticipants();
QString organizerAddress = QString::fromStdString(mConferenceInfo->getOrganizer()->asStringUriOnly());
for(auto item : addresses){
if( item.toMap()["address"] == organizerAddress)
return addresses;
}
QVariantMap participant;
participant["displayName"] = Utils::getDisplayName(mConferenceInfo->getOrganizer());
participant["address"] = organizerAddress;
addresses << participant;
return addresses;
}
int ConferenceInfoModel::getParticipantCount()const{
return mConferenceInfo->getParticipants().size();
}
int ConferenceInfoModel::getAllParticipantCount()const{
return getAllParticipants().size();
}
TimeZoneModel* ConferenceInfoModel::getTimeZoneModel() const{
TimeZoneModel * model = new TimeZoneModel(mTimeZone);
App::getInstance()->getEngine()->setObjectOwnership(model, QQmlEngine::JavaScriptOwnership);

View file

@ -50,6 +50,7 @@ public:
Q_PROPERTY(bool isScheduled READ isScheduled WRITE setIsScheduled NOTIFY isScheduledChanged)
Q_PROPERTY(int inviteMode READ getInviteMode WRITE setInviteMode NOTIFY inviteModeChanged)
Q_PROPERTY(int participantCount READ getParticipantCount NOTIFY participantsChanged)
Q_PROPERTY(int allParticipantCount READ getAllParticipantCount NOTIFY participantsChanged)
Q_PROPERTY(LinphoneEnums::ConferenceInfoState state READ getConferenceInfoState NOTIFY conferenceInfoStateChanged)
Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState conferenceSchedulerState READ getConferenceSchedulerState NOTIFY conferenceSchedulerStateChanged)
@ -74,7 +75,9 @@ public:
bool isScheduled() const;
int getInviteMode() const;
Q_INVOKABLE QVariantList getParticipants() const;
Q_INVOKABLE QVariantList getAllParticipants() const;
Q_INVOKABLE int getParticipantCount()const;
Q_INVOKABLE int getAllParticipantCount()const;
Q_INVOKABLE TimeZoneModel* getTimeZoneModel() const;
Q_INVOKABLE QString getIcalendarString() const;
LinphoneEnums::ConferenceInfoState getConferenceInfoState() const;

View file

@ -212,10 +212,10 @@ Loader{
Layout.alignment: Qt.AlignTop
spacing: 0
visible: mainItem.isExpanded
onVisibleChanged: visible ? model= mainItem.conferenceInfoModel.getParticipants() : model = []
onVisibleChanged: visible ? model= mainItem.conferenceInfoModel.getAllParticipants() : model = []
Connections{
target: mainItem.conferenceInfoModel
onParticipantsChanged: if(expandedParticipantsList.visible) expandedParticipantsList.model = mainItem.conferenceInfoModel.getParticipants()
onParticipantsChanged: if(expandedParticipantsList.visible) expandedParticipantsList.model = mainItem.conferenceInfoModel.getAllParticipants()
}
delegate: Row{

View file

@ -109,7 +109,7 @@ Loader{
}
RowLayout {
id: participantsRow
property int participantCount: mainItem.conferenceInfoModel.participantCount
property int participantCount: mainItem.conferenceInfoModel.allParticipantCount
Layout.fillWidth: true
Layout.preferredHeight: ChatCalendarMessageStyle.participants.iconSize
Layout.leftMargin: 5
@ -204,10 +204,10 @@ Loader{
Layout.leftMargin: 10
spacing: 0
visible: mainItem.isExpanded
onVisibleChanged: visible ? model= mainItem.conferenceInfoModel.getParticipants() : model = []
onVisibleChanged: visible ? model= mainItem.conferenceInfoModel.getAllParticipants() : model = []
Connections{
target: mainItem.conferenceInfoModel
onParticipantsChanged: if(expandedParticipantsList.visible) expandedParticipantsList.model = mainItem.conferenceInfoModel.getParticipants()
onParticipantsChanged: if(expandedParticipantsList.visible) expandedParticipantsList.model = mainItem.conferenceInfoModel.getAllParticipants()
}
delegate: Row{