mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 01:10:53 +01:00
Revamp code
Change the way to know who is the physical terminal of a real terminal when we got only the real terminal.
This commit is contained in:
@@ -717,7 +717,7 @@ void TerminalStripEditor::on_m_group_terminals_pb_clicked()
|
||||
if (mrtd_vector.size() >= 2)
|
||||
{
|
||||
//At this step get the first physical terminal as receiver
|
||||
auto receiver_ = m_current_strip->physicalTerminal(mrtd_vector.first().real_terminal);
|
||||
auto receiver_ = mrtd_vector.first().real_terminal.toStrongRef()->physicalTerminal();
|
||||
|
||||
QVector<QSharedPointer<RealTerminal>> vector_;
|
||||
int count_ = 0;
|
||||
@@ -728,11 +728,11 @@ void TerminalStripEditor::on_m_group_terminals_pb_clicked()
|
||||
|
||||
//Get the better physical terminal as receiver
|
||||
//(physical terminal with the max of real terminal)
|
||||
const auto current_physical = m_current_strip->physicalTerminal(real_t);
|
||||
const auto current_physical = real_t->physicalTerminal();
|
||||
int real_t_count = current_physical->realTerminalCount();
|
||||
if (real_t_count > 1 && real_t_count > count_) {
|
||||
count_ = real_t_count;
|
||||
receiver_ = m_current_strip->physicalTerminal(real_t);
|
||||
receiver_ = real_t->physicalTerminal();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user