Browse Source

m_qwebConnector is not a pointer

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
8c6af7f1d4
  1. 5
      alethzero/MainWin.cpp
  2. 2
      alethzero/MainWin.h
  3. 5
      third/MainWin.cpp
  4. 2
      third/MainWin.h

5
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<WebThreeStubServer>(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys)));
m_server = unique_ptr<WebThreeStubServer>(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();

2
alethzero/MainWin.h

@ -256,6 +256,6 @@ private:
bool m_logChanged = true;
std::unique_ptr<WebThreeStubServer> m_server;
QWebThreeConnector* m_qwebConnector = nullptr;
QWebThreeConnector m_qwebConnector;
QWebThree* m_qweb = nullptr;
};

5
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<WebThreeStubServer>(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys)));
m_server = unique_ptr<WebThreeStubServer>(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()));

2
third/MainWin.h

@ -135,6 +135,6 @@ private:
QNetworkAccessManager m_webCtrl;
std::unique_ptr<WebThreeStubServer> m_server;
QWebThreeConnector* m_qwebConnector = nullptr;
QWebThreeConnector m_qwebConnector;
QWebThree* m_qweb = nullptr;
};

Loading…
Cancel
Save