refs #485 URL/URL list

* added constructor for CUrlList
* added registration of metadata of fail over class
* default port support for getPort
This commit is contained in:
Klaus Basan
2016-02-20 00:03:38 +01:00
committed by Mathew Sutcliffe
parent ce3edc37d0
commit 92a36890eb
5 changed files with 25 additions and 1 deletions

View File

@@ -56,6 +56,12 @@ namespace BlackMisc
return m_path;
}
int CUrl::getPort() const
{
if (m_port > 0) { return m_port; }
return protocolToDefaultPort(this->getScheme());
}
bool CUrl::hasPort() const
{
return m_port >= 0;
@@ -128,6 +134,11 @@ namespace BlackMisc
this->setQuery(url.query());
}
QNetworkRequest CUrl::toNetworkRequest() const
{
return QNetworkRequest(this->toQUrl());
}
CUrl CUrl::withAppendedPath(const QString &path) const
{
if (path.isEmpty()) { return *this; }