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:
joshua
2022-02-20 13:13:29 +01:00
parent 05a2e4b37b
commit 0ff099fb52
7 changed files with 24 additions and 47 deletions

View File

@@ -17,6 +17,7 @@
*/
#include "groupterminalscommand.h"
#include "../physicalterminal.h"
#include "../realterminal.h"
/**
* @brief GroupTerminalsCommand::GroupTerminalsCommand
@@ -87,8 +88,7 @@ void UnGroupTerminalsCommand::setUp(const QVector<QSharedPointer<RealTerminal>>
{
for (const auto &rt_ : to_ungroup)
{
auto phy_t = m_terminal_strip->physicalTerminal(rt_);
if (phy_t)
if (auto phy_t = rt_->physicalTerminal())
{
//Physical have only one real terminal, no need to ungroup it
if (phy_t->realTerminalCount() <= 1) {