Changeset View
Changeset View
Standalone View
Standalone View
libs/models/creatableconnectionsmodel.cpp
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Line(s) | 154 | #endif | |||
---|---|---|---|---|---|
170 | m_list << connectionItem; | 170 | m_list << connectionItem; | ||
171 | 171 | | |||
172 | connectionItem = new CreatableConnectionItem(i18n("Wi-Fi (shared)"), i18n("Hardware based connections"), | 172 | connectionItem = new CreatableConnectionItem(i18n("Wi-Fi (shared)"), i18n("Hardware based connections"), | ||
173 | i18n("Some wi-fi description"), QStringLiteral("network-wireless"), | 173 | i18n("Some wi-fi description"), QStringLiteral("network-wireless"), | ||
174 | NetworkManager::ConnectionSettings::Wireless, | 174 | NetworkManager::ConnectionSettings::Wireless, | ||
175 | QString(), QString(), true); // VpnType and SpecificType are empty | 175 | QString(), QString(), true); // VpnType and SpecificType are empty | ||
176 | m_list << connectionItem; | 176 | m_list << connectionItem; | ||
177 | 177 | | |||
178 | // WireGuard changed from VPN plugin to primary device in version 1.16 of NetworkManager | ||||
179 | if (NetworkManager::checkVersion(1, 16, 0)) { | ||||
180 | connectionItem = new CreatableConnectionItem(i18n("WireGuard"), i18n("VPN connections"), | ||||
181 | i18n("WireGuard"), QStringLiteral("network-vpn"), | ||||
182 | NetworkManager::ConnectionSettings::WireGuard, | ||||
183 | QStringLiteral("WireGuard"), QString(), true); // VpnType and SpecificType are empty | ||||
184 | m_list << connectionItem; | ||||
185 | } | ||||
186 | | ||||
178 | if (Configuration::manageVirtualConnections()) { | 187 | if (Configuration::manageVirtualConnections()) { | ||
179 | connectionItem = new CreatableConnectionItem(i18n("Bond"), i18n("Virtual connections"), | 188 | connectionItem = new CreatableConnectionItem(i18n("Bond"), i18n("Virtual connections"), | ||
180 | i18n("Some bond description"), QStringLiteral("network-wired"), | 189 | i18n("Some bond description"), QStringLiteral("network-wired"), | ||
181 | NetworkManager::ConnectionSettings::Bond, | 190 | NetworkManager::ConnectionSettings::Bond, | ||
182 | QString(), QString(), true); // VpnType and SpecificType are empty | 191 | QString(), QString(), true); // VpnType and SpecificType are empty | ||
183 | m_list << connectionItem; | 192 | m_list << connectionItem; | ||
184 | 193 | | |||
185 | connectionItem = new CreatableConnectionItem(i18n("Bridge"), i18n("Virtual connections"), | 194 | connectionItem = new CreatableConnectionItem(i18n("Bridge"), i18n("Virtual connections"), | ||
186 | i18n("Some bond description"), QStringLiteral("network-wired"), | 195 | i18n("Some bond description"), QStringLiteral("network-wired"), | ||
187 | NetworkManager::ConnectionSettings::Bridge, | 196 | NetworkManager::ConnectionSettings::Bridge, | ||
188 | QString(), QString(), true); // VpnType and SpecificType are empty | 197 | QString(), QString(), true); // VpnType and SpecificType are empty | ||
189 | m_list << connectionItem; | 198 | m_list << connectionItem; | ||
190 | 199 | | |||
191 | connectionItem = new CreatableConnectionItem(i18n("Team"), i18n("Virtual connections"), | 200 | connectionItem = new CreatableConnectionItem(i18n("Team"), i18n("Virtual connections"), | ||
192 | i18n("Some team description"), QStringLiteral("network-wired"), | 201 | i18n("Some team description"), QStringLiteral("network-wired"), | ||
193 | NetworkManager::ConnectionSettings::Team, | 202 | NetworkManager::ConnectionSettings::Team, | ||
194 | QString(), QString(), true); // VpnType and SpecificType are empty | 203 | QString(), QString(), true); // VpnType and SpecificType are empty | ||
195 | m_list << connectionItem; | 204 | m_list << connectionItem; | ||
196 | 205 | | |||
197 | connectionItem = new CreatableConnectionItem(i18n("Vlan"), i18n("Virtual connections"), | 206 | connectionItem = new CreatableConnectionItem(i18n("Vlan"), i18n("Virtual connections"), | ||
198 | i18n("Some vlan description"), QStringLiteral("network-wired"), | 207 | i18n("Some vlan description"), QStringLiteral("network-wired"), | ||
199 | NetworkManager::ConnectionSettings::Vlan, | 208 | NetworkManager::ConnectionSettings::Vlan, | ||
200 | QString(), QString(), true); // VpnType and SpecificType are empty | 209 | QString(), QString(), true); // VpnType and SpecificType are empty | ||
201 | m_list << connectionItem; | 210 | m_list << connectionItem; | ||
211 | | ||||
202 | } | 212 | } | ||
203 | 213 | | |||
204 | KService::List services = KServiceTypeTrader::self()->query("PlasmaNetworkManagement/VpnUiPlugin"); | 214 | KService::List services = KServiceTypeTrader::self()->query("PlasmaNetworkManagement/VpnUiPlugin"); | ||
205 | 215 | | |||
206 | std::sort(services.begin(), services.end(), [] (const KService::Ptr &left, const KService::Ptr &right) | 216 | std::sort(services.begin(), services.end(), [] (const KService::Ptr &left, const KService::Ptr &right) | ||
207 | { | 217 | { | ||
208 | return QString::localeAwareCompare(left->name(), right->name()) <= 0; | 218 | return QString::localeAwareCompare(left->name(), right->name()) <= 0; | ||
209 | }); | 219 | }); | ||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |