Changeset View
Changeset View
Standalone View
Standalone View
libs/models/networkmodelitem.cpp
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 53 | NetworkModelItem::NetworkModelItem(QObject *parent) | |||
---|---|---|---|---|---|
57 | , m_detailsValid(false) | 57 | , m_detailsValid(false) | ||
58 | , m_duplicate(false) | 58 | , m_duplicate(false) | ||
59 | , m_mode(NetworkManager::WirelessSetting::Infrastructure) | 59 | , m_mode(NetworkManager::WirelessSetting::Infrastructure) | ||
60 | , m_securityType(NetworkManager::NoneSecurity) | 60 | , m_securityType(NetworkManager::NoneSecurity) | ||
61 | , m_signal(0) | 61 | , m_signal(0) | ||
62 | , m_slave(false) | 62 | , m_slave(false) | ||
63 | , m_type(NetworkManager::ConnectionSettings::Unknown) | 63 | , m_type(NetworkManager::ConnectionSettings::Unknown) | ||
64 | , m_vpnState(NetworkManager::VpnConnection::Unknown) | 64 | , m_vpnState(NetworkManager::VpnConnection::Unknown) | ||
65 | , m_rxBytes(0) | ||||
66 | , m_txBytes(0) | ||||
65 | { | 67 | { | ||
66 | } | 68 | } | ||
67 | 69 | | |||
68 | NetworkModelItem::NetworkModelItem(const NetworkModelItem *item, QObject *parent) | 70 | NetworkModelItem::NetworkModelItem(const NetworkModelItem *item, QObject *parent) | ||
69 | : QObject(parent) | 71 | : QObject(parent) | ||
70 | , m_connectionPath(item->connectionPath()) | 72 | , m_connectionPath(item->connectionPath()) | ||
71 | , m_connectionState(NetworkManager::ActiveConnection::Deactivated) | 73 | , m_connectionState(NetworkManager::ActiveConnection::Deactivated) | ||
72 | , m_detailsValid(false) | 74 | , m_detailsValid(false) | ||
73 | , m_duplicate(true) | 75 | , m_duplicate(true) | ||
74 | , m_mode(item->mode()) | 76 | , m_mode(item->mode()) | ||
75 | , m_name(item->name()) | 77 | , m_name(item->name()) | ||
76 | , m_securityType(item->securityType()) | 78 | , m_securityType(item->securityType()) | ||
77 | , m_slave(item->slave()) | 79 | , m_slave(item->slave()) | ||
78 | , m_ssid(item->ssid()) | 80 | , m_ssid(item->ssid()) | ||
79 | , m_timestamp(item->timestamp()) | 81 | , m_timestamp(item->timestamp()) | ||
80 | , m_type(item->type()) | 82 | , m_type(item->type()) | ||
81 | , m_uuid(item->uuid()) | 83 | , m_uuid(item->uuid()) | ||
82 | , m_vpnState(NetworkManager::VpnConnection::Unknown) | 84 | , m_vpnState(NetworkManager::VpnConnection::Unknown) | ||
85 | , m_rxBytes(0) | ||||
86 | , m_txBytes(0) | ||||
83 | { | 87 | { | ||
84 | } | 88 | } | ||
85 | 89 | | |||
86 | NetworkModelItem::~NetworkModelItem() | 90 | NetworkModelItem::~NetworkModelItem() | ||
87 | { | 91 | { | ||
88 | } | 92 | } | ||
89 | 93 | | |||
90 | QString NetworkModelItem::activeConnectionPath() const | 94 | QString NetworkModelItem::activeConnectionPath() const | ||
▲ Show 20 Lines • Show All 312 Lines • ▼ Show 20 Line(s) | 406 | { | |||
403 | return m_vpnType; | 407 | return m_vpnType; | ||
404 | } | 408 | } | ||
405 | 409 | | |||
406 | void NetworkModelItem::setVpnType(const QString &type) | 410 | void NetworkModelItem::setVpnType(const QString &type) | ||
407 | { | 411 | { | ||
408 | m_vpnType = type; | 412 | m_vpnType = type; | ||
409 | } | 413 | } | ||
410 | 414 | | |||
415 | qulonglong NetworkModelItem::rxBytes() const | ||||
416 | { | ||||
417 | return m_rxBytes; | ||||
418 | } | ||||
419 | | ||||
420 | void NetworkModelItem::setRxBytes(qulonglong bytes) | ||||
421 | { | ||||
422 | m_rxBytes = bytes; | ||||
423 | } | ||||
424 | | ||||
425 | qulonglong NetworkModelItem::txBytes() const | ||||
426 | { | ||||
427 | return m_txBytes; | ||||
428 | } | ||||
429 | | ||||
430 | void NetworkModelItem::setTxBytes(qulonglong bytes) | ||||
431 | { | ||||
432 | m_txBytes = bytes; | ||||
433 | } | ||||
434 | | ||||
411 | bool NetworkModelItem::operator==(const NetworkModelItem *item) const | 435 | bool NetworkModelItem::operator==(const NetworkModelItem *item) const | ||
412 | { | 436 | { | ||
413 | if (!item->uuid().isEmpty() && !uuid().isEmpty()) { | 437 | if (!item->uuid().isEmpty() && !uuid().isEmpty()) { | ||
414 | if (item->devicePath() == devicePath() && item->uuid() == uuid()) { | 438 | if (item->devicePath() == devicePath() && item->uuid() == uuid()) { | ||
415 | return true; | 439 | return true; | ||
416 | } | 440 | } | ||
417 | } else if (item->type() == NetworkManager::ConnectionSettings::Wireless && type() == NetworkManager::ConnectionSettings::Wireless) { | 441 | } else if (item->type() == NetworkManager::ConnectionSettings::Wireless && type() == NetworkManager::ConnectionSettings::Wireless) { | ||
418 | if (item->ssid() == ssid() && item->devicePath() == devicePath()) { | 442 | if (item->ssid() == ssid() && item->devicePath() == devicePath()) { | ||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |