[libcalamares] Shuffle namespace lines around

- put all the definitions inside namespace {} to avoid
   needlessly long source lines.
This commit is contained in:
Adriaan de Groot 2019-08-23 12:09:30 +02:00
parent b8bad1c0b4
commit af1aa701bc

View File

@ -35,36 +35,35 @@ struct Manager::Private
Private(); Private();
}; };
} // namespace Network
} // namespace CalamaresUtils Manager::Private::Private()
CalamaresUtils::Network::Manager::Private::Private()
: m_nam( std::make_unique< QNetworkAccessManager >() ) : m_nam( std::make_unique< QNetworkAccessManager >() )
, m_hasInternet( false ) , m_hasInternet( false )
{ {
} }
CalamaresUtils::Network::Manager::Manager() Manager::Manager()
: d( std::make_unique< Private >() ) : d( std::make_unique< Private >() )
{ {
} }
CalamaresUtils::Network::Manager::~Manager() {} Manager::~Manager() {}
CalamaresUtils::Network::Manager& Manager&
CalamaresUtils::Network::Manager::instance() Manager::instance()
{ {
static auto* s_manager = new CalamaresUtils::Network::Manager(); static auto* s_manager = new Manager();
return *s_manager; return *s_manager;
} }
bool bool
CalamaresUtils::Network::Manager::hasInternet() Manager::hasInternet()
{ {
return d->m_hasInternet; return d->m_hasInternet;
} }
bool bool
CalamaresUtils::Network::Manager::checkHasInternet() Manager::checkHasInternet()
{ {
bool hasInternet = d->m_nam->networkAccessible() == QNetworkAccessManager::Accessible; bool hasInternet = d->m_nam->networkAccessible() == QNetworkAccessManager::Accessible;
@ -77,13 +76,13 @@ CalamaresUtils::Network::Manager::checkHasInternet()
} }
void void
CalamaresUtils::Network::Manager::setCheckHasInternetUrl( const QUrl& url ) Manager::setCheckHasInternetUrl( const QUrl& url )
{ {
d->m_hasInternetUrl = url; d->m_hasInternetUrl = url;
} }
bool bool
CalamaresUtils::Network::Manager::synchronousPing( const QUrl& url ) Manager::synchronousPing( const QUrl& url )
{ {
if ( !url.isValid() ) if ( !url.isValid() )
{ {
@ -100,7 +99,7 @@ CalamaresUtils::Network::Manager::synchronousPing( const QUrl& url )
} }
QByteArray QByteArray
CalamaresUtils::Network::Manager::synchronousGet( const QUrl& url ) Manager::synchronousGet( const QUrl& url )
{ {
if ( !url.isValid() ) if ( !url.isValid() )
{ {
@ -115,3 +114,6 @@ CalamaresUtils::Network::Manager::synchronousGet( const QUrl& url )
reply->deleteLater(); reply->deleteLater();
return reply->readAll(); return reply->readAll();
} }
} // namespace Network
} // namespace CalamaresUtils