summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2014-01-08 17:48:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-08 18:16:35 +0100
commit4117c5b8ea09d1ed872927edb31a63868c3f43e2 (patch)
treef90ca7ea8e7590477179d6bd20358d94100433ff /src
parent66c0d916131c1e9e896705971f20385c75e753a2 (diff)
downloadqtwebchannel-4117c5b8ea09d1ed872927edb31a63868c3f43e2.tar.gz
Cleanup public API, remove private slot.
Change-Id: I73a83380c571ed5a400b16cb255562bb8079eaac Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/webchannel/qwebchannel.cpp12
-rw-r--r--src/webchannel/qwebchannel.h3
-rw-r--r--src/webchannel/qwebchannelsocket.cpp1
-rw-r--r--src/webchannel/qwebchannelsocket_p.h1
4 files changed, 5 insertions, 12 deletions
diff --git a/src/webchannel/qwebchannel.cpp b/src/webchannel/qwebchannel.cpp
index 026b31e..f7a2c5f 100644
--- a/src/webchannel/qwebchannel.cpp
+++ b/src/webchannel/qwebchannel.cpp
@@ -73,7 +73,9 @@ QWebChannel::QWebChannel(QObject *parent)
connect(d->socket, SIGNAL(failed(QString)),
SIGNAL(failed(QString)));
connect(d->socket, SIGNAL(initialized()),
- SLOT(onInitialized()));
+ SIGNAL(initialized()));
+ connect(d->socket, SIGNAL(baseUrlChanged(QString)),
+ SIGNAL(baseUrlChanged(QString)));
connect(d->socket, SIGNAL(pongReceived()),
SIGNAL(pongReceived()));
@@ -131,12 +133,6 @@ void QWebChannel::setBlockUpdates(bool block)
d->publisher->setBlockUpdates(block);
}
-void QWebChannel::onInitialized()
-{
- emit initialized();
- emit baseUrlChanged(d->socket->m_baseUrl);
-}
-
void QWebChannel::respond(const QJsonValue& messageId, const QJsonValue& data) const
{
d->sendJSONMessage(messageId, data, true);
@@ -156,5 +152,3 @@ void QWebChannel::ping() const
{
d->socket->ping();
}
-
-#include "qwebchannel.moc"
diff --git a/src/webchannel/qwebchannel.h b/src/webchannel/qwebchannel.h
index ec62208..5c64d6d 100644
--- a/src/webchannel/qwebchannel.h
+++ b/src/webchannel/qwebchannel.h
@@ -109,9 +109,6 @@ public slots:
void sendRawMessage(const QString& rawMessage) const;
void ping() const;
-private slots:
- void onInitialized();
-
private:
QScopedPointer<QWebChannelPrivate> d;
friend class QmlWebChannel;
diff --git a/src/webchannel/qwebchannelsocket.cpp b/src/webchannel/qwebchannelsocket.cpp
index c5275d0..c94efc0 100644
--- a/src/webchannel/qwebchannelsocket.cpp
+++ b/src/webchannel/qwebchannelsocket.cpp
@@ -91,6 +91,7 @@ void QWebChannelSocket::init()
m_baseUrl = QStringLiteral("127.0.0.1:%1%2").arg(port()).arg(QString::fromLatin1(m_secret));
emit initialized();
+ emit baseUrlChanged(m_baseUrl);
}
void QWebChannelSocket::socketError()
diff --git a/src/webchannel/qwebchannelsocket_p.h b/src/webchannel/qwebchannelsocket_p.h
index 234c200..1de73d7 100644
--- a/src/webchannel/qwebchannelsocket_p.h
+++ b/src/webchannel/qwebchannelsocket_p.h
@@ -62,6 +62,7 @@ public:
signals:
void failed(const QString &reason);
void initialized();
+ void baseUrlChanged(const QString &baseUrl);
protected:
bool isValid(const HeaderData &connection) Q_DECL_OVERRIDE;