From 8c6af7f1d43afb1ef5f72f2b50e42a5bfb6eb4fe Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Fri, 31 Oct 2014 16:23:55 +0100 Subject: [PATCH] m_qwebConnector is not a pointer --- alethzero/MainWin.cpp | 5 ++--- alethzero/MainWin.h | 2 +- third/MainWin.cpp | 5 ++--- third/MainWin.h | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 8756498fd98..f413532b732 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -149,8 +149,7 @@ Main::Main(QWidget *parent) : m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir() + "/AlethZero", false, {"eth", "shh"})); - m_qwebConnector = new QWebThreeConnector(); - m_server = unique_ptr(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys))); + m_server = unique_ptr(new WebThreeStubServer(&m_qwebConnector, *web3(), keysAsVector(m_myKeys))); m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); @@ -159,7 +158,7 @@ Main::Main(QWidget *parent) : // NOTE: no need to delete as QETH_INSTALL_JS_NAMESPACE adopts it. m_qweb = new QWebThree(this); auto qweb = m_qweb; - m_qwebConnector->setQWeb(qweb); + m_qwebConnector.setQWeb(qweb); QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); QWebFrame* f = ui->webView->page()->mainFrame(); diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 890607e5a82..ba2592491f4 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -256,6 +256,6 @@ private slots: bool m_logChanged = true; std::unique_ptr m_server; - QWebThreeConnector* m_qwebConnector = nullptr; + QWebThreeConnector m_qwebConnector; QWebThree* m_qweb = nullptr; }; diff --git a/third/MainWin.cpp b/third/MainWin.cpp index d2d5c087447..c2dcb7ce282 100644 --- a/third/MainWin.cpp +++ b/third/MainWin.cpp @@ -117,8 +117,7 @@ Main::Main(QWidget *parent) : m_web3.reset(new WebThreeDirect("Third", getDataDir() + "/Third", false, {"eth", "shh"})); m_web3->connect(Host::pocHost()); - m_qwebConnector = new QWebThreeConnector(); - m_server = unique_ptr(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys))); + m_server = unique_ptr(new WebThreeStubServer(&m_qwebConnector, *web3(), keysAsVector(m_myKeys))); m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); @@ -127,7 +126,7 @@ Main::Main(QWidget *parent) : // NOTE: no need to delete as QETH_INSTALL_JS_NAMESPACE adopts it. m_qweb = new QWebThree(this); auto qweb = m_qweb; - m_qwebConnector->setQWeb(qweb); + m_qwebConnector.setQWeb(qweb); QWebFrame* f = ui->webView->page()->mainFrame(); f->disconnect(SIGNAL(javaScriptWindowObjectCleared())); diff --git a/third/MainWin.h b/third/MainWin.h index 535ad88a177..607d65feedd 100644 --- a/third/MainWin.h +++ b/third/MainWin.h @@ -135,6 +135,6 @@ private slots: QNetworkAccessManager m_webCtrl; std::unique_ptr m_server; - QWebThreeConnector* m_qwebConnector = nullptr; + QWebThreeConnector m_qwebConnector; QWebThree* m_qweb = nullptr; };