summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-01-28 15:46:51 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-01-28 15:49:55 (GMT)
commit1a6e9a69235458e55b2e726e51d2797434780384 (patch)
tree1806db1ce99a8d62486541aa7b1a2b2819e07da8 /examples
parentb4d60000981e298b7e40605a284f2b8b9b18fff5 (diff)
downloadQt-1a6e9a69235458e55b2e726e51d2797434780384.zip
Qt-1a6e9a69235458e55b2e726e51d2797434780384.tar.gz
Qt-1a6e9a69235458e55b2e726e51d2797434780384.tar.bz2
Core classes, examples, demos: Some changes from string to char
Reviewed-by: Peter Hartmann
Diffstat (limited to 'examples')
-rw-r--r--examples/network/network-chat/chatdialog.cpp2
-rw-r--r--examples/network/network-chat/client.cpp4
-rw-r--r--examples/network/network-chat/connection.cpp6
-rw-r--r--examples/network/network-chat/peermanager.cpp2
-rw-r--r--examples/network/qftp/ftpwindow.cpp3
-rw-r--r--examples/network/securesocketclient/sslclient.cpp2
-rw-r--r--examples/network/torrent/trackerclient.cpp2
7 files changed, 11 insertions, 10 deletions
diff --git a/examples/network/network-chat/chatdialog.cpp b/examples/network/network-chat/chatdialog.cpp
index d8bcb30..da65270 100644
--- a/examples/network/network-chat/chatdialog.cpp
+++ b/examples/network/network-chat/chatdialog.cpp
@@ -79,7 +79,7 @@ void ChatDialog::appendMessage(const QString &from, const QString &message)
QTextCursor cursor(textEdit->textCursor());
cursor.movePosition(QTextCursor::End);
QTextTable *table = cursor.insertTable(1, 2, tableFormat);
- table->cellAt(0, 0).firstCursorPosition().insertText("<" + from + "> ");
+ table->cellAt(0, 0).firstCursorPosition().insertText('<' + from + "> ");
table->cellAt(0, 1).firstCursorPosition().insertText(message);
QScrollBar *bar = textEdit->verticalScrollBar();
bar->setValue(bar->maximum());
diff --git a/examples/network/network-chat/client.cpp b/examples/network/network-chat/client.cpp
index 2b8725c..f516783 100644
--- a/examples/network/network-chat/client.cpp
+++ b/examples/network/network-chat/client.cpp
@@ -69,8 +69,8 @@ void Client::sendMessage(const QString &message)
QString Client::nickName() const
{
- return QString(peerManager->userName()) + "@" + QHostInfo::localHostName()
- + ":" + QString::number(server.serverPort());
+ return QString(peerManager->userName()) + '@' + QHostInfo::localHostName()
+ + ':' + QString::number(server.serverPort());
}
bool Client::hasConnection(const QHostAddress &senderIp, int senderPort) const
diff --git a/examples/network/network-chat/connection.cpp b/examples/network/network-chat/connection.cpp
index 1df8a2d..5c636b9 100644
--- a/examples/network/network-chat/connection.cpp
+++ b/examples/network/network-chat/connection.cpp
@@ -83,7 +83,7 @@ bool Connection::sendMessage(const QString &message)
return false;
QByteArray msg = message.toUtf8();
- QByteArray data = "MESSAGE " + QByteArray::number(msg.size()) + " " + msg;
+ QByteArray data = "MESSAGE " + QByteArray::number(msg.size()) + ' ' + msg;
return write(data) == data.size();
}
@@ -118,7 +118,7 @@ void Connection::processReadyRead()
return;
}
- username = QString(buffer) + "@" + peerAddress().toString() + ":"
+ username = QString(buffer) + '@' + peerAddress().toString() + ':'
+ QString::number(peerPort());
currentDataType = Undefined;
numBytesForCurrentDataType = 0;
@@ -162,7 +162,7 @@ void Connection::sendPing()
void Connection::sendGreetingMessage()
{
QByteArray greeting = greetingMessage.toUtf8();
- QByteArray data = "GREETING " + QByteArray::number(greeting.size()) + " " + greeting;
+ QByteArray data = "GREETING " + QByteArray::number(greeting.size()) + ' ' + greeting;
if (write(data) == data.size())
isGreetingMessageSent = true;
}
diff --git a/examples/network/network-chat/peermanager.cpp b/examples/network/network-chat/peermanager.cpp
index 5ad2dc7..430031b 100644
--- a/examples/network/network-chat/peermanager.cpp
+++ b/examples/network/network-chat/peermanager.cpp
@@ -61,7 +61,7 @@ PeerManager::PeerManager(Client *client)
foreach (QString string, envVariables) {
int index = environment.indexOf(QRegExp(string));
if (index != -1) {
- QStringList stringList = environment.at(index).split("=");
+ QStringList stringList = environment.at(index).split('=');
if (stringList.size() == 2) {
username = stringList.at(1).toUtf8();
break;
diff --git a/examples/network/qftp/ftpwindow.cpp b/examples/network/qftp/ftpwindow.cpp
index ae3a2b6..3fd62f8 100644
--- a/examples/network/qftp/ftpwindow.cpp
+++ b/examples/network/qftp/ftpwindow.cpp
@@ -324,7 +324,8 @@ void FtpWindow::processItem(QTreeWidgetItem *item, int /*column*/)
if (isDirectory.value(name)) {
fileList->clear();
isDirectory.clear();
- currentPath += "/" + name;
+ currentPath += '/';
+ currentPath += name;
ftp->cd(name);
ftp->list();
cdToParentButton->setEnabled(true);
diff --git a/examples/network/securesocketclient/sslclient.cpp b/examples/network/securesocketclient/sslclient.cpp
index 1422f1c..0d6a581 100644
--- a/examples/network/securesocketclient/sslclient.cpp
+++ b/examples/network/securesocketclient/sslclient.cpp
@@ -177,7 +177,7 @@ void SslClient::socketReadyRead()
void SslClient::sendData()
{
QString input = form->sessionInput->text();
- appendString(input + "\n");
+ appendString(input + '\n');
socket->write(input.toUtf8() + "\r\n");
form->sessionInput->clear();
}
diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp
index 4f23d54..2397737 100644
--- a/examples/network/torrent/trackerclient.cpp
+++ b/examples/network/torrent/trackerclient.cpp
@@ -105,7 +105,7 @@ void TrackerClient::fetchPeerList()
QString passkey = "?";
if (fullUrl.contains("?passkey")) {
passkey = metaInfo.announceUrl().mid(fullUrl.indexOf("?passkey"), -1);
- passkey += "&";
+ passkey += '&';
}
// Percent encode the hash