fix meeting list ui

This commit is contained in:
Gaelle Braud 2024-11-06 14:57:10 +01:00
parent 94dd384129
commit c5c95d5a6f
4 changed files with 16 additions and 6 deletions

View file

@ -546,8 +546,9 @@ void ConferenceInfoCore::writeIntoModel(std::shared_ptr<ConferenceInfoModel> mod
model->enableInvite(mInviteEnabled);
if (!mOrganizerAddress.isEmpty()) {
model->setOrganizer(mOrganizerAddress);
lDebug() << "Use of " << mOrganizerAddress;
} else lDebug() << "Use of " << model->getOrganizerAddress();
lDebug() << log().arg("Use of %1").arg(mOrganizerAddress);
} else lDebug() << log().arg("Use of %1").arg(model->getOrganizerAddress());
model->setDescription(mDescription);
std::list<std::shared_ptr<linphone::ParticipantInfo>> participantInfos;
for (auto &p : mParticipants) {

View file

@ -77,8 +77,9 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
mCoreModelConnection->invokeToCore([this, items]() {
mustBeInMainThread(getClassName());
int currentDateIndex = sort(*items);
auto itemAfterDummy = currentDateIndex < items->size() - 1 ? items->at(currentDateIndex + 1) : nullptr;
updateHaveCurrentDate(itemAfterDummy);
resetData<ConferenceInfoCore>(*items);
updateHaveCurrentDate();
if (mLastConfInfoInserted) {
int index = -1;
// TODO : uncomment when linphone conference scheduler updated
@ -160,6 +161,11 @@ void ConferenceInfoList::updateHaveCurrentDate() {
setHaveCurrentDate(false);
}
void ConferenceInfoList::updateHaveCurrentDate(QSharedPointer<ConferenceInfoCore> itemToCompare) {
setHaveCurrentDate(itemToCompare &&
itemToCompare->getDateTimeUtc().date() == QDateTime::currentDateTimeUtc().date());
}
int ConferenceInfoList::getCurrentDateIndex() const {
return mCurrentDateIndex;
}

View file

@ -43,6 +43,7 @@ public:
bool haveCurrentDate() const;
void setHaveCurrentDate(bool have);
void updateHaveCurrentDate();
void updateHaveCurrentDate(QSharedPointer<ConferenceInfoCore> itemToCompare);
int getCurrentDateIndex() const;
void setCurrentDateIndex(int index);

View file

@ -23,7 +23,9 @@ ListView {
// using highlight doesn't center, take time before moving and don't work for not visible item (like not loaded)
highlightFollowsCurrentItem: false
onCountChanged: selectedConference = model && currentIndex != -1 && currentIndex < model.count ? model.getAt(currentIndex) : null
onCountChanged: {
selectedConference = model && currentIndex != -1 && currentIndex < model.count ? model.getAt(currentIndex) : null
}
onCurrentIndexChanged: {
selectedConference = model.getAt(currentIndex) || null
}
@ -68,7 +70,7 @@ ListView {
id: itemDelegate
height: 63 * DefaultStyle.dp + topOffset
width: mainItem.width
enabled: !isCanceled
enabled: !isCanceled && haveModel
property var previousItem : mainItem.model.count > 0 && index > 0 ? mainItem.model.getAt(index-1) : null
property var dateTime: !!$modelData && $modelData.core.haveModel ? $modelData.core.dateTime : UtilsCpp.getCurrentDateTime()
property string day : UtilsCpp.toDateDayNameString(dateTime)
@ -161,7 +163,7 @@ ListView {
Layout.preferredHeight: 24 * DefaultStyle.dp
}
Text {
text: $modelData.core.subject
text: $modelData? $modelData.core.subject : ""
font {
pixelSize: 13 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp