Commit 4a36bf18 authored by Leander Schulten's avatar Leander Schulten
Browse files

deviceprototype.cpp : begin/endPushBack is already called by channels.push_back

parent fa56d686
Pipeline #148670 passed with stage
in 1 minute and 18 seconds
......@@ -19,18 +19,12 @@ void DevicePrototype::removeChannels(int newMaxIndex){
void DevicePrototype::addChannel(int channel, QString name, QString description){
// dummy Channels einfügen
if (channel>=getNumberOfChannels()) {
channels.beginPushBack(getNumberOfChannels()-channel);
for (int i = getNumberOfChannels(); i < channel; ++i) {
channels.push_back(std::make_unique<Channel>(i));
emit channelAdded(channels.getVector().back().get());
QJsonObject o;
channels.back()->writeJsonObject(o);
}
channels.getVector().push_back(std::make_unique<Channel>(channel,name,description));
channels.endPushBack();
channels.push_back(std::make_unique<Channel>(channel,name,description));
emit channelAdded(channels.getVector().back().get());
QJsonObject o;
channels.getVector().back()->writeJsonObject(o);
}else{
// eigenschaften setzten
channels.getVector()[channel]->setName(name);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment