diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index 3c87f9fc..41ed6251 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -126,12 +126,12 @@ void NetDetail::initUI() securityBtn->setText(tr("Security")); securityBtn->setCheckable(true); - group = new QButtonGroup(this); - group->addButton(detailBtn); - group->addButton(ipv4Btn); - group->addButton(ipv6Btn); + m_group = new QButtonGroup(this); + m_group->addButton(detailBtn); + m_group->addButton(ipv4Btn); + m_group->addButton(ipv6Btn); if (isWlan) { - group->addButton(securityBtn); + m_group->addButton(securityBtn); } pageLayout->addStretch(); diff --git a/src/frontend/netdetails/netdetail.h b/src/frontend/netdetails/netdetail.h index bc353213..990a783d 100644 --- a/src/frontend/netdetails/netdetail.h +++ b/src/frontend/netdetails/netdetail.h @@ -120,7 +120,7 @@ private: ConInfo m_info; - QButtonGroup *group; + QButtonGroup *m_group; private slots: void on_btnConfirm_clicked(); diff --git a/src/frontend/tab-pages/tabpage.cpp b/src/frontend/tab-pages/tabpage.cpp index b235099c..ec70785e 100644 --- a/src/frontend/tab-pages/tabpage.cpp +++ b/src/frontend/tab-pages/tabpage.cpp @@ -93,13 +93,13 @@ void TabPage::initUI() void TabPage::updateDefaultDevice(QString &deviceName) { qDebug() << "updateDefaultDevice" << deviceName; - defaultDevice = deviceName; + m_defaultDevice = deviceName; } QString TabPage::getDefaultDevice() { - qDebug() << "getDefaultDevice" << defaultDevice; - return defaultDevice; + qDebug() << "getDefaultDevice" << m_defaultDevice; + return m_defaultDevice; } void setDefaultDevice(KyDeviceType deviceType, QString deviceName) diff --git a/src/frontend/tab-pages/tabpage.h b/src/frontend/tab-pages/tabpage.h index 7810a382..403f8a44 100644 --- a/src/frontend/tab-pages/tabpage.h +++ b/src/frontend/tab-pages/tabpage.h @@ -84,7 +84,7 @@ protected: QHBoxLayout * m_settingsLayout = nullptr; QLabel * m_settingsLabel = nullptr; - QString defaultDevice = ""; + QString m_defaultDevice = ""; //临时增加的下拉框选择网卡区域 QFrame * m_deviceFrame = nullptr; diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 07f589e1..ed1f145e 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -180,7 +180,7 @@ void WlanPage::initDeviceCombox() //空时addItem 会触发currentIndexChanged m_deviceComboBox->addItem(device, device); } - int index = m_deviceComboBox->findData(defaultDevice); + int index = m_deviceComboBox->findData(m_defaultDevice); qDebug() << index; m_deviceComboBox->setCurrentIndex(index); } @@ -202,7 +202,7 @@ void WlanPage::getActiveWlan() QMap::iterator iter = actMap.begin(); int height = 0; while (iter != actMap.end()) { - if (iter.key() == defaultDevice && !iter.value().isEmpty()) { + if (iter.key() == m_defaultDevice && !iter.value().isEmpty()) { QString ssid = iter.value().at(0); appendActiveWlan(ssid, height); break; @@ -229,11 +229,11 @@ void WlanPage::appendActiveWlan(const QString &ssid, int &height) m_activatedWlanSSid = ssid; KyWirelessNetItem data; - if (!m_resource->getWifiNetwork(defaultDevice, ssid, data)) { + if (!m_resource->getWifiNetwork(m_defaultDevice, ssid, data)) { return; } KyWirelessNetItem *item_data = new KyWirelessNetItem(data); - WlanListItem *wlanItemWidget = new WlanListItem(m_resource, item_data, defaultDevice); + WlanListItem *wlanItemWidget = new WlanListItem(m_resource, item_data, m_defaultDevice); qDebug() << "Activated wlan: ssid = " << item_data->m_NetSsid; QListWidgetItem *wlanItem = new QListWidgetItem(m_activatedNetListWidget); wlanItem->setSizeHint(QSize(m_activatedNetListWidget->width(), wlanItemWidget->height())); @@ -257,7 +257,7 @@ void WlanPage::getAllWlan() m_itemsMap.clear(); QList wlanList; // if (!m_resource->getAllDeviceWifiNetwork(map)) - if (!m_resource->getDeviceWifiNetwork(defaultDevice, wlanList)) //ZJP_TODO 获取默认网卡并传入 + if (!m_resource->getDeviceWifiNetwork(m_defaultDevice, wlanList)) //ZJP_TODO 获取默认网卡并传入 { return; } @@ -268,7 +268,7 @@ void WlanPage::getAllWlan() } KyWirelessNetItem *data = new KyWirelessNetItem(itemData); - WlanListItem *wlanItemWidget = new WlanListItem(m_resource, data, defaultDevice); + WlanListItem *wlanItemWidget = new WlanListItem(m_resource, data, m_defaultDevice); QListWidgetItem *wlanItem = new QListWidgetItem(m_inactivatedNetListWidget); qDebug() << itemData.m_NetSsid << itemData.m_isConfigured; connect(wlanItemWidget, &WlanListItem::itemHeightChanged, this, &WlanPage::onItemHeightChanged); @@ -296,11 +296,11 @@ void WlanPage::onWlanAdded(QString interface, KyWirelessNetItem &item) qDebug() << "A Wlan Added! interface = " << interface << "; ssid = " << item.m_NetSsid << Q_FUNC_INFO <<__LINE__; - if (interface != defaultDevice) { + if (interface != m_defaultDevice) { qDebug() << "wlan add interface not equal defaultdevice,ignore"; } KyWirelessNetItem *data = new KyWirelessNetItem(item); - WlanListItem *wlanItemWidget = new WlanListItem(m_resource, data, defaultDevice); + WlanListItem *wlanItemWidget = new WlanListItem(m_resource, data, m_defaultDevice); connect(wlanItemWidget, &WlanListItem::itemHeightChanged, this, &WlanPage::onItemHeightChanged); QListWidgetItem *wlanItem = new QListWidgetItem(m_inactivatedNetListWidget); wlanItem->setSizeHint(QSize(m_inactivatedNetListWidget->width(), wlanItemWidget->height())); @@ -319,7 +319,7 @@ void WlanPage::onWlanRemoved(QString interface, QString ssid) if (!m_itemsMap.contains(ssid)) { return; } if (m_expandedItem == m_itemsMap.value(ssid)) { m_expandedItem = nullptr; } qDebug() << "A Wlan Removed! interface = " << interface << "; ssid = " << ssid << Q_FUNC_INFO <<__LINE__; - if (interface != defaultDevice) { + if (interface != m_defaultDevice) { qDebug() << "wlan remove interface not equal defaultdevice,ignore"; } int height = m_inactivatedNetListWidget->itemWidget(m_itemsMap.value(ssid))->height(); @@ -463,12 +463,12 @@ void WlanPage::onActivatedWlanChanged(QString uuid, NetworkManager::ActiveConnec } } - if (state == NetworkManager::ActiveConnection::State::Activated && defaultDevice == devName) { + if (state == NetworkManager::ActiveConnection::State::Activated && m_defaultDevice == devName) { //onWlanRemoved(m_wlanDevice, ssid); m_activatedNetListWidget->clear(); int height = 0; appendActiveWlan(ssid, height); - onWlanRemoved(defaultDevice, ssid); + onWlanRemoved(m_defaultDevice, ssid); // this->showDesktopNotify(tr("Connect WLAN succeed")); } else if (state == NetworkManager::ActiveConnection::State::Deactivated) { onWlanUpdated(); @@ -502,7 +502,7 @@ void WlanPage::onItemHeightChanged(const QString &ssid) void WlanPage::onConnectButtonClicked(KyWirelessConnectSetting &connSettingInfo, const bool &isHidden) { qDebug() << "Received signal of connecting wlan, ssid = " << connSettingInfo.m_ssid << Q_FUNC_INFO << __LINE__; - m_wirelessConnectOpreation->addAndActiveWirelessConnect(defaultDevice, connSettingInfo, isHidden); + m_wirelessConnectOpreation->addAndActiveWirelessConnect(m_defaultDevice, connSettingInfo, isHidden); } /** @@ -529,7 +529,7 @@ void WlanPage::onDeviceComboxIndexChanged(int currentIndex) //TODO 设备变更时更新设备和列表 QString currentDevice = m_deviceComboBox->itemText(currentIndex); qDebug() << "Current device changed! device = " << currentDevice << Q_FUNC_INFO << __LINE__; - defaultDevice = currentDevice; + m_defaultDevice = currentDevice; getActiveWlan(); getAllWlan(); } @@ -546,7 +546,7 @@ void WlanPage::requestScan() void WlanPage::onHiddenWlanClicked() { qDebug() << "[wlanPage] AddHideWifi Clicked! " << Q_FUNC_INFO << __LINE__ ; - NetDetail *netDetail = new NetDetail(defaultDevice, "", "", false, true, true, this); + NetDetail *netDetail = new NetDetail(m_defaultDevice, "", "", false, true, true, this); netDetail->show(); }