mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 15:45:46 +08:00
refs #497, improved URL and network utils
* utility functions * URL, allow to switch to https * Adjusted database writer
This commit is contained in:
committed by
Mathew Sutcliffe
parent
03f4aa6889
commit
7cb4c6a6c6
@@ -100,7 +100,6 @@ namespace BlackMisc
|
||||
|
||||
QString CUrl::getFullUrl() const
|
||||
{
|
||||
Q_ASSERT_X(!m_host.isEmpty(), Q_FUNC_INFO, "missing address");
|
||||
if (m_host.isEmpty()) { return ""; }
|
||||
|
||||
QString qn(m_host);
|
||||
@@ -138,6 +137,16 @@ namespace BlackMisc
|
||||
return url;
|
||||
}
|
||||
|
||||
CUrl CUrl::withSwitchedScheme(const QString &scheme, int port) const
|
||||
{
|
||||
if (getPort() == port && getScheme() == scheme) { return *this; }
|
||||
QUrl qurl(this->toQUrl());
|
||||
qurl.setPort(port);
|
||||
qurl.setScheme(scheme);
|
||||
CUrl url(qurl);
|
||||
return url;
|
||||
}
|
||||
|
||||
CUrl CUrl::withAppendedQuery(const QString &query) const
|
||||
{
|
||||
if (query.isEmpty()) { return *this; }
|
||||
|
||||
Reference in New Issue
Block a user