summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
authorJerome Pasion <jerome.pasion@nokia.com>2010-07-29 12:59:55 (GMT)
committerJerome Pasion <jerome.pasion@nokia.com>2010-07-29 12:59:55 (GMT)
commit5bdb85e3b21bcf624eb1830aa32d027e0c6870fe (patch)
treee3193ee6947a112818e4a00adb54bc598ed142f5 /examples/network
parente98ec548d4f7b0558742014933457f756bdd8bf1 (diff)
downloadQt-5bdb85e3b21bcf624eb1830aa32d027e0c6870fe.zip
Qt-5bdb85e3b21bcf624eb1830aa32d027e0c6870fe.tar.gz
Qt-5bdb85e3b21bcf624eb1830aa32d027e0c6870fe.tar.bz2
Fixed spelling mistakes in documented functions, classes, etc. Part of QTBUG-11938 and QTBUG-10801
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/download/main.cpp2
-rw-r--r--examples/network/http/httpwindow.cpp2
-rw-r--r--examples/network/torrent/torrentclient.cpp22
3 files changed, 13 insertions, 13 deletions
diff --git a/examples/network/download/main.cpp b/examples/network/download/main.cpp
index c322a44..0fb9137 100644
--- a/examples/network/download/main.cpp
+++ b/examples/network/download/main.cpp
@@ -150,7 +150,7 @@ void DownloadManager::downloadFinished(QNetworkReply *reply)
} else {
QString filename = saveFileName(url);
if (saveToDisk(filename, reply))
- printf("Download of %s succeded (saved to %s)\n",
+ printf("Download of %s succeeded (saved to %s)\n",
url.toEncoded().constData(), qPrintable(filename));
}
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index b1ea98c..ea48546 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -206,7 +206,7 @@ void HttpWindow::httpFinished()
void HttpWindow::httpReadyRead()
{
- // this slot gets called everytime the QNetworkReply has new data.
+ // this slot gets called every time the QNetworkReply has new data.
// We read all of its new data and write it into the file.
// That way we use less RAM than when reading it at the finished()
// signal of the QNetworkReply
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index 5e25b9a..b7607a6 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -1243,8 +1243,8 @@ void TorrentClient::schedulePieceForClient(PeerWireClient *client)
// depending on the state we're in.
int pieceIndex = 0;
if (d->state == WarmingUp || (qrand() & 4) == 0) {
- int *occurrances = new int[d->pieceCount];
- memset(occurrances, 0, d->pieceCount * sizeof(int));
+ int *occurrences = new int[d->pieceCount];
+ memset(occurrences, 0, d->pieceCount * sizeof(int));
// Count how many of each piece are available.
foreach (PeerWireClient *peer, d->connections) {
@@ -1252,38 +1252,38 @@ void TorrentClient::schedulePieceForClient(PeerWireClient *client)
int peerPiecesSize = peerPieces.size();
for (int i = 0; i < peerPiecesSize; ++i) {
if (peerPieces.testBit(i))
- ++occurrances[i];
+ ++occurrences[i];
}
}
// Find the rarest or most common pieces.
- int numOccurrances = d->state == WarmingUp ? 0 : 99999;
+ int numOccurrences = d->state == WarmingUp ? 0 : 99999;
QList<int> piecesReadyForDownload;
for (int i = 0; i < d->pieceCount; ++i) {
if (d->state == WarmingUp) {
// Add common pieces
- if (occurrances[i] >= numOccurrances
+ if (occurrences[i] >= numOccurrences
&& incompletePiecesAvailableToClient.testBit(i)) {
- if (occurrances[i] > numOccurrances)
+ if (occurrences[i] > numOccurrences)
piecesReadyForDownload.clear();
piecesReadyForDownload.append(i);
- numOccurrances = occurrances[i];
+ numOccurrences = occurrences[i];
}
} else {
// Add rare pieces
- if (occurrances[i] <= numOccurrances
+ if (occurrences[i] <= numOccurrences
&& incompletePiecesAvailableToClient.testBit(i)) {
- if (occurrances[i] < numOccurrances)
+ if (occurrences[i] < numOccurrences)
piecesReadyForDownload.clear();
piecesReadyForDownload.append(i);
- numOccurrances = occurrances[i];
+ numOccurrences = occurrences[i];
}
}
}
// Select one piece randomly
pieceIndex = piecesReadyForDownload.at(qrand() % piecesReadyForDownload.size());
- delete [] occurrances;
+ delete [] occurrences;
} else {
// Make up a list of available piece indices, and pick
// a random one.