This commit is contained in:
Gaelle Braud 2025-01-08 14:43:08 +01:00
parent aab7ad1c6d
commit 6a46aab83d
4 changed files with 12 additions and 6 deletions

View file

@ -570,7 +570,7 @@ void ConferenceInfoCore::save() {
mConferenceInfoModel->updateConferenceInfo(); mConferenceInfoModel->updateConferenceInfo();
mConfInfoModelConnection->invokeToCore([this] { mConfInfoModelConnection->invokeToCore([this] {
undo(); // Reset new values because some values can be invalid and not changed. undo(); // Reset new values because some values can be invalid and not changed.
emit dataChanged(); emit dataSaved();
}); });
}); });
} else { } else {

View file

@ -153,7 +153,7 @@ signals:
void timeZoneModelChanged(); void timeZoneModelChanged();
void saveFailed(); void saveFailed();
void dataChanged(); void dataSaved();
void invitationsSent(); void invitationsSent();
void removed(ConferenceInfoCore *confInfo); void removed(ConferenceInfoCore *confInfo);

View file

@ -223,7 +223,7 @@ void ConferenceInfoList::connectItem(QSharedPointer<ConferenceInfoCore> confInfo
remove(confInfo); remove(confInfo);
updateHaveCurrentDate(); updateHaveCurrentDate();
}); });
connect(confInfoCore.get(), &ConferenceInfoCore::dataChanged, this, [this, confInfoCore]() { connect(confInfoCore.get(), &ConferenceInfoCore::dataSaved, this, [this, confInfoCore]() {
int i = -1; int i = -1;
get(confInfoCore.get(), &i); get(confInfoCore.get(), &i);
if (i != -1) { if (i != -1) {

View file

@ -42,14 +42,20 @@ ConferenceInfoProxy::ConferenceInfoProxy(QObject *parent) : LimitProxy(parent) {
[this](QSharedPointer<ConferenceInfoCore> data) { [this](QSharedPointer<ConferenceInfoCore> data) {
auto sortModel = dynamic_cast<SortFilterList *>(sourceModel()); auto sortModel = dynamic_cast<SortFilterList *>(sourceModel());
sortModel->invalidate(); // New conf => sort change. Filter can change if on current date. sortModel->invalidate(); // New conf => sort change. Filter can change if on current date.
emit conferenceInfoCreated(new ConferenceInfoGui(data)); static const QMetaMethod confInfoCreatedSignal =
QMetaMethod::fromSignal(&ConferenceInfoProxy::conferenceInfoCreated);
if (isSignalConnected(confInfoCreatedSignal)) emit conferenceInfoCreated(new ConferenceInfoGui(data));
}, },
Qt::QueuedConnection); Qt::QueuedConnection);
// When the date of a conference is being modified, it can be moved at another index, // When the date of a conference is being modified, it can be moved at another index,
// so we need to find this new index to select the right coference info // so we need to find this new index to select the right conference info
connect( connect(
mList.get(), &ConferenceInfoList::confInfoUpdated, this, mList.get(), &ConferenceInfoList::confInfoUpdated, this,
[this](QSharedPointer<ConferenceInfoCore> data) { emit conferenceInfoUpdated(new ConferenceInfoGui(data)); }, [this](QSharedPointer<ConferenceInfoCore> data) {
static const QMetaMethod confInfoUpdatedSignal =
QMetaMethod::fromSignal(&ConferenceInfoProxy::conferenceInfoUpdated);
if (isSignalConnected(confInfoUpdatedSignal)) emit conferenceInfoUpdated(new ConferenceInfoGui(data));
},
Qt::QueuedConnection); Qt::QueuedConnection);
connect(mList.get(), &ConferenceInfoList::initialized, this, &ConferenceInfoProxy::initialized); connect(mList.get(), &ConferenceInfoList::initialized, this, &ConferenceInfoProxy::initialized);
} }