Merge branch '2309-0717' into 'yhkylin/v101'

fix bug 182329 182738 移动热点数据埋点问题

See merge request kylinos-src/kylin-nm!220
This commit is contained in:
赵世旭 2023-07-17 09:20:12 +00:00
commit c825182a5e
2 changed files with 14 additions and 13 deletions

View File

@ -116,10 +116,15 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent)
connect(m_switchBtn, &KSwitchButton::stateChanged, this, &MobileHotspotWidget::setUiEnabled); connect(m_switchBtn, &KSwitchButton::stateChanged, this, &MobileHotspotWidget::setUiEnabled);
connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MobileHotspotWidget::onInterfaceChanged); connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MobileHotspotWidget::onInterfaceChanged);
connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]() { connect(m_interfaceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [=]() {
UkccCommon::buriedSettings("MobileHotspot", "select", QString("Net card")); UkccCommon::buriedSettings("MobileHotspot", "Net card", QString("select"), m_interfaceComboBox->currentText());
m_interfaceName = m_interfaceComboBox->currentText(); m_interfaceName = m_interfaceComboBox->currentText();
updateBandCombox(); updateBandCombox();
}); });
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){
if (m_isUserSelect && !m_freqBandComboBox->currentText().isEmpty()) {
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
}
});
onInterfaceChanged(); onInterfaceChanged();
#ifdef HOTSPOT_CONTROL #ifdef HOTSPOT_CONTROL
@ -470,11 +475,9 @@ void MobileHotspotWidget::getApInfo()
} }
int i = m_freqBandComboBox->findText(apInfo.at(5)); int i = m_freqBandComboBox->findText(apInfo.at(5));
if (i >= 0) { if (i >= 0) {
disconnect(m_freqBandComboBox); m_isUserSelect = false;
m_freqBandComboBox->setCurrentIndex(i); m_freqBandComboBox->setCurrentIndex(i);
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){ m_isUserSelect = true;
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
});
} }
} }
} }
@ -732,11 +735,9 @@ void MobileHotspotWidget::onHotspotActivated(QString devName, QString ssid, QStr
updateBandCombox(); updateBandCombox();
index = m_freqBandComboBox->findText(info.at(1)); index = m_freqBandComboBox->findText(info.at(1));
if (index >= 0) { if (index >= 0) {
disconnect(m_freqBandComboBox); m_isUserSelect = false;
m_freqBandComboBox->setCurrentIndex(index); m_freqBandComboBox->setCurrentIndex(index);
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){ m_isUserSelect = true;
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
});
} }
m_uuid = uuid; m_uuid = uuid;
} else { } else {
@ -816,7 +817,7 @@ void MobileHotspotWidget::updateBandCombox()
setWidgetHidden(true); setWidgetHidden(true);
return; return;
} }
disconnect(m_freqBandComboBox); m_isUserSelect = false;
QMap<QString, int> devCapMap = capReply.value(); QMap<QString, int> devCapMap = capReply.value();
if (devCapMap[m_interfaceName] & 0x02) { if (devCapMap[m_interfaceName] & 0x02) {
m_freqBandComboBox->addItem("2.4GHz"); m_freqBandComboBox->addItem("2.4GHz");
@ -828,9 +829,7 @@ void MobileHotspotWidget::updateBandCombox()
if (index >= 0) { if (index >= 0) {
m_freqBandComboBox->setCurrentIndex(index); m_freqBandComboBox->setCurrentIndex(index);
} }
connect(m_freqBandComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), [=](){ m_isUserSelect = true;
UkccCommon::buriedSettings("MobileHotspot", "Frequency band", QString("select"), m_freqBandComboBox->currentText());
});
} }
QFrame* MobileHotspotWidget::myLine() QFrame* MobileHotspotWidget::myLine()

View File

@ -144,6 +144,8 @@ private:
void initConnectDevPage(); void initConnectDevPage();
void initBlackListPage(); void initBlackListPage();
bool m_isUserSelect = true; //是否用户操作
signals: signals:
private slots: private slots: