mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-03 04:15:37 -04:00
[libcalamares] Expand API for setting URLs to check
This commit is contained in:
parent
b8583a1e59
commit
81fe8b1488
2 changed files with 22 additions and 4 deletions
|
@ -203,10 +203,21 @@ Manager::checkHasInternet()
|
|||
void
|
||||
Manager::setCheckHasInternetUrl( const QUrl& url )
|
||||
{
|
||||
if ( d->m_hasInternetUrls.empty() )
|
||||
{
|
||||
d->m_lastCheckedUrlIndex = -1;
|
||||
}
|
||||
d->m_lastCheckedUrlIndex = -1;
|
||||
d->m_hasInternetUrls.clear();
|
||||
d->m_hasInternetUrls.append( url );
|
||||
}
|
||||
|
||||
void
|
||||
Manager::setCheckHasInternetUrl( const QVector< QUrl >& urls )
|
||||
{
|
||||
d->m_lastCheckedUrlIndex = -1;
|
||||
d->m_hasInternetUrls = urls;
|
||||
}
|
||||
|
||||
void
|
||||
Manager::addCheckHasInternetUrl( const QUrl& url )
|
||||
{
|
||||
d->m_hasInternetUrls.append( url );
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <QDebug>
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include <QVector>
|
||||
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
|
@ -122,6 +123,12 @@ public:
|
|||
/// @brief Set the URL which is used for the general "is there internet" check.
|
||||
void setCheckHasInternetUrl( const QUrl& url );
|
||||
|
||||
/// @brief Adds an (extra) URL to check
|
||||
void addCheckHasInternetUrl( const QUrl& url );
|
||||
|
||||
/// @brief Set a collection of URLs used for the general "is there internet" check.
|
||||
void setCheckHasInternetUrl( const QVector< QUrl >& urls );
|
||||
|
||||
/** @brief Do a network request asynchronously.
|
||||
*
|
||||
* Returns a pointer to the reply-from-the-request.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue