fix:bug #87742 87734 &&普通wifi密码存储策略不为默认时的获取时间过长问题

This commit is contained in:
jzxc95 2021-11-02 11:15:35 +08:00
parent 71ba1b44a0
commit 199dafc23a
5 changed files with 23 additions and 7 deletions

View File

@ -3,7 +3,7 @@
#include <QListWidget>
#define MAX_NAME_LENGTH 32
#define MAX_LABEL_WIDTH 276
#define MAX_LABEL_WIDTH 250
extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed);
DetailPage::DetailPage(bool isWlan, bool isCreate, QWidget *parent)
@ -160,7 +160,9 @@ void DetailPage::initUI() {
m_ipv4DnsWidget = new DetailWidget(qobject_cast<QWidget *>(mIPV4Dns), m_listWidget);
m_ipv4DnsWidget->setKey(tr("IPV4 Dns:"));
mIPV6 = new QLabel(this);
mIPV6 = new FixLabel(this);
mIPV6->setFixedWidth(MAX_LABEL_WIDTH);
mIPV6->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
m_ipv6Widget = new DetailWidget(qobject_cast<QWidget *>(mIPV6), m_listWidget);
m_ipv6Widget->setKey(tr("IPV6:"));

View File

@ -61,7 +61,7 @@ public:
QLabel *mBandWidth;
QLabel *mIPV4;
QLabel *mIPV4Dns;
QLabel *mIPV6;
FixLabel *mIPV6;
QLabel *mMac;
QLabel *autoConnect;

View File

@ -5,6 +5,8 @@
#define ITEM_HEIGHT 36
#define ITEM_MARGINS 18,0,16,0
#define MAX_LABEL_WIDTH 138
FixLabel::FixLabel(QWidget *parent):
QLabel(parent)
{
@ -56,7 +58,9 @@ void DetailWidget::initUI()
m_mainLayout = new QHBoxLayout(this);
m_mainLayout->setContentsMargins(ITEM_MARGINS);
m_keyLabel = new QLabel(this);
m_keyLabel = new FixLabel(this);
m_keyLabel->setMaximumWidth(MAX_LABEL_WIDTH);
m_keyLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
m_mainLayout->addWidget(m_keyLabel);
m_mainLayout->addStretch();
m_mainLayout->addWidget(m_valueWidget);

View File

@ -32,7 +32,7 @@ public:
private:
QHBoxLayout * m_mainLayout = nullptr;
QLabel * m_keyLabel = nullptr;
FixLabel * m_keyLabel = nullptr;
QWidget * m_valueWidget = nullptr;
void initUI();

View File

@ -429,6 +429,9 @@ void NetDetail::getBaseInfo(ConInfo &conInfo)
conInfo.strChan = QString::number(item.m_channel);
//无线特有
conInfo.strSecType = item.m_secuType;
if (conInfo.strSecType.isEmpty()) {
conInfo.strSecType = "None";
}
}
} else {
uint iHz,iChan;
@ -536,14 +539,21 @@ void NetDetail::getStaticIpInfo(ConInfo &conInfo, bool bActived)
void NetDetail::initSecuData()
{
QString password;
QString password("");
int type = m_info.secType;
switch (type) {
case NONE:
break;
case WPA_AND_WPA2_PERSONAL:
case WPA3_PERSONAL:
password = m_wirelessConnOpration->getPsk(m_uuid);
if (!m_uuid.isEmpty()) {
NetworkManager::Setting::SecretFlags flag;
if (m_wirelessConnOpration->getConnSecretFlags(m_uuid, flag)) {
if (!flag) {
password = m_wirelessConnOpration->getPsk(m_uuid);
}
}
}
m_info.strPassword = password;
securityPage->setPsk(password);
break;