refactor repo
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user