diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-05 18:10:38 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-25 17:40:36 +0200 |
| commit | 3c78f1e96e17f5becb6830ea473c1ed16ac261ea (patch) | |
| tree | 82699ed50fcd24a06a541fc80de04c0372ebc189 /examples/corelib | |
| parent | fe2af0f8a3e1e686d78164d97c72b3eda5511459 (diff) | |
rsslisting example: rename a slot to reflect what it does
Many slots can be connected to one signal so, unlike a virtual method
that must be named for the situation in which it is called, a slot can
(so should) be named for what it does, rather than naming it to match
the signal it's connected to.
Task-number: QTBUG-111228
Pick-to: 6.5
Change-Id: If2fa40cac0e51a243054526d7d2997fdd54aea3e
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Diffstat (limited to 'examples/corelib')
| -rw-r--r-- | examples/corelib/serialization/rsslisting/rsslisting.cpp | 4 | ||||
| -rw-r--r-- | examples/corelib/serialization/rsslisting/rsslisting.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/corelib/serialization/rsslisting/rsslisting.cpp b/examples/corelib/serialization/rsslisting/rsslisting.cpp index 8d59341d699..27e3dbce793 100644 --- a/examples/corelib/serialization/rsslisting/rsslisting.cpp +++ b/examples/corelib/serialization/rsslisting/rsslisting.cpp @@ -76,7 +76,7 @@ void RSSListing::get(const QUrl &url) } currentReply = url.isValid() ? manager.get(QNetworkRequest(url)) : nullptr; if (currentReply) { - connect(currentReply, &QNetworkReply::readyRead, this, &RSSListing::readyRead); + connect(currentReply, &QNetworkReply::readyRead, this, &RSSListing::consumeData); connect(currentReply, &QNetworkReply::errorOccurred, this, &RSSListing::error); } xml.setDevice(currentReply); // Equivalent to clear() if currentReply is null. @@ -112,7 +112,7 @@ void RSSListing::fetch() stream reader. Then we call the XML parsing function. */ -void RSSListing::readyRead() +void RSSListing::consumeData() { int statusCode = currentReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if (statusCode >= 200 && statusCode < 300) diff --git a/examples/corelib/serialization/rsslisting/rsslisting.h b/examples/corelib/serialization/rsslisting/rsslisting.h index 211b2cec332..a8e0fe66291 100644 --- a/examples/corelib/serialization/rsslisting/rsslisting.h +++ b/examples/corelib/serialization/rsslisting/rsslisting.h @@ -26,7 +26,7 @@ public: public slots: void fetch(); void finished(QNetworkReply *reply); - void readyRead(); + void consumeData(); void error(QNetworkReply::NetworkError); private: |
