[The description of the desktop operate]
| 115 | |
| 116 | //! [The description of the desktop operate] |
| 117 | const QString COperateDesktop::Description() |
| 118 | { |
| 119 | QString szDescription; |
| 120 | if(!Name().isEmpty()) |
| 121 | szDescription = tr("Name: ") + Name() + "\n"; |
| 122 | |
| 123 | if(!GetTypeName().isEmpty()) |
| 124 | szDescription += tr("Type: ") + GetTypeName() + "\n"; |
| 125 | |
| 126 | if(!Protocol().isEmpty()) { |
| 127 | szDescription += tr("Protocol: ") + Protocol(); |
| 128 | #ifdef DEBUG |
| 129 | if(!GetPlugin()->DisplayName().isEmpty()) |
| 130 | szDescription += " - " + GetPlugin()->DisplayName(); |
| 131 | #endif |
| 132 | szDescription += "\n"; |
| 133 | } |
| 134 | |
| 135 | if(!ServerName().isEmpty()) |
| 136 | szDescription += tr("Server name: ") + ServerName() + "\n"; |
| 137 | |
| 138 | if(GetParameter()) { |
| 139 | if(!GetParameter()->m_Net.GetHost().isEmpty()) |
| 140 | szDescription += tr("Server address: ") + GetParameter()->m_Net.GetHost() + ":" |
| 141 | + QString::number(GetParameter()->m_Net.GetPort()) + "\n"; |
| 142 | |
| 143 | QString szProxy(tr("Proxy") + " "); |
| 144 | auto &proxy = GetParameter()->m_Proxy; |
| 145 | switch(proxy.GetUsedType()) { |
| 146 | case CParameterProxy::TYPE::SSHTunnel: |
| 147 | { |
| 148 | auto &sshNet = proxy.m_SSH.m_Net; |
| 149 | szProxy += "(" + tr("SSH tunnel") + "): " + sshNet.GetHost() + ":" |
| 150 | + QString::number(sshNet.GetPort()); |
| 151 | break; |
| 152 | } |
| 153 | case CParameterProxy::TYPE::SockesV5: |
| 154 | { |
| 155 | auto &sockesV5 = proxy.m_SockesV5; |
| 156 | szProxy += "(" + tr("Sockes v5") + "): " + sockesV5.GetHost() + ":" |
| 157 | + QString::number(sockesV5.GetPort()); |
| 158 | break; |
| 159 | } |
| 160 | default: |
| 161 | szProxy.clear(); |
| 162 | break; |
| 163 | } |
| 164 | |
| 165 | if(!szProxy.isEmpty()) |
| 166 | szDescription += szProxy + "\n"; |
| 167 | } |
| 168 | |
| 169 | CSecurityLevel sl(GetSecurityLevel()); |
| 170 | if(!(GetSecurityLevel() & CSecurityLevel::Level::No)) { |
| 171 | szDescription += tr("Security level: "); |
| 172 | if(!sl.GetUnicodeIcon().isEmpty()) |
| 173 | szDescription += sl.GetUnicodeIcon() + " "; |
| 174 | szDescription += sl.GetString() + "\n"; |
nothing calls this directly
no test coverage detected