summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2017-08-28 13:35:35 +0200
committerKai Koehne <kai.koehne@qt.io>2017-08-29 09:36:41 +0000
commit228184f93b4d39e1aca9e53fde8e576f71b90c93 (patch)
treeb1563c03c57bc7c37f7068b2eae4c2bdf3ad86c4
parent046040e4b08972018fcb10ef882a35f7162cb38c (diff)
downloadqtwebchannel-228184f93b4d39e1aca9e53fde8e576f71b90c93.tar.gz
Examples: Fix coding style issues
Change-Id: Ifdd0a9117bc354c342728949e45d1ac431495ef4 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r--examples/webchannel/chatserver-cpp/chatserver.cpp10
-rw-r--r--examples/webchannel/chatserver-cpp/chatserver.h10
-rw-r--r--examples/webchannel/shared/websocketclientwrapper.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/examples/webchannel/chatserver-cpp/chatserver.cpp b/examples/webchannel/chatserver-cpp/chatserver.cpp
index 0678dc5..beee713 100644
--- a/examples/webchannel/chatserver-cpp/chatserver.cpp
+++ b/examples/webchannel/chatserver-cpp/chatserver.cpp
@@ -57,7 +57,7 @@
ChatServer::ChatServer(QObject *parent)
: QObject(parent)
{
- QTimer* t = new QTimer(this);
+ QTimer *t = new QTimer(this);
connect(t, &QTimer::timeout, this, &ChatServer::sendKeepAlive);
t->start(10000);
@@ -71,7 +71,7 @@ ChatServer::~ChatServer()
{}
-bool ChatServer::login(const QString& userName)
+bool ChatServer::login(const QString &userName)
{
//stop keepAliveCheck, when a new user logged in
if (m_keepAliveCheckTimer->isActive()) {
@@ -91,7 +91,7 @@ bool ChatServer::login(const QString& userName)
return true;
}
-bool ChatServer::logout(const QString& userName)
+bool ChatServer::logout(const QString &userName)
{
if (!m_userList.contains(userName)) {
return false;
@@ -103,7 +103,7 @@ bool ChatServer::logout(const QString& userName)
}
}
-bool ChatServer::sendMessage(const QString& user, const QString& msg)
+bool ChatServer::sendMessage(const QString &user, const QString &msg)
{
if (m_userList.contains(user)) {
emit newMessage(QTime::currentTime().toString("HH:mm:ss"), user, msg);
@@ -128,7 +128,7 @@ void ChatServer::checkKeepAliveResponses()
emit userListChanged();
}
-void ChatServer::keepAliveResponse(const QString& user)
+void ChatServer::keepAliveResponse(const QString &user)
{
m_stillAliveUsers.append(user);
}
diff --git a/examples/webchannel/chatserver-cpp/chatserver.h b/examples/webchannel/chatserver-cpp/chatserver.h
index 74b571d..9bc8026 100644
--- a/examples/webchannel/chatserver-cpp/chatserver.h
+++ b/examples/webchannel/chatserver-cpp/chatserver.h
@@ -70,17 +70,17 @@ public:
public:
//a user logs in with the given username
- Q_INVOKABLE bool login(const QString& userName);
+ Q_INVOKABLE bool login(const QString &userName);
//the user logs out, will be removed from userlist immediately
- Q_INVOKABLE bool logout(const QString& userName);
+ Q_INVOKABLE bool logout(const QString &userName);
//a user sends a message to all other users
- Q_INVOKABLE bool sendMessage(const QString& user, const QString& msg);
+ Q_INVOKABLE bool sendMessage(const QString &user, const QString &msg);
//response of the keep alive signal from a client.
// This is used to detect disconnects.
- Q_INVOKABLE void keepAliveResponse(const QString& user);
+ Q_INVOKABLE void keepAliveResponse(const QString &user);
QStringList userList() const;
@@ -97,7 +97,7 @@ signals:
private:
QStringList m_userList;
QStringList m_stillAliveUsers;
- QTimer* m_keepAliveCheckTimer;
+ QTimer *m_keepAliveCheckTimer;
};
#endif // CHATSERVER_H
diff --git a/examples/webchannel/shared/websocketclientwrapper.h b/examples/webchannel/shared/websocketclientwrapper.h
index 7275b41..efb8b4b 100644
--- a/examples/webchannel/shared/websocketclientwrapper.h
+++ b/examples/webchannel/shared/websocketclientwrapper.h
@@ -67,7 +67,7 @@ public:
WebSocketClientWrapper(QWebSocketServer *server, QObject *parent = nullptr);
signals:
- void clientConnected(WebSocketTransport* client);
+ void clientConnected(WebSocketTransport *client);
private slots:
void handleNewConnection();