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();
mConfInfoModelConnection->invokeToCore([this] {
undo(); // Reset new values because some values can be invalid and not changed.
emit dataChanged();
emit dataSaved();
});
});
} else {

View file

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

View file

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

View file

@ -42,14 +42,20 @@ ConferenceInfoProxy::ConferenceInfoProxy(QObject *parent) : LimitProxy(parent) {
[this](QSharedPointer<ConferenceInfoCore> data) {
auto sortModel = dynamic_cast<SortFilterList *>(sourceModel());
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);
// 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(
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);
connect(mList.get(), &ConferenceInfoList::initialized, this, &ConferenceInfoProxy::initialized);
}