Changeset View
Changeset View
Standalone View
Standalone View
src/app/reservationmanager.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 178 | for (const auto &batchedId : batch) { | |||
---|---|---|---|---|---|
180 | if (MergeUtil::isSame(res, batchedRes)) { | 180 | if (MergeUtil::isSame(res, batchedRes)) { | ||
181 | // this is actually an update of a batched reservation | 181 | // this is actually an update of a batched reservation | ||
182 | const auto newRes = JsonLdDocument::apply(otherRes, res); | 182 | const auto newRes = JsonLdDocument::apply(otherRes, res); | ||
183 | updateReservation(batchedId, newRes); | 183 | updateReservation(batchedId, newRes); | ||
184 | return; | 184 | return; | ||
185 | } | 185 | } | ||
186 | } | 186 | } | ||
187 | 187 | | |||
188 | // truely new, and added to an existing batch | 188 | // truly new, and added to an existing batch | ||
189 | const QString resId = QUuid::createUuid().toString(); | 189 | const QString resId = QUuid::createUuid().toString(); | ||
190 | storeReservation(resId, res); | 190 | storeReservation(resId, res); | ||
191 | emit reservationAdded(resId); | 191 | emit reservationAdded(resId); | ||
192 | 192 | | |||
193 | m_batchToResMap[*it].push_back(resId); | 193 | m_batchToResMap[*it].push_back(resId); | ||
194 | m_resToBatchMap.insert(resId, *it); | 194 | m_resToBatchMap.insert(resId, *it); | ||
195 | emit batchChanged(*it); | 195 | emit batchChanged(*it); | ||
196 | storeBatch(*it); | 196 | storeBatch(*it); | ||
197 | return; | 197 | return; | ||
198 | } | 198 | } | ||
199 | } | 199 | } | ||
200 | 200 | | |||
201 | // truely new, and starting a new batch | 201 | // truly new, and starting a new batch | ||
202 | const QString resId = QUuid::createUuid().toString(); | 202 | const QString resId = QUuid::createUuid().toString(); | ||
203 | storeReservation(resId, res); | 203 | storeReservation(resId, res); | ||
204 | emit reservationAdded(resId); | 204 | emit reservationAdded(resId); | ||
205 | 205 | | |||
206 | m_batches.insert(beginIt, resId); | 206 | m_batches.insert(beginIt, resId); | ||
207 | m_batchToResMap.insert(resId, {resId}); | 207 | m_batchToResMap.insert(resId, {resId}); | ||
208 | m_resToBatchMap.insert(resId, resId); | 208 | m_resToBatchMap.insert(resId, resId); | ||
209 | emit batchAdded(resId); | 209 | emit batchAdded(resId); | ||
▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines |