Improve function interface

`SettingsStorage` methods require `QString` so make `SettingValue` follow it.
`Path::operator+` can use `QStringView` to accept wider audience.
This commit is contained in:
Chocobo1 2022-03-23 23:56:47 +08:00
parent 11cfe38d1c
commit c6b772da11
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
33 changed files with 222 additions and 239 deletions

View file

@ -28,7 +28,7 @@
#include "proxyconfigurationmanager.h"
#define SETTINGS_KEY(name) ("Network/Proxy/" name)
#define SETTINGS_KEY(name) (u"Network/Proxy/" name)
bool Net::operator==(const ProxyConfiguration &left, const ProxyConfiguration &right)
{
@ -50,12 +50,12 @@ ProxyConfigurationManager *ProxyConfigurationManager::m_instance = nullptr;
ProxyConfigurationManager::ProxyConfigurationManager(QObject *parent)
: QObject {parent}
, m_storeProxyOnlyForTorrents {SETTINGS_KEY("OnlyForTorrents")}
, m_storeProxyType {SETTINGS_KEY("Type")}
, m_storeProxyIP {SETTINGS_KEY("IP")}
, m_storeProxyPort {SETTINGS_KEY("Port")}
, m_storeProxyUsername {SETTINGS_KEY("Username")}
, m_storeProxyPassword {SETTINGS_KEY("Password")}
, m_storeProxyOnlyForTorrents {SETTINGS_KEY(u"OnlyForTorrents"_qs)}
, m_storeProxyType {SETTINGS_KEY(u"Type"_qs)}
, m_storeProxyIP {SETTINGS_KEY(u"IP"_qs)}
, m_storeProxyPort {SETTINGS_KEY(u"Port"_qs)}
, m_storeProxyUsername {SETTINGS_KEY(u"Username"_qs)}
, m_storeProxyPassword {SETTINGS_KEY(u"Password"_qs)}
{
m_config.type = m_storeProxyType.get(ProxyType::None);
if ((m_config.type < ProxyType::None) || (m_config.type > ProxyType::SOCKS4))