移动热点网络频带埋点数据重复问题

This commit is contained in:
zhangyuanyuan1 2023-07-17 16:56:04 +08:00
parent ad17622227
commit 819fe1dfd2
2 changed files with 13 additions and 12 deletions

View File

@ -120,6 +120,11 @@ MobileHotspotWidget::MobileHotspotWidget(QWidget *parent) : QWidget(parent)
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: