refactor repo

This commit is contained in:
2025-11-10 15:34:07 +01:00
parent f064794499
commit de9ff6f807
7 changed files with 148 additions and 43 deletions
+9 -20
View File
@@ -82,13 +82,10 @@ void SPIT_Client::setActionSPITType(string typeId, bool p_ActionAssigned) {
if (spitType->setActionAssigned(p_ActionAssigned)) {
sendSPITTypeInternal(*spitType);
for (int i = 0; i < mSpitObjects.getEntryCount(); i++) {
SPITObject *ptrSPITObject = mSpitObjects.getEntry(i);
if (ptrSPITObject == nullptr)
continue;
if (ptrSPITObject->getSPITTypeID() == spitType->getID()) {
if (ptrSPITObject->setActionAssignedType(p_ActionAssigned) == true) {
sendSPITObjectInternal(ptrSPITObject);
for (auto& [key, value] : mSpitObjects.getRepo()) {
if (value->getSPITTypeID() == spitType->getID()) {
if (value->setActionAssignedType(p_ActionAssigned) == true) {
sendSPITObjectInternal(value.get());
}
}
}
@@ -648,21 +645,12 @@ void SPIT_Client::parseRequestProjectTransfer(Message::RequestProjectTransfer &p
}
// send all listes SPITTypes
int cntT = mSpitTypes.getEntryCount();
for (int i = 0; i < cntT; i++) {
SPITType *ptrSPITType = mSpitTypes.getEntry(i);
if (!ptrSPITType)
break;
sendSPITTypeInternal(*ptrSPITType);
for (const auto& [key, value] : mSpitTypes.getRepo()) {
sendSPITTypeInternal(*value);
fos::Task::delayMs(10);
}
int cntO = mSpitObjects.getEntryCount();
for (int i = 0; i < cntO; i++) {
SPITObject *ptrSPITObject = mSpitObjects.getEntry(i);
if (ptrSPITObject == nullptr)
break;
sendSPITObjectInternal(ptrSPITObject);
for (auto& [key, value] : mSpitObjects.getRepo()) {
sendSPITObjectInternal(value.get());
fos::Task::delayMs(10);
}
@@ -932,6 +920,7 @@ bool SPIT_Client::changeSPITType(SPITType *p_SPITType) {
return true;
}
/**
* If a client has removed a SPITType where id == p_SPITTypeID, it should send it to the server.
* The corresponding SPITType if listet in SPITType will be deleted.