[Companion][InputsPanel] Fix "ghost" input names being left over when moving items (closes #5740); Cut/paste and drag-move will now also copy the input name if destination input is nameless and source input becomes empty (will not duplicate names); Clean up/simplify some code. (#5942)
This commit is contained in:
committed by
Bertrand Songis
parent
c19b1a65bf
commit
487c0de90f
@@ -151,7 +151,7 @@ QVector<const MixData *> ModelData::mixes(int channel) const
|
||||
return result;
|
||||
}
|
||||
|
||||
void ModelData::removeInput(const int idx)
|
||||
void ModelData::removeInput(const int idx, bool clearName)
|
||||
{
|
||||
unsigned int chn = expoData[idx].chn;
|
||||
|
||||
@@ -159,15 +159,8 @@ void ModelData::removeInput(const int idx)
|
||||
expoData[CPN_MAX_EXPOS-1].clear();
|
||||
|
||||
//also remove input name if removing last line for this input
|
||||
bool found = false;
|
||||
for (int i=0; i<CPN_MAX_EXPOS; i++) {
|
||||
if (expoData[i].mode==0) continue;
|
||||
if (expoData[i].chn==chn) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) inputNames[chn][0] = 0;
|
||||
if (clearName && !expos(chn).size())
|
||||
inputNames[chn][0] = 0;
|
||||
}
|
||||
|
||||
void ModelData::clearInputs()
|
||||
|
||||
Reference in New Issue
Block a user