From 11d52df04c64a7af54db5634e78a89bf2f95f3fa Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 20 Aug 2019 10:18:49 -0400 Subject: [PATCH] [libcalamares] Add API docs to network service --- src/libcalamares/network/Manager.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/libcalamares/network/Manager.h b/src/libcalamares/network/Manager.h index a9903e115..f357d8d70 100644 --- a/src/libcalamares/network/Manager.h +++ b/src/libcalamares/network/Manager.h @@ -37,13 +37,36 @@ class DLLEXPORT Manager : QObject Manager(); public: + /** @brief Gets the single Manager instance. + * + * Typical code will use `auto& nam = Manager::instance();` + * to keep the reference. + */ static Manager& instance(); virtual ~Manager(); + /** @brief Checks if the given @p url returns data. + * + * Returns @c true if it does; @c false means no data, typically + * because of an error or no network access. + */ bool synchronousPing( const QUrl& url ); + /// @brief Set the URL which is used for the general "is there internet" check. void setCheckHasInternetUrl( const QUrl& url ); + /** @brief Do an explicit check for internet connectivity. + * + * This **may** do a ping to the configured check URL, but can also + * use other mechanisms. + */ bool checkHasInternet(); + /** @brief Is there internet connectivity? + * + * This returns the result of the last explicit check, or if there + * is other information about the state of the internet connection, + * whatever is known. @c true means you can expect (all) internet + * connectivity to be present. + */ bool hasInternet(); private: