mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
refactor: simplify the code
This commit is contained in:
@@ -8,18 +8,13 @@ EnhancedWebView::EnhancedWebView(QWidget *parent)
|
||||
: QWebEngineView(parent)
|
||||
, cdp(new CDPCommandManager)
|
||||
{
|
||||
QObject::connect(cdp, &CDPCommandManager::ready, this, &EnhancedWebView::onCDPReady);
|
||||
QObject::connect(cdp, &CDPCommandManager::eventReceived, this, &EnhancedWebView::onEventReceived);
|
||||
}
|
||||
|
||||
EnhancedWebView::~EnhancedWebView()
|
||||
{
|
||||
delete cdp;
|
||||
QObject::connect(cdp, &CDPCommandManager::ready, this, &EnhancedWebView::onCDPReady);
|
||||
QObject::connect(cdp, &CDPCommandManager::eventReceived, this, &EnhancedWebView::onEventReceived);
|
||||
}
|
||||
|
||||
void EnhancedWebView::initialize()
|
||||
{
|
||||
QString port = QProcessEnvironment::systemEnvironment().value(ENV_CDP_PORT);
|
||||
auto port = QProcessEnvironment::systemEnvironment().value(ENV_CDP_PORT);
|
||||
cdp->initialize("http://127.0.0.1:" + port + "/json");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user