mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-08 11:47:30 +08:00
Rename literal operator
Qt 6.4 introduced `QString operator""_s()` and the previous `""_qs` is deprecated since Qt 6.8.
This commit is contained in:
parent
f6b58f36e2
commit
e6d85a468b
@ -108,12 +108,12 @@ namespace
|
||||
{
|
||||
#define SETTINGS_KEY(name) u"Application/" name
|
||||
#define FILELOGGER_SETTINGS_KEY(name) (SETTINGS_KEY(u"FileLogger/") name)
|
||||
#define NOTIFICATIONS_SETTINGS_KEY(name) (SETTINGS_KEY(u"GUI/Notifications/"_qs) name)
|
||||
#define NOTIFICATIONS_SETTINGS_KEY(name) (SETTINGS_KEY(u"GUI/Notifications/"_s) name)
|
||||
|
||||
const QString LOG_FOLDER = u"logs"_qs;
|
||||
const QString LOG_FOLDER = u"logs"_s;
|
||||
const QChar PARAMS_SEPARATOR = u'|';
|
||||
|
||||
const Path DEFAULT_PORTABLE_MODE_PROFILE_DIR {u"profile"_qs};
|
||||
const Path DEFAULT_PORTABLE_MODE_PROFILE_DIR {u"profile"_s};
|
||||
|
||||
const int MIN_FILELOG_SIZE = 1024; // 1KiB
|
||||
const int MAX_FILELOG_SIZE = 1000 * 1024 * 1024; // 1000MiB
|
||||
@ -140,22 +140,22 @@ namespace
|
||||
result.append(u"@savePath=" + addTorrentParams.savePath.data());
|
||||
|
||||
if (addTorrentParams.addPaused.has_value())
|
||||
result.append(*addTorrentParams.addPaused ? u"@addPaused=1"_qs : u"@addPaused=0"_qs);
|
||||
result.append(*addTorrentParams.addPaused ? u"@addPaused=1"_s : u"@addPaused=0"_s);
|
||||
|
||||
if (addTorrentParams.skipChecking)
|
||||
result.append(u"@skipChecking"_qs);
|
||||
result.append(u"@skipChecking"_s);
|
||||
|
||||
if (!addTorrentParams.category.isEmpty())
|
||||
result.append(u"@category=" + addTorrentParams.category);
|
||||
|
||||
if (addTorrentParams.sequential)
|
||||
result.append(u"@sequential"_qs);
|
||||
result.append(u"@sequential"_s);
|
||||
|
||||
if (addTorrentParams.firstLastPiecePriority)
|
||||
result.append(u"@firstLastPiecePriority"_qs);
|
||||
result.append(u"@firstLastPiecePriority"_s);
|
||||
|
||||
if (params.skipDialog.has_value())
|
||||
result.append(*params.skipDialog ? u"@skipDialog=1"_qs : u"@skipDialog=0"_qs);
|
||||
result.append(*params.skipDialog ? u"@skipDialog=1"_s : u"@skipDialog=0"_s);
|
||||
|
||||
result += params.torrentSources;
|
||||
|
||||
@ -225,29 +225,29 @@ namespace
|
||||
Application::Application(int &argc, char **argv)
|
||||
: BaseApplication(argc, argv)
|
||||
, m_commandLineArgs(parseCommandLine(Application::arguments()))
|
||||
, m_storeFileLoggerEnabled(FILELOGGER_SETTINGS_KEY(u"Enabled"_qs))
|
||||
, m_storeFileLoggerBackup(FILELOGGER_SETTINGS_KEY(u"Backup"_qs))
|
||||
, m_storeFileLoggerDeleteOld(FILELOGGER_SETTINGS_KEY(u"DeleteOld"_qs))
|
||||
, m_storeFileLoggerMaxSize(FILELOGGER_SETTINGS_KEY(u"MaxSizeBytes"_qs))
|
||||
, m_storeFileLoggerAge(FILELOGGER_SETTINGS_KEY(u"Age"_qs))
|
||||
, m_storeFileLoggerAgeType(FILELOGGER_SETTINGS_KEY(u"AgeType"_qs))
|
||||
, m_storeFileLoggerPath(FILELOGGER_SETTINGS_KEY(u"Path"_qs))
|
||||
, m_storeMemoryWorkingSetLimit(SETTINGS_KEY(u"MemoryWorkingSetLimit"_qs))
|
||||
, m_storeFileLoggerEnabled(FILELOGGER_SETTINGS_KEY(u"Enabled"_s))
|
||||
, m_storeFileLoggerBackup(FILELOGGER_SETTINGS_KEY(u"Backup"_s))
|
||||
, m_storeFileLoggerDeleteOld(FILELOGGER_SETTINGS_KEY(u"DeleteOld"_s))
|
||||
, m_storeFileLoggerMaxSize(FILELOGGER_SETTINGS_KEY(u"MaxSizeBytes"_s))
|
||||
, m_storeFileLoggerAge(FILELOGGER_SETTINGS_KEY(u"Age"_s))
|
||||
, m_storeFileLoggerAgeType(FILELOGGER_SETTINGS_KEY(u"AgeType"_s))
|
||||
, m_storeFileLoggerPath(FILELOGGER_SETTINGS_KEY(u"Path"_s))
|
||||
, m_storeMemoryWorkingSetLimit(SETTINGS_KEY(u"MemoryWorkingSetLimit"_s))
|
||||
#ifdef Q_OS_WIN
|
||||
, m_processMemoryPriority(SETTINGS_KEY(u"ProcessMemoryPriority"_qs))
|
||||
, m_processMemoryPriority(SETTINGS_KEY(u"ProcessMemoryPriority"_s))
|
||||
#endif
|
||||
#ifndef DISABLE_GUI
|
||||
, m_startUpWindowState(u"GUI/StartUpWindowState"_qs)
|
||||
, m_storeNotificationTorrentAdded(NOTIFICATIONS_SETTINGS_KEY(u"TorrentAdded"_qs))
|
||||
, m_startUpWindowState(u"GUI/StartUpWindowState"_s)
|
||||
, m_storeNotificationTorrentAdded(NOTIFICATIONS_SETTINGS_KEY(u"TorrentAdded"_s))
|
||||
#endif
|
||||
{
|
||||
qRegisterMetaType<Log::Msg>("Log::Msg");
|
||||
qRegisterMetaType<Log::Peer>("Log::Peer");
|
||||
|
||||
setApplicationName(u"qBittorrent"_qs);
|
||||
setOrganizationDomain(u"qbittorrent.org"_qs);
|
||||
setApplicationName(u"qBittorrent"_s);
|
||||
setOrganizationDomain(u"qbittorrent.org"_s);
|
||||
#if !defined(DISABLE_GUI)
|
||||
setDesktopFileName(u"org.qbittorrent.qBittorrent"_qs);
|
||||
setDesktopFileName(u"org.qbittorrent.qBittorrent"_s);
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
setAttribute(Qt::AA_UseHighDpiPixmaps, true); // opt-in to the high DPI pixmap support
|
||||
#endif
|
||||
@ -275,7 +275,7 @@ Application::Application(int &argc, char **argv)
|
||||
if (!firstTimeUser)
|
||||
{
|
||||
if (!upgrade())
|
||||
throw RuntimeError(u"Failed migration of old settings"_qs); // Not translatable. Translation isn't configured yet.
|
||||
throw RuntimeError(u"Failed migration of old settings"_s); // Not translatable. Translation isn't configured yet.
|
||||
handleChangedDefaults(DefaultPreferencesMode::Legacy);
|
||||
}
|
||||
else
|
||||
@ -296,7 +296,7 @@ Application::Application(int &argc, char **argv)
|
||||
{
|
||||
LogMsg(tr("Running in portable mode. Auto detected profile folder at: %1").arg(profileDir.toString()));
|
||||
if (m_commandLineArgs.relativeFastresumePaths)
|
||||
LogMsg(tr("Redundant command line flag detected: \"%1\". Portable mode implies relative fastresume.").arg(u"--relative-fastresume"_qs), Log::WARNING); // to avoid translating the `--relative-fastresume` string
|
||||
LogMsg(tr("Redundant command line flag detected: \"%1\". Portable mode implies relative fastresume.").arg(u"--relative-fastresume"_s), Log::WARNING); // to avoid translating the `--relative-fastresume` string
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -311,7 +311,7 @@ Application::Application(int &argc, char **argv)
|
||||
|
||||
if (m_commandLineArgs.torrentingPort > 0) // it will be -1 when user did not set any value
|
||||
{
|
||||
SettingValue<int> port {u"BitTorrent/Session/Port"_qs};
|
||||
SettingValue<int> port {u"BitTorrent/Session/Port"_s};
|
||||
port = m_commandLineArgs.torrentingPort;
|
||||
}
|
||||
}
|
||||
@ -523,13 +523,13 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
|
||||
str.replace(i, 2, torrent->contentPath().toString());
|
||||
break;
|
||||
case u'G':
|
||||
str.replace(i, 2, torrent->tags().join(u","_qs));
|
||||
str.replace(i, 2, torrent->tags().join(u","_s));
|
||||
break;
|
||||
case u'I':
|
||||
str.replace(i, 2, (torrent->infoHash().v1().isValid() ? torrent->infoHash().v1().toString() : u"-"_qs));
|
||||
str.replace(i, 2, (torrent->infoHash().v1().isValid() ? torrent->infoHash().v1().toString() : u"-"_s));
|
||||
break;
|
||||
case u'J':
|
||||
str.replace(i, 2, (torrent->infoHash().v2().isValid() ? torrent->infoHash().v2().toString() : u"-"_qs));
|
||||
str.replace(i, 2, (torrent->infoHash().v2().isValid() ? torrent->infoHash().v2().toString() : u"-"_s));
|
||||
break;
|
||||
case u'K':
|
||||
str.replace(i, 2, torrent->id().toString());
|
||||
@ -792,7 +792,7 @@ try
|
||||
#ifndef Q_OS_MACOS
|
||||
auto *desktopIntegrationMenu = new QMenu;
|
||||
auto *actionExit = new QAction(tr("E&xit"), desktopIntegrationMenu);
|
||||
actionExit->setIcon(UIThemeManager::instance()->getIcon(u"application-exit"_qs));
|
||||
actionExit->setIcon(UIThemeManager::instance()->getIcon(u"application-exit"_s));
|
||||
actionExit->setMenuRole(QAction::QuitRole);
|
||||
actionExit->setShortcut(Qt::CTRL | Qt::Key_Q);
|
||||
connect(actionExit, &QAction::triggered, this, []
|
||||
@ -904,16 +904,16 @@ try
|
||||
|
||||
const Preferences *pref = Preferences::instance();
|
||||
|
||||
const auto scheme = pref->isWebUiHttpsEnabled() ? u"https"_qs : u"http"_qs;
|
||||
const auto url = u"%1://localhost:%2\n"_qs.arg(scheme, QString::number(pref->getWebUiPort()));
|
||||
const QString mesg = u"\n******** %1 ********\n"_qs.arg(tr("Information"))
|
||||
const auto scheme = pref->isWebUiHttpsEnabled() ? u"https"_s : u"http"_s;
|
||||
const auto url = u"%1://localhost:%2\n"_s.arg(scheme, QString::number(pref->getWebUiPort()));
|
||||
const QString mesg = u"\n******** %1 ********\n"_s.arg(tr("Information"))
|
||||
+ tr("To control qBittorrent, access the WebUI at: %1").arg(url);
|
||||
printf("%s\n", qUtf8Printable(mesg));
|
||||
|
||||
if (pref->getWebUIPassword() == QByteArrayLiteral("ARQ77eY1NUZaQsuDHbIMCA==:0WMRkYTUWVT9wVvdDtHAjU9b3b7uB8NR1Gur2hmQCvCDpm39Q+PsJRJPaCU51dEiz+dTzh8qbPsL8WkFljQYFQ=="))
|
||||
{
|
||||
const QString warning = tr("The Web UI administrator username is: %1").arg(pref->getWebUiUsername()) + u'\n'
|
||||
+ tr("The Web UI administrator password has not been changed from the default: %1").arg(u"adminadmin"_qs) + u'\n'
|
||||
+ tr("The Web UI administrator password has not been changed from the default: %1").arg(u"adminadmin"_s) + u'\n'
|
||||
+ tr("This is a security risk, please change your password in program preferences.") + u'\n';
|
||||
printf("%s", qUtf8Printable(warning));
|
||||
}
|
||||
@ -1165,12 +1165,12 @@ void Application::setProcessMemoryPriority(const MemoryPriority priority)
|
||||
void Application::applyMemoryPriority() const
|
||||
{
|
||||
using SETPROCESSINFORMATION = BOOL (WINAPI *)(HANDLE, PROCESS_INFORMATION_CLASS, LPVOID, DWORD);
|
||||
const auto setProcessInformation = Utils::Misc::loadWinAPI<SETPROCESSINFORMATION>(u"Kernel32.dll"_qs, "SetProcessInformation");
|
||||
const auto setProcessInformation = Utils::Misc::loadWinAPI<SETPROCESSINFORMATION>(u"Kernel32.dll"_s, "SetProcessInformation");
|
||||
if (!setProcessInformation) // only available on Windows >= 8
|
||||
return;
|
||||
|
||||
using SETTHREADINFORMATION = BOOL (WINAPI *)(HANDLE, THREAD_INFORMATION_CLASS, LPVOID, DWORD);
|
||||
const auto setThreadInformation = Utils::Misc::loadWinAPI<SETTHREADINFORMATION>(u"Kernel32.dll"_qs, "SetThreadInformation");
|
||||
const auto setThreadInformation = Utils::Misc::loadWinAPI<SETTHREADINFORMATION>(u"Kernel32.dll"_s, "SetThreadInformation");
|
||||
if (!setThreadInformation) // only available on Windows >= 8
|
||||
return;
|
||||
|
||||
|
@ -152,16 +152,16 @@ namespace
|
||||
{
|
||||
QStringList parts = arg.split(u'=');
|
||||
if (parts.size() == 2)
|
||||
return Utils::String::unquote(parts[1], u"'\""_qs);
|
||||
return Utils::String::unquote(parts[1], u"'\""_s);
|
||||
throw CommandLineParameterError(QCoreApplication::translate("CMD Options", "Parameter '%1' must follow syntax '%1=%2'",
|
||||
"e.g. Parameter '--webui-port' must follow syntax '--webui-port=value'")
|
||||
.arg(fullParameter(), u"<value>"_qs));
|
||||
.arg(fullParameter(), u"<value>"_s));
|
||||
}
|
||||
|
||||
QString value(const QProcessEnvironment &env, const QString &defaultValue = {}) const
|
||||
{
|
||||
QString val = env.value(envVarName());
|
||||
return val.isEmpty() ? defaultValue : Utils::String::unquote(val, u"'\""_qs);
|
||||
return val.isEmpty() ? defaultValue : Utils::String::unquote(val, u"'\""_s);
|
||||
}
|
||||
|
||||
QString usage(const QString &valueName) const
|
||||
@ -206,7 +206,7 @@ namespace
|
||||
{
|
||||
throw CommandLineParameterError(QCoreApplication::translate("CMD Options", "Parameter '%1' must follow syntax '%1=%2'",
|
||||
"e.g. Parameter '--webui-port' must follow syntax '--webui-port=<value>'")
|
||||
.arg(fullParameter(), u"<integer value>"_qs));
|
||||
.arg(fullParameter(), u"<integer value>"_s));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@ -279,12 +279,12 @@ namespace
|
||||
throw CommandLineParameterError(QCoreApplication::translate("CMD Options", "Parameter '%1' must follow syntax '%1=%2'",
|
||||
"e.g. Parameter '--add-paused' must follow syntax "
|
||||
"'--add-paused=<true|false>'")
|
||||
.arg(fullParameter(), u"<true|false>"_qs));
|
||||
.arg(fullParameter(), u"<true|false>"_s));
|
||||
}
|
||||
|
||||
std::optional<bool> value(const QProcessEnvironment &env) const
|
||||
{
|
||||
const QString val = env.value(envVarName(), u"-1"_qs);
|
||||
const QString val = env.value(envVarName(), u"-1"_s);
|
||||
|
||||
if (val.isEmpty())
|
||||
{
|
||||
@ -304,7 +304,7 @@ namespace
|
||||
}
|
||||
|
||||
qDebug() << QCoreApplication::translate("CMD Options", "Expected %1 in environment variable '%2', but got '%3'")
|
||||
.arg(u"true|false"_qs, envVarName(), val);
|
||||
.arg(u"true|false"_s, envVarName(), val);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@ -390,7 +390,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
|
||||
result.webUiPort = WEBUI_PORT_OPTION.value(arg);
|
||||
if ((result.webUiPort < 1) || (result.webUiPort > 65535))
|
||||
throw CommandLineParameterError(QCoreApplication::translate("CMD Options", "%1 must specify a valid port (1 to 65535).")
|
||||
.arg(u"--webui-port"_qs));
|
||||
.arg(u"--webui-port"_s));
|
||||
}
|
||||
else if (arg == TORRENTING_PORT_OPTION)
|
||||
{
|
||||
@ -398,7 +398,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
|
||||
if ((result.torrentingPort < 1) || (result.torrentingPort > 65535))
|
||||
{
|
||||
throw CommandLineParameterError(QCoreApplication::translate("CMD Options", "%1 must specify a valid port (1 to 65535).")
|
||||
.arg(u"--torrenting-port"_qs));
|
||||
.arg(u"--torrenting-port"_s));
|
||||
}
|
||||
}
|
||||
#ifndef DISABLE_GUI
|
||||
|
@ -78,7 +78,7 @@ void FileLogger::changePath(const Path &newPath)
|
||||
|
||||
closeLogFile();
|
||||
|
||||
m_path = newPath / Path(u"qbittorrent.log"_qs);
|
||||
m_path = newPath / Path(u"qbittorrent.log"_s);
|
||||
m_logFile.setFileName(m_path.data());
|
||||
|
||||
Utils::Fs::mkpath(newPath);
|
||||
@ -89,7 +89,7 @@ void FileLogger::deleteOld(const int age, const FileLogAgeType ageType)
|
||||
{
|
||||
const QDateTime date = QDateTime::currentDateTime();
|
||||
const QDir dir {m_path.parentPath().data()};
|
||||
const QFileInfoList fileList = dir.entryInfoList(QStringList(u"qbittorrent.log.bak*"_qs)
|
||||
const QFileInfoList fileList = dir.entryInfoList(QStringList(u"qbittorrent.log.bak*"_s)
|
||||
, (QDir::Files | QDir::Writable), (QDir::Time | QDir::Reversed));
|
||||
|
||||
for (const QFileInfo &file : fileList)
|
||||
|
@ -127,7 +127,7 @@ int main(int argc, char *argv[])
|
||||
if (envValue.isEmpty())
|
||||
qputenv(envName, Application::applicationDirPath().toLocal8Bit());
|
||||
else
|
||||
qputenv(envName, u"%1;%2"_qs.arg(envValue, Application::applicationDirPath()).toLocal8Bit());
|
||||
qputenv(envName, u"%1;%2"_s.arg(envValue, Application::applicationDirPath()).toLocal8Bit());
|
||||
#endif
|
||||
|
||||
const QBtCommandLineParameters params = app->commandLineArgs();
|
||||
@ -146,7 +146,7 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
throw CommandLineParameterError(QCoreApplication::translate("Main", "%1 must be the single command line parameter.")
|
||||
.arg(u"-v (or --version)"_qs));
|
||||
.arg(u"-v (or --version)"_s));
|
||||
}
|
||||
#endif
|
||||
if (params.showHelp)
|
||||
@ -157,7 +157,7 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
throw CommandLineParameterError(QCoreApplication::translate("Main", "%1 must be the single command line parameter.")
|
||||
.arg(u"-h (or --help)"_qs));
|
||||
.arg(u"-h (or --help)"_s));
|
||||
}
|
||||
|
||||
const bool firstTimeUser = !Preferences::instance()->getAcceptedLegal();
|
||||
@ -189,7 +189,7 @@ int main(int argc, char *argv[])
|
||||
if (params.shouldDaemonize)
|
||||
{
|
||||
throw CommandLineParameterError(QCoreApplication::translate("Main", "You cannot use %1: qBittorrent is already running for this user.")
|
||||
.arg(u"-d (or --daemon)"_qs));
|
||||
.arg(u"-d (or --daemon)"_s));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -276,11 +276,11 @@ int main(int argc, char *argv[])
|
||||
#if !defined(DISABLE_GUI)
|
||||
void showSplashScreen()
|
||||
{
|
||||
QPixmap splashImg(u":/icons/splash.png"_qs);
|
||||
QPixmap splashImg(u":/icons/splash.png"_s);
|
||||
QPainter painter(&splashImg);
|
||||
const auto version = QStringLiteral(QBT_VERSION);
|
||||
painter.setPen(QPen(Qt::white));
|
||||
painter.setFont(QFont(u"Arial"_qs, 22, QFont::Black));
|
||||
painter.setFont(QFont(u"Arial"_s, 22, QFont::Black));
|
||||
painter.drawText(224 - painter.fontMetrics().horizontalAdvance(version), 270, version);
|
||||
QSplashScreen *splash = new QSplashScreen(splashImg);
|
||||
splash->show();
|
||||
@ -317,10 +317,10 @@ bool userAgreesWithLegalNotice()
|
||||
Q_ASSERT(!pref->getAcceptedLegal());
|
||||
|
||||
#ifdef DISABLE_GUI
|
||||
const QString eula = u"\n*** %1 ***\n"_qs.arg(QCoreApplication::translate("Main", "Legal Notice"))
|
||||
const QString eula = u"\n*** %1 ***\n"_s.arg(QCoreApplication::translate("Main", "Legal Notice"))
|
||||
+ QCoreApplication::translate("Main", "qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.") + u"\n\n"
|
||||
+ QCoreApplication::translate("Main", "No further notices will be issued.") + u"\n\n"
|
||||
+ QCoreApplication::translate("Main", "Press %1 key to accept and continue...").arg(u"'y'"_qs) + u'\n';
|
||||
+ QCoreApplication::translate("Main", "Press %1 key to accept and continue...").arg(u"'y'"_s) + u'\n';
|
||||
printf("%s", qUtf8Printable(eula));
|
||||
|
||||
const char ret = getchar(); // Read pressed key
|
||||
|
@ -46,7 +46,7 @@
|
||||
namespace
|
||||
{
|
||||
const int MIGRATION_VERSION = 6;
|
||||
const QString MIGRATION_VERSION_KEY = u"Meta/MigrationVersion"_qs;
|
||||
const QString MIGRATION_VERSION_KEY = u"Meta/MigrationVersion"_s;
|
||||
|
||||
void exportWebUIHttpsFiles()
|
||||
{
|
||||
@ -75,18 +75,18 @@ namespace
|
||||
};
|
||||
|
||||
const Path configPath = specialFolderLocation(SpecialFolder::Config);
|
||||
migrate(u"Preferences/WebUI/HTTPS/Certificate"_qs
|
||||
, u"Preferences/WebUI/HTTPS/CertificatePath"_qs
|
||||
, (configPath / Path(u"WebUICertificate.crt"_qs)));
|
||||
migrate(u"Preferences/WebUI/HTTPS/Key"_qs
|
||||
, u"Preferences/WebUI/HTTPS/KeyPath"_qs
|
||||
, (configPath / Path(u"WebUIPrivateKey.pem"_qs)));
|
||||
migrate(u"Preferences/WebUI/HTTPS/Certificate"_s
|
||||
, u"Preferences/WebUI/HTTPS/CertificatePath"_s
|
||||
, (configPath / Path(u"WebUICertificate.crt"_s)));
|
||||
migrate(u"Preferences/WebUI/HTTPS/Key"_s
|
||||
, u"Preferences/WebUI/HTTPS/KeyPath"_s
|
||||
, (configPath / Path(u"WebUIPrivateKey.pem"_s)));
|
||||
}
|
||||
|
||||
void upgradeTorrentContentLayout()
|
||||
{
|
||||
const QString oldKey = u"BitTorrent/Session/CreateTorrentSubfolder"_qs;
|
||||
const QString newKey = u"BitTorrent/Session/TorrentContentLayout"_qs;
|
||||
const QString oldKey = u"BitTorrent/Session/CreateTorrentSubfolder"_s;
|
||||
const QString newKey = u"BitTorrent/Session/TorrentContentLayout"_s;
|
||||
|
||||
SettingsStorage *settingsStorage {SettingsStorage::instance()};
|
||||
const auto oldData {settingsStorage->loadValue<QVariant>(oldKey)};
|
||||
@ -105,8 +105,8 @@ namespace
|
||||
|
||||
void upgradeListenPortSettings()
|
||||
{
|
||||
const auto oldKey = u"BitTorrent/Session/UseRandomPort"_qs;
|
||||
const auto newKey = u"Preferences/Connection/PortRangeMin"_qs;
|
||||
const auto oldKey = u"BitTorrent/Session/UseRandomPort"_s;
|
||||
const auto newKey = u"Preferences/Connection/PortRangeMin"_s;
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
|
||||
if (settingsStorage->hasKey(oldKey))
|
||||
@ -121,7 +121,7 @@ namespace
|
||||
void upgradeSchedulerDaysSettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = u"Preferences/Scheduler/days"_qs;
|
||||
const auto key = u"Preferences/Scheduler/days"_s;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@ -173,7 +173,7 @@ namespace
|
||||
void upgradeDNSServiceSettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = u"Preferences/DynDNS/Service"_qs;
|
||||
const auto key = u"Preferences/DynDNS/Service"_s;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@ -204,7 +204,7 @@ namespace
|
||||
void upgradeTrayIconStyleSettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = u"Preferences/Advanced/TrayIconStyle"_qs;
|
||||
const auto key = u"Preferences/Advanced/TrayIconStyle"_s;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@ -242,80 +242,80 @@ namespace
|
||||
|
||||
const KeyMapping mappings[] =
|
||||
{
|
||||
{u"AddNewTorrentDialog/Enabled"_qs, u"Preferences/Downloads/NewAdditionDialog"_qs},
|
||||
{u"AddNewTorrentDialog/Expanded"_qs, u"AddNewTorrentDialog/expanded"_qs},
|
||||
{u"AddNewTorrentDialog/Position"_qs, u"AddNewTorrentDialog/y"_qs},
|
||||
{u"AddNewTorrentDialog/SavePathHistory"_qs, u"TorrentAdditionDlg/save_path_history"_qs},
|
||||
{u"AddNewTorrentDialog/TopLevel"_qs, u"Preferences/Downloads/NewAdditionDialogFront"_qs},
|
||||
{u"AddNewTorrentDialog/TreeHeaderState"_qs, u"AddNewTorrentDialog/qt5/treeHeaderState"_qs},
|
||||
{u"AddNewTorrentDialog/Width"_qs, u"AddNewTorrentDialog/width"_qs},
|
||||
{u"BitTorrent/Session/AddExtensionToIncompleteFiles"_qs, u"Preferences/Downloads/UseIncompleteExtension"_qs},
|
||||
{u"BitTorrent/Session/AdditionalTrackers"_qs, u"Preferences/Bittorrent/TrackersList"_qs},
|
||||
{u"BitTorrent/Session/AddTorrentPaused"_qs, u"Preferences/Downloads/StartInPause"_qs},
|
||||
{u"BitTorrent/Session/AddTrackersEnabled"_qs, u"Preferences/Bittorrent/AddTrackers"_qs},
|
||||
{u"BitTorrent/Session/AlternativeGlobalDLSpeedLimit"_qs, u"Preferences/Connection/GlobalDLLimitAlt"_qs},
|
||||
{u"BitTorrent/Session/AlternativeGlobalUPSpeedLimit"_qs, u"Preferences/Connection/GlobalUPLimitAlt"_qs},
|
||||
{u"BitTorrent/Session/AnnounceIP"_qs, u"Preferences/Connection/InetAddress"_qs},
|
||||
{u"BitTorrent/Session/AnnounceToAllTrackers"_qs, u"Preferences/Advanced/AnnounceToAllTrackers"_qs},
|
||||
{u"BitTorrent/Session/AnonymousModeEnabled"_qs, u"Preferences/Advanced/AnonymousMode"_qs},
|
||||
{u"BitTorrent/Session/BandwidthSchedulerEnabled"_qs, u"Preferences/Scheduler/Enabled"_qs},
|
||||
{u"BitTorrent/Session/DefaultSavePath"_qs, u"Preferences/Downloads/SavePath"_qs},
|
||||
{u"BitTorrent/Session/DHTEnabled"_qs, u"Preferences/Bittorrent/DHT"_qs},
|
||||
{u"BitTorrent/Session/DiskCacheSize"_qs, u"Preferences/Downloads/DiskWriteCacheSize"_qs},
|
||||
{u"BitTorrent/Session/DiskCacheTTL"_qs, u"Preferences/Downloads/DiskWriteCacheTTL"_qs},
|
||||
{u"BitTorrent/Session/Encryption"_qs, u"Preferences/Bittorrent/Encryption"_qs},
|
||||
{u"BitTorrent/Session/FinishedTorrentExportDirectory"_qs, u"Preferences/Downloads/FinishedTorrentExportDir"_qs},
|
||||
{u"BitTorrent/Session/ForceProxy"_qs, u"Preferences/Connection/ProxyForce"_qs},
|
||||
{u"BitTorrent/Session/GlobalDLSpeedLimit"_qs, u"Preferences/Connection/GlobalDLLimit"_qs},
|
||||
{u"BitTorrent/Session/GlobalMaxRatio"_qs, u"Preferences/Bittorrent/MaxRatio"_qs},
|
||||
{u"BitTorrent/Session/GlobalUPSpeedLimit"_qs, u"Preferences/Connection/GlobalUPLimit"_qs},
|
||||
{u"BitTorrent/Session/IgnoreLimitsOnLAN"_qs, u"Preferences/Advanced/IgnoreLimitsLAN"_qs},
|
||||
{u"BitTorrent/Session/IgnoreSlowTorrentsForQueueing"_qs, u"Preferences/Queueing/IgnoreSlowTorrents"_qs},
|
||||
{u"BitTorrent/Session/IncludeOverheadInLimits"_qs, u"Preferences/Advanced/IncludeOverhead"_qs},
|
||||
{u"BitTorrent/Session/Interface"_qs, u"Preferences/Connection/Interface"_qs},
|
||||
{u"BitTorrent/Session/InterfaceAddress"_qs, u"Preferences/Connection/InterfaceAddress"_qs},
|
||||
{u"BitTorrent/Session/InterfaceName"_qs, u"Preferences/Connection/InterfaceName"_qs},
|
||||
{u"BitTorrent/Session/IPFilter"_qs, u"Preferences/IPFilter/File"_qs},
|
||||
{u"BitTorrent/Session/IPFilteringEnabled"_qs, u"Preferences/IPFilter/Enabled"_qs},
|
||||
{u"BitTorrent/Session/LSDEnabled"_qs, u"Preferences/Bittorrent/LSD"_qs},
|
||||
{u"BitTorrent/Session/MaxActiveDownloads"_qs, u"Preferences/Queueing/MaxActiveDownloads"_qs},
|
||||
{u"BitTorrent/Session/MaxActiveTorrents"_qs, u"Preferences/Queueing/MaxActiveTorrents"_qs},
|
||||
{u"BitTorrent/Session/MaxActiveUploads"_qs, u"Preferences/Queueing/MaxActiveUploads"_qs},
|
||||
{u"BitTorrent/Session/MaxConnections"_qs, u"Preferences/Bittorrent/MaxConnecs"_qs},
|
||||
{u"BitTorrent/Session/MaxConnectionsPerTorrent"_qs, u"Preferences/Bittorrent/MaxConnecsPerTorrent"_qs},
|
||||
{u"BitTorrent/Session/MaxHalfOpenConnections"_qs, u"Preferences/Connection/MaxHalfOpenConnec"_qs},
|
||||
{u"BitTorrent/Session/MaxRatioAction"_qs, u"Preferences/Bittorrent/MaxRatioAction"_qs},
|
||||
{u"BitTorrent/Session/MaxUploads"_qs, u"Preferences/Bittorrent/MaxUploads"_qs},
|
||||
{u"BitTorrent/Session/MaxUploadsPerTorrent"_qs, u"Preferences/Bittorrent/MaxUploadsPerTorrent"_qs},
|
||||
{u"BitTorrent/Session/OutgoingPortsMax"_qs, u"Preferences/Advanced/OutgoingPortsMax"_qs},
|
||||
{u"BitTorrent/Session/OutgoingPortsMin"_qs, u"Preferences/Advanced/OutgoingPortsMin"_qs},
|
||||
{u"BitTorrent/Session/PeXEnabled"_qs, u"Preferences/Bittorrent/PeX"_qs},
|
||||
{u"BitTorrent/Session/Port"_qs, u"Preferences/Connection/PortRangeMin"_qs},
|
||||
{u"BitTorrent/Session/Preallocation"_qs, u"Preferences/Downloads/PreAllocation"_qs},
|
||||
{u"BitTorrent/Session/ProxyPeerConnections"_qs, u"Preferences/Connection/ProxyPeerConnections"_qs},
|
||||
{u"BitTorrent/Session/QueueingSystemEnabled"_qs, u"Preferences/Queueing/QueueingEnabled"_qs},
|
||||
{u"BitTorrent/Session/RefreshInterval"_qs, u"Preferences/General/RefreshInterval"_qs},
|
||||
{u"BitTorrent/Session/SaveResumeDataInterval"_qs, u"Preferences/Downloads/SaveResumeDataInterval"_qs},
|
||||
{u"BitTorrent/Session/SuperSeedingEnabled"_qs, u"Preferences/Advanced/SuperSeeding"_qs},
|
||||
{u"BitTorrent/Session/TempPath"_qs, u"Preferences/Downloads/TempPath"_qs},
|
||||
{u"BitTorrent/Session/TempPathEnabled"_qs, u"Preferences/Downloads/TempPathEnabled"_qs},
|
||||
{u"BitTorrent/Session/TorrentExportDirectory"_qs, u"Preferences/Downloads/TorrentExportDir"_qs},
|
||||
{u"BitTorrent/Session/TrackerFilteringEnabled"_qs, u"Preferences/IPFilter/FilterTracker"_qs},
|
||||
{u"BitTorrent/Session/UseAlternativeGlobalSpeedLimit"_qs, u"Preferences/Connection/alt_speeds_on"_qs},
|
||||
{u"BitTorrent/Session/UseOSCache"_qs, u"Preferences/Advanced/osCache"_qs},
|
||||
{u"BitTorrent/Session/UseRandomPort"_qs, u"Preferences/General/UseRandomPort"_qs},
|
||||
{u"BitTorrent/Session/uTPEnabled"_qs, u"Preferences/Bittorrent/uTP"_qs},
|
||||
{u"BitTorrent/Session/uTPRateLimited"_qs, u"Preferences/Bittorrent/uTP_rate_limited"_qs},
|
||||
{u"BitTorrent/TrackerEnabled"_qs, u"Preferences/Advanced/trackerEnabled"_qs},
|
||||
{u"Network/PortForwardingEnabled"_qs, u"Preferences/Connection/UPnP"_qs},
|
||||
{u"Network/Proxy/Authentication"_qs, u"Preferences/Connection/Proxy/Authentication"_qs},
|
||||
{u"Network/Proxy/IP"_qs, u"Preferences/Connection/Proxy/IP"_qs},
|
||||
{u"Network/Proxy/OnlyForTorrents"_qs, u"Preferences/Connection/ProxyOnlyForTorrents"_qs},
|
||||
{u"Network/Proxy/Password"_qs, u"Preferences/Connection/Proxy/Password"_qs},
|
||||
{u"Network/Proxy/Port"_qs, u"Preferences/Connection/Proxy/Port"_qs},
|
||||
{u"Network/Proxy/Type"_qs, u"Preferences/Connection/ProxyType"_qs},
|
||||
{u"Network/Proxy/Username"_qs, u"Preferences/Connection/Proxy/Username"_qs},
|
||||
{u"State/BannedIPs"_qs, u"Preferences/IPFilter/BannedIPs"_qs}
|
||||
{u"AddNewTorrentDialog/Enabled"_s, u"Preferences/Downloads/NewAdditionDialog"_s},
|
||||
{u"AddNewTorrentDialog/Expanded"_s, u"AddNewTorrentDialog/expanded"_s},
|
||||
{u"AddNewTorrentDialog/Position"_s, u"AddNewTorrentDialog/y"_s},
|
||||
{u"AddNewTorrentDialog/SavePathHistory"_s, u"TorrentAdditionDlg/save_path_history"_s},
|
||||
{u"AddNewTorrentDialog/TopLevel"_s, u"Preferences/Downloads/NewAdditionDialogFront"_s},
|
||||
{u"AddNewTorrentDialog/TreeHeaderState"_s, u"AddNewTorrentDialog/qt5/treeHeaderState"_s},
|
||||
{u"AddNewTorrentDialog/Width"_s, u"AddNewTorrentDialog/width"_s},
|
||||
{u"BitTorrent/Session/AddExtensionToIncompleteFiles"_s, u"Preferences/Downloads/UseIncompleteExtension"_s},
|
||||
{u"BitTorrent/Session/AdditionalTrackers"_s, u"Preferences/Bittorrent/TrackersList"_s},
|
||||
{u"BitTorrent/Session/AddTorrentPaused"_s, u"Preferences/Downloads/StartInPause"_s},
|
||||
{u"BitTorrent/Session/AddTrackersEnabled"_s, u"Preferences/Bittorrent/AddTrackers"_s},
|
||||
{u"BitTorrent/Session/AlternativeGlobalDLSpeedLimit"_s, u"Preferences/Connection/GlobalDLLimitAlt"_s},
|
||||
{u"BitTorrent/Session/AlternativeGlobalUPSpeedLimit"_s, u"Preferences/Connection/GlobalUPLimitAlt"_s},
|
||||
{u"BitTorrent/Session/AnnounceIP"_s, u"Preferences/Connection/InetAddress"_s},
|
||||
{u"BitTorrent/Session/AnnounceToAllTrackers"_s, u"Preferences/Advanced/AnnounceToAllTrackers"_s},
|
||||
{u"BitTorrent/Session/AnonymousModeEnabled"_s, u"Preferences/Advanced/AnonymousMode"_s},
|
||||
{u"BitTorrent/Session/BandwidthSchedulerEnabled"_s, u"Preferences/Scheduler/Enabled"_s},
|
||||
{u"BitTorrent/Session/DefaultSavePath"_s, u"Preferences/Downloads/SavePath"_s},
|
||||
{u"BitTorrent/Session/DHTEnabled"_s, u"Preferences/Bittorrent/DHT"_s},
|
||||
{u"BitTorrent/Session/DiskCacheSize"_s, u"Preferences/Downloads/DiskWriteCacheSize"_s},
|
||||
{u"BitTorrent/Session/DiskCacheTTL"_s, u"Preferences/Downloads/DiskWriteCacheTTL"_s},
|
||||
{u"BitTorrent/Session/Encryption"_s, u"Preferences/Bittorrent/Encryption"_s},
|
||||
{u"BitTorrent/Session/FinishedTorrentExportDirectory"_s, u"Preferences/Downloads/FinishedTorrentExportDir"_s},
|
||||
{u"BitTorrent/Session/ForceProxy"_s, u"Preferences/Connection/ProxyForce"_s},
|
||||
{u"BitTorrent/Session/GlobalDLSpeedLimit"_s, u"Preferences/Connection/GlobalDLLimit"_s},
|
||||
{u"BitTorrent/Session/GlobalMaxRatio"_s, u"Preferences/Bittorrent/MaxRatio"_s},
|
||||
{u"BitTorrent/Session/GlobalUPSpeedLimit"_s, u"Preferences/Connection/GlobalUPLimit"_s},
|
||||
{u"BitTorrent/Session/IgnoreLimitsOnLAN"_s, u"Preferences/Advanced/IgnoreLimitsLAN"_s},
|
||||
{u"BitTorrent/Session/IgnoreSlowTorrentsForQueueing"_s, u"Preferences/Queueing/IgnoreSlowTorrents"_s},
|
||||
{u"BitTorrent/Session/IncludeOverheadInLimits"_s, u"Preferences/Advanced/IncludeOverhead"_s},
|
||||
{u"BitTorrent/Session/Interface"_s, u"Preferences/Connection/Interface"_s},
|
||||
{u"BitTorrent/Session/InterfaceAddress"_s, u"Preferences/Connection/InterfaceAddress"_s},
|
||||
{u"BitTorrent/Session/InterfaceName"_s, u"Preferences/Connection/InterfaceName"_s},
|
||||
{u"BitTorrent/Session/IPFilter"_s, u"Preferences/IPFilter/File"_s},
|
||||
{u"BitTorrent/Session/IPFilteringEnabled"_s, u"Preferences/IPFilter/Enabled"_s},
|
||||
{u"BitTorrent/Session/LSDEnabled"_s, u"Preferences/Bittorrent/LSD"_s},
|
||||
{u"BitTorrent/Session/MaxActiveDownloads"_s, u"Preferences/Queueing/MaxActiveDownloads"_s},
|
||||
{u"BitTorrent/Session/MaxActiveTorrents"_s, u"Preferences/Queueing/MaxActiveTorrents"_s},
|
||||
{u"BitTorrent/Session/MaxActiveUploads"_s, u"Preferences/Queueing/MaxActiveUploads"_s},
|
||||
{u"BitTorrent/Session/MaxConnections"_s, u"Preferences/Bittorrent/MaxConnecs"_s},
|
||||
{u"BitTorrent/Session/MaxConnectionsPerTorrent"_s, u"Preferences/Bittorrent/MaxConnecsPerTorrent"_s},
|
||||
{u"BitTorrent/Session/MaxHalfOpenConnections"_s, u"Preferences/Connection/MaxHalfOpenConnec"_s},
|
||||
{u"BitTorrent/Session/MaxRatioAction"_s, u"Preferences/Bittorrent/MaxRatioAction"_s},
|
||||
{u"BitTorrent/Session/MaxUploads"_s, u"Preferences/Bittorrent/MaxUploads"_s},
|
||||
{u"BitTorrent/Session/MaxUploadsPerTorrent"_s, u"Preferences/Bittorrent/MaxUploadsPerTorrent"_s},
|
||||
{u"BitTorrent/Session/OutgoingPortsMax"_s, u"Preferences/Advanced/OutgoingPortsMax"_s},
|
||||
{u"BitTorrent/Session/OutgoingPortsMin"_s, u"Preferences/Advanced/OutgoingPortsMin"_s},
|
||||
{u"BitTorrent/Session/PeXEnabled"_s, u"Preferences/Bittorrent/PeX"_s},
|
||||
{u"BitTorrent/Session/Port"_s, u"Preferences/Connection/PortRangeMin"_s},
|
||||
{u"BitTorrent/Session/Preallocation"_s, u"Preferences/Downloads/PreAllocation"_s},
|
||||
{u"BitTorrent/Session/ProxyPeerConnections"_s, u"Preferences/Connection/ProxyPeerConnections"_s},
|
||||
{u"BitTorrent/Session/QueueingSystemEnabled"_s, u"Preferences/Queueing/QueueingEnabled"_s},
|
||||
{u"BitTorrent/Session/RefreshInterval"_s, u"Preferences/General/RefreshInterval"_s},
|
||||
{u"BitTorrent/Session/SaveResumeDataInterval"_s, u"Preferences/Downloads/SaveResumeDataInterval"_s},
|
||||
{u"BitTorrent/Session/SuperSeedingEnabled"_s, u"Preferences/Advanced/SuperSeeding"_s},
|
||||
{u"BitTorrent/Session/TempPath"_s, u"Preferences/Downloads/TempPath"_s},
|
||||
{u"BitTorrent/Session/TempPathEnabled"_s, u"Preferences/Downloads/TempPathEnabled"_s},
|
||||
{u"BitTorrent/Session/TorrentExportDirectory"_s, u"Preferences/Downloads/TorrentExportDir"_s},
|
||||
{u"BitTorrent/Session/TrackerFilteringEnabled"_s, u"Preferences/IPFilter/FilterTracker"_s},
|
||||
{u"BitTorrent/Session/UseAlternativeGlobalSpeedLimit"_s, u"Preferences/Connection/alt_speeds_on"_s},
|
||||
{u"BitTorrent/Session/UseOSCache"_s, u"Preferences/Advanced/osCache"_s},
|
||||
{u"BitTorrent/Session/UseRandomPort"_s, u"Preferences/General/UseRandomPort"_s},
|
||||
{u"BitTorrent/Session/uTPEnabled"_s, u"Preferences/Bittorrent/uTP"_s},
|
||||
{u"BitTorrent/Session/uTPRateLimited"_s, u"Preferences/Bittorrent/uTP_rate_limited"_s},
|
||||
{u"BitTorrent/TrackerEnabled"_s, u"Preferences/Advanced/trackerEnabled"_s},
|
||||
{u"Network/PortForwardingEnabled"_s, u"Preferences/Connection/UPnP"_s},
|
||||
{u"Network/Proxy/Authentication"_s, u"Preferences/Connection/Proxy/Authentication"_s},
|
||||
{u"Network/Proxy/IP"_s, u"Preferences/Connection/Proxy/IP"_s},
|
||||
{u"Network/Proxy/OnlyForTorrents"_s, u"Preferences/Connection/ProxyOnlyForTorrents"_s},
|
||||
{u"Network/Proxy/Password"_s, u"Preferences/Connection/Proxy/Password"_s},
|
||||
{u"Network/Proxy/Port"_s, u"Preferences/Connection/Proxy/Port"_s},
|
||||
{u"Network/Proxy/Type"_s, u"Preferences/Connection/ProxyType"_s},
|
||||
{u"Network/Proxy/Username"_s, u"Preferences/Connection/Proxy/Username"_s},
|
||||
{u"State/BannedIPs"_s, u"Preferences/IPFilter/BannedIPs"_s}
|
||||
};
|
||||
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
@ -333,7 +333,7 @@ namespace
|
||||
void migrateProxySettingsEnum()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = u"Network/Proxy/Type"_qs;
|
||||
const auto key = u"Network/Proxy/Type"_s;
|
||||
const auto value = settingsStorage->loadValue<QString>(key);
|
||||
|
||||
bool ok = false;
|
||||
@ -344,7 +344,7 @@ namespace
|
||||
switch (number)
|
||||
{
|
||||
case 0:
|
||||
settingsStorage->storeValue(key, u"None"_qs);
|
||||
settingsStorage->storeValue(key, u"None"_s);
|
||||
break;
|
||||
case 1:
|
||||
settingsStorage->storeValue(key, Net::ProxyType::HTTP);
|
||||
@ -353,10 +353,10 @@ namespace
|
||||
settingsStorage->storeValue(key, Net::ProxyType::SOCKS5);
|
||||
break;
|
||||
case 3:
|
||||
settingsStorage->storeValue(key, u"HTTP_PW"_qs);
|
||||
settingsStorage->storeValue(key, u"HTTP_PW"_s);
|
||||
break;
|
||||
case 4:
|
||||
settingsStorage->storeValue(key, u"SOCKS5_PW"_qs);
|
||||
settingsStorage->storeValue(key, u"SOCKS5_PW"_s);
|
||||
break;
|
||||
case 5:
|
||||
settingsStorage->storeValue(key, Net::ProxyType::SOCKS4);
|
||||
@ -373,49 +373,49 @@ namespace
|
||||
void migrateProxySettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto proxyType = settingsStorage->loadValue<QString>(u"Network/Proxy/Type"_qs, u"None"_qs);
|
||||
const auto onlyForTorrents = settingsStorage->loadValue<bool>(u"Network/Proxy/OnlyForTorrents"_qs)
|
||||
const auto proxyType = settingsStorage->loadValue<QString>(u"Network/Proxy/Type"_s, u"None"_s);
|
||||
const auto onlyForTorrents = settingsStorage->loadValue<bool>(u"Network/Proxy/OnlyForTorrents"_s)
|
||||
|| (proxyType == u"SOCKS4");
|
||||
|
||||
if (proxyType == u"None")
|
||||
{
|
||||
settingsStorage->storeValue(u"Network/Proxy/Type"_qs, Net::ProxyType::HTTP);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Type"_s, Net::ProxyType::HTTP);
|
||||
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/BitTorrent"_qs, false);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/RSS"_qs, false);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/Misc"_qs, false);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/BitTorrent"_s, false);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/RSS"_s, false);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/Misc"_s, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/BitTorrent"_qs, true);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/RSS"_qs, !onlyForTorrents);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/Misc"_qs, !onlyForTorrents);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/BitTorrent"_s, true);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/RSS"_s, !onlyForTorrents);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Profiles/Misc"_s, !onlyForTorrents);
|
||||
|
||||
if (proxyType == u"HTTP_PW"_qs)
|
||||
if (proxyType == u"HTTP_PW"_s)
|
||||
{
|
||||
settingsStorage->storeValue(u"Network/Proxy/Type"_qs, Net::ProxyType::HTTP);
|
||||
settingsStorage->storeValue(u"Network/Proxy/AuthEnabled"_qs, true);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Type"_s, Net::ProxyType::HTTP);
|
||||
settingsStorage->storeValue(u"Network/Proxy/AuthEnabled"_s, true);
|
||||
}
|
||||
else if (proxyType == u"SOCKS5_PW"_qs)
|
||||
else if (proxyType == u"SOCKS5_PW"_s)
|
||||
{
|
||||
settingsStorage->storeValue(u"Network/Proxy/Type"_qs, Net::ProxyType::SOCKS5);
|
||||
settingsStorage->storeValue(u"Network/Proxy/AuthEnabled"_qs, true);
|
||||
settingsStorage->storeValue(u"Network/Proxy/Type"_s, Net::ProxyType::SOCKS5);
|
||||
settingsStorage->storeValue(u"Network/Proxy/AuthEnabled"_s, true);
|
||||
}
|
||||
}
|
||||
|
||||
settingsStorage->removeValue(u"Network/Proxy/OnlyForTorrents"_qs);
|
||||
settingsStorage->removeValue(u"Network/Proxy/OnlyForTorrents"_s);
|
||||
|
||||
const auto proxyHostnameLookup = settingsStorage->loadValue<bool>(u"BitTorrent/Session/ProxyHostnameLookup"_qs);
|
||||
settingsStorage->storeValue(u"Network/Proxy/HostnameLookupEnabled"_qs, proxyHostnameLookup);
|
||||
settingsStorage->removeValue(u"BitTorrent/Session/ProxyHostnameLookup"_qs);
|
||||
const auto proxyHostnameLookup = settingsStorage->loadValue<bool>(u"BitTorrent/Session/ProxyHostnameLookup"_s);
|
||||
settingsStorage->storeValue(u"Network/Proxy/HostnameLookupEnabled"_s, proxyHostnameLookup);
|
||||
settingsStorage->removeValue(u"BitTorrent/Session/ProxyHostnameLookup"_s);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void migrateMemoryPrioritySettings()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const QString oldKey = u"BitTorrent/OSMemoryPriority"_qs;
|
||||
const QString newKey = u"Application/ProcessMemoryPriority"_qs;
|
||||
const QString oldKey = u"BitTorrent/OSMemoryPriority"_s;
|
||||
const QString newKey = u"Application/ProcessMemoryPriority"_s;
|
||||
|
||||
if (settingsStorage->hasKey(oldKey))
|
||||
{
|
||||
@ -428,24 +428,24 @@ namespace
|
||||
void migrateStartupWindowState()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
if (settingsStorage->hasKey(u"Preferences/General/StartMinimized"_qs))
|
||||
if (settingsStorage->hasKey(u"Preferences/General/StartMinimized"_s))
|
||||
{
|
||||
const auto startMinimized = settingsStorage->loadValue<bool>(u"Preferences/General/StartMinimized"_qs);
|
||||
const auto minimizeToTray = settingsStorage->loadValue<bool>(u"Preferences/General/MinimizeToTray"_qs);
|
||||
const QString windowState = startMinimized ? (minimizeToTray ? u"Hidden"_qs : u"Minimized"_qs) : u"Normal"_qs;
|
||||
settingsStorage->storeValue(u"GUI/StartUpWindowState"_qs, windowState);
|
||||
const auto startMinimized = settingsStorage->loadValue<bool>(u"Preferences/General/StartMinimized"_s);
|
||||
const auto minimizeToTray = settingsStorage->loadValue<bool>(u"Preferences/General/MinimizeToTray"_s);
|
||||
const QString windowState = startMinimized ? (minimizeToTray ? u"Hidden"_s : u"Minimized"_s) : u"Normal"_s;
|
||||
settingsStorage->storeValue(u"GUI/StartUpWindowState"_s, windowState);
|
||||
}
|
||||
}
|
||||
|
||||
void migrateChineseLocale()
|
||||
{
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
const auto key = u"Preferences/General/Locale"_qs;
|
||||
const auto key = u"Preferences/General/Locale"_s;
|
||||
if (settingsStorage->hasKey(key))
|
||||
{
|
||||
const auto locale = settingsStorage->loadValue<QString>(key);
|
||||
if (locale.compare(u"zh"_qs, Qt::CaseInsensitive) == 0)
|
||||
settingsStorage->storeValue(key, u"zh_CN"_qs);
|
||||
if (locale.compare(u"zh"_s, Qt::CaseInsensitive) == 0)
|
||||
settingsStorage->storeValue(key, u"zh_CN"_s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -508,7 +508,7 @@ void handleChangedDefaults(const DefaultPreferencesMode mode)
|
||||
|
||||
const DefaultValue changedDefaults[] =
|
||||
{
|
||||
{u"BitTorrent/Session/QueueingSystemEnabled"_qs, true, false}
|
||||
{u"BitTorrent/Session/QueueingSystemEnabled"_s, true, false}
|
||||
};
|
||||
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
|
@ -37,7 +37,7 @@
|
||||
AsyncFileStorage::AsyncFileStorage(const Path &storageFolderPath, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_storageDir(storageFolderPath)
|
||||
, m_lockFile((m_storageDir / Path(u"storage.lock"_qs)).data())
|
||||
, m_lockFile((m_storageDir / Path(u"storage.lock"_s)).data())
|
||||
{
|
||||
Q_ASSERT(m_storageDir.isAbsolute());
|
||||
|
||||
|
@ -36,21 +36,21 @@
|
||||
|
||||
#include "base/utils/string.h"
|
||||
|
||||
const QString PARAM_CATEGORY = u"category"_qs;
|
||||
const QString PARAM_TAGS = u"tags"_qs;
|
||||
const QString PARAM_SAVEPATH = u"save_path"_qs;
|
||||
const QString PARAM_USEDOWNLOADPATH = u"use_download_path"_qs;
|
||||
const QString PARAM_DOWNLOADPATH = u"download_path"_qs;
|
||||
const QString PARAM_OPERATINGMODE = u"operating_mode"_qs;
|
||||
const QString PARAM_QUEUETOP = u"add_to_top_of_queue"_qs;
|
||||
const QString PARAM_STOPPED = u"stopped"_qs;
|
||||
const QString PARAM_SKIPCHECKING = u"skip_checking"_qs;
|
||||
const QString PARAM_CONTENTLAYOUT = u"content_layout"_qs;
|
||||
const QString PARAM_AUTOTMM = u"use_auto_tmm"_qs;
|
||||
const QString PARAM_UPLOADLIMIT = u"upload_limit"_qs;
|
||||
const QString PARAM_DOWNLOADLIMIT = u"download_limit"_qs;
|
||||
const QString PARAM_SEEDINGTIMELIMIT = u"seeding_time_limit"_qs;
|
||||
const QString PARAM_RATIOLIMIT = u"ratio_limit"_qs;
|
||||
const QString PARAM_CATEGORY = u"category"_s;
|
||||
const QString PARAM_TAGS = u"tags"_s;
|
||||
const QString PARAM_SAVEPATH = u"save_path"_s;
|
||||
const QString PARAM_USEDOWNLOADPATH = u"use_download_path"_s;
|
||||
const QString PARAM_DOWNLOADPATH = u"download_path"_s;
|
||||
const QString PARAM_OPERATINGMODE = u"operating_mode"_s;
|
||||
const QString PARAM_QUEUETOP = u"add_to_top_of_queue"_s;
|
||||
const QString PARAM_STOPPED = u"stopped"_s;
|
||||
const QString PARAM_SKIPCHECKING = u"skip_checking"_s;
|
||||
const QString PARAM_CONTENTLAYOUT = u"content_layout"_s;
|
||||
const QString PARAM_AUTOTMM = u"use_auto_tmm"_s;
|
||||
const QString PARAM_UPLOADLIMIT = u"upload_limit"_s;
|
||||
const QString PARAM_DOWNLOADLIMIT = u"download_limit"_s;
|
||||
const QString PARAM_SEEDINGTIMELIMIT = u"seeding_time_limit"_s;
|
||||
const QString PARAM_RATIOLIMIT = u"ratio_limit"_s;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -103,8 +103,8 @@ BitTorrent::BencodeResumeDataStorage::BencodeResumeDataStorage(const Path &path,
|
||||
.arg(path.toString()));
|
||||
}
|
||||
|
||||
const QRegularExpression filenamePattern {u"^([A-Fa-f0-9]{40})\\.fastresume$"_qs};
|
||||
const QStringList filenames = QDir(path.data()).entryList(QStringList(u"*.fastresume"_qs), QDir::Files, QDir::Unsorted);
|
||||
const QRegularExpression filenamePattern {u"^([A-Fa-f0-9]{40})\\.fastresume$"_s};
|
||||
const QStringList filenames = QDir(path.data()).entryList(QStringList(u"*.fastresume"_s), QDir::Files, QDir::Unsorted);
|
||||
|
||||
m_registeredTorrents.reserve(filenames.size());
|
||||
for (const QString &filename : filenames)
|
||||
@ -114,7 +114,7 @@ BitTorrent::BencodeResumeDataStorage::BencodeResumeDataStorage(const Path &path,
|
||||
m_registeredTorrents.append(TorrentID::fromString(rxMatch.captured(1)));
|
||||
}
|
||||
|
||||
loadQueue(path / Path(u"queue"_qs));
|
||||
loadQueue(path / Path(u"queue"_s));
|
||||
|
||||
qDebug() << "Registered torrents count: " << m_registeredTorrents.size();
|
||||
|
||||
@ -176,7 +176,7 @@ void BitTorrent::BencodeResumeDataStorage::loadQueue(const Path &queueFilename)
|
||||
return;
|
||||
}
|
||||
|
||||
const QRegularExpression hashPattern {u"^([A-Fa-f0-9]{40})$"_qs};
|
||||
const QRegularExpression hashPattern {u"^([A-Fa-f0-9]{40})$"_s};
|
||||
int start = 0;
|
||||
while (true)
|
||||
{
|
||||
@ -370,7 +370,7 @@ void BitTorrent::BencodeResumeDataStorage::Worker::store(const TorrentID &id, co
|
||||
metadataDict.insert(dataDict.extract("created by"));
|
||||
metadataDict.insert(dataDict.extract("comment"));
|
||||
|
||||
const Path torrentFilepath = m_resumeDataDir / Path(u"%1.torrent"_qs.arg(id.toString()));
|
||||
const Path torrentFilepath = m_resumeDataDir / Path(u"%1.torrent"_s.arg(id.toString()));
|
||||
const nonstd::expected<void, QString> result = Utils::IO::saveToFile(torrentFilepath, metadata);
|
||||
if (!result)
|
||||
{
|
||||
@ -396,7 +396,7 @@ void BitTorrent::BencodeResumeDataStorage::Worker::store(const TorrentID &id, co
|
||||
data["qBt-downloadPath"] = Profile::instance()->toPortablePath(resumeData.downloadPath).data().toStdString();
|
||||
}
|
||||
|
||||
const Path resumeFilepath = m_resumeDataDir / Path(u"%1.fastresume"_qs.arg(id.toString()));
|
||||
const Path resumeFilepath = m_resumeDataDir / Path(u"%1.fastresume"_s.arg(id.toString()));
|
||||
const nonstd::expected<void, QString> result = Utils::IO::saveToFile(resumeFilepath, data);
|
||||
if (!result)
|
||||
{
|
||||
@ -407,10 +407,10 @@ void BitTorrent::BencodeResumeDataStorage::Worker::store(const TorrentID &id, co
|
||||
|
||||
void BitTorrent::BencodeResumeDataStorage::Worker::remove(const TorrentID &id) const
|
||||
{
|
||||
const Path resumeFilename {u"%1.fastresume"_qs.arg(id.toString())};
|
||||
const Path resumeFilename {u"%1.fastresume"_s.arg(id.toString())};
|
||||
Utils::Fs::removeFile(m_resumeDataDir / resumeFilename);
|
||||
|
||||
const Path torrentFilename {u"%1.torrent"_qs.arg(id.toString())};
|
||||
const Path torrentFilename {u"%1.torrent"_s.arg(id.toString())};
|
||||
Utils::Fs::removeFile(m_resumeDataDir / torrentFilename);
|
||||
}
|
||||
|
||||
@ -421,7 +421,7 @@ void BitTorrent::BencodeResumeDataStorage::Worker::storeQueue(const QVector<Torr
|
||||
for (const BitTorrent::TorrentID &torrentID : queue)
|
||||
data += (torrentID.toString().toLatin1() + '\n');
|
||||
|
||||
const Path filepath = m_resumeDataDir / Path(u"queue"_qs);
|
||||
const Path filepath = m_resumeDataDir / Path(u"queue"_s);
|
||||
const nonstd::expected<void, QString> result = Utils::IO::saveToFile(filepath, data);
|
||||
if (!result)
|
||||
{
|
||||
|
@ -33,8 +33,8 @@
|
||||
|
||||
#include "base/global.h"
|
||||
|
||||
const QString OPTION_SAVEPATH = u"save_path"_qs;
|
||||
const QString OPTION_DOWNLOADPATH = u"download_path"_qs;
|
||||
const QString OPTION_SAVEPATH = u"save_path"_s;
|
||||
const QString OPTION_DOWNLOADPATH = u"download_path"_s;
|
||||
|
||||
BitTorrent::CategoryOptions BitTorrent::CategoryOptions::fromJSON(const QJsonObject &jsonObj)
|
||||
{
|
||||
|
@ -32,4 +32,4 @@
|
||||
|
||||
#include "base/global.h"
|
||||
|
||||
inline const QString QB_EXT = u".!qB"_qs;
|
||||
inline const QString QB_EXT = u".!qB"_s;
|
||||
|
@ -63,14 +63,14 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
const QString DB_CONNECTION_NAME = u"ResumeDataStorage"_qs;
|
||||
const QString DB_CONNECTION_NAME = u"ResumeDataStorage"_s;
|
||||
|
||||
const int DB_VERSION = 4;
|
||||
|
||||
const QString DB_TABLE_META = u"meta"_qs;
|
||||
const QString DB_TABLE_TORRENTS = u"torrents"_qs;
|
||||
const QString DB_TABLE_META = u"meta"_s;
|
||||
const QString DB_TABLE_TORRENTS = u"torrents"_s;
|
||||
|
||||
const QString META_VERSION = u"version"_qs;
|
||||
const QString META_VERSION = u"version"_s;
|
||||
|
||||
using namespace BitTorrent;
|
||||
|
||||
@ -158,7 +158,7 @@ namespace
|
||||
|
||||
QString makeCreateTableStatement(const QString &tableName, const QStringList &items)
|
||||
{
|
||||
return u"CREATE TABLE %1 (%2)"_qs.arg(quoted(tableName), items.join(u','));
|
||||
return u"CREATE TABLE %1 (%2)"_s.arg(quoted(tableName), items.join(u','));
|
||||
}
|
||||
|
||||
std::pair<QString, QString> joinColumns(const QVector<Column> &columns)
|
||||
@ -189,27 +189,27 @@ namespace
|
||||
QString makeInsertStatement(const QString &tableName, const QVector<Column> &columns)
|
||||
{
|
||||
const auto [names, values] = joinColumns(columns);
|
||||
return u"INSERT INTO %1 (%2) VALUES (%3)"_qs
|
||||
return u"INSERT INTO %1 (%2) VALUES (%3)"_s
|
||||
.arg(quoted(tableName), names, values);
|
||||
}
|
||||
|
||||
QString makeUpdateStatement(const QString &tableName, const QVector<Column> &columns)
|
||||
{
|
||||
const auto [names, values] = joinColumns(columns);
|
||||
return u"UPDATE %1 SET (%2) = (%3)"_qs
|
||||
return u"UPDATE %1 SET (%2) = (%3)"_s
|
||||
.arg(quoted(tableName), names, values);
|
||||
}
|
||||
|
||||
QString makeOnConflictUpdateStatement(const Column &constraint, const QVector<Column> &columns)
|
||||
{
|
||||
const auto [names, values] = joinColumns(columns);
|
||||
return u" ON CONFLICT (%1) DO UPDATE SET (%2) = (%3)"_qs
|
||||
return u" ON CONFLICT (%1) DO UPDATE SET (%2) = (%3)"_s
|
||||
.arg(quoted(constraint.name), names, values);
|
||||
}
|
||||
|
||||
QString makeColumnDefinition(const Column &column, const char *definition)
|
||||
{
|
||||
return u"%1 %2"_qs.arg(quoted(column.name), QString::fromLatin1(definition));
|
||||
return u"%1 %2"_s.arg(quoted(column.name), QString::fromLatin1(definition));
|
||||
}
|
||||
|
||||
LoadTorrentParams parseQueryResultRow(const QSqlQuery &query)
|
||||
@ -292,7 +292,7 @@ namespace BitTorrent
|
||||
private:
|
||||
void addJob(std::unique_ptr<Job> job);
|
||||
|
||||
const QString m_connectionName = u"ResumeDataStorageWorker"_qs;
|
||||
const QString m_connectionName = u"ResumeDataStorageWorker"_s;
|
||||
const Path m_path;
|
||||
QReadWriteLock &m_dbLock;
|
||||
|
||||
@ -308,7 +308,7 @@ BitTorrent::DBResumeDataStorage::DBResumeDataStorage(const Path &dbPath, QObject
|
||||
{
|
||||
const bool needCreateDB = !dbPath.exists();
|
||||
|
||||
auto db = QSqlDatabase::addDatabase(u"QSQLITE"_qs, DB_CONNECTION_NAME);
|
||||
auto db = QSqlDatabase::addDatabase(u"QSQLITE"_s, DB_CONNECTION_NAME);
|
||||
db.setDatabaseName(dbPath.data());
|
||||
if (!db.open())
|
||||
throw RuntimeError(db.lastError().text());
|
||||
@ -337,7 +337,7 @@ BitTorrent::DBResumeDataStorage::~DBResumeDataStorage()
|
||||
|
||||
QVector<BitTorrent::TorrentID> BitTorrent::DBResumeDataStorage::registeredTorrents() const
|
||||
{
|
||||
const auto selectTorrentIDStatement = u"SELECT %1 FROM %2 ORDER BY %3;"_qs
|
||||
const auto selectTorrentIDStatement = u"SELECT %1 FROM %2 ORDER BY %3;"_s
|
||||
.arg(quoted(DB_COLUMN_TORRENT_ID.name), quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_QUEUE_POSITION.name));
|
||||
|
||||
auto db = QSqlDatabase::database(DB_CONNECTION_NAME);
|
||||
@ -356,7 +356,7 @@ QVector<BitTorrent::TorrentID> BitTorrent::DBResumeDataStorage::registeredTorren
|
||||
|
||||
BitTorrent::LoadResumeDataResult BitTorrent::DBResumeDataStorage::load(const TorrentID &id) const
|
||||
{
|
||||
const QString selectTorrentStatement = u"SELECT * FROM %1 WHERE %2 = %3;"_qs
|
||||
const QString selectTorrentStatement = u"SELECT * FROM %1 WHERE %2 = %3;"_s
|
||||
.arg(quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_TORRENT_ID.name), DB_COLUMN_TORRENT_ID.placeholder);
|
||||
|
||||
auto db = QSqlDatabase::database(DB_CONNECTION_NAME);
|
||||
@ -399,17 +399,17 @@ void BitTorrent::DBResumeDataStorage::storeQueue(const QVector<TorrentID> &queue
|
||||
|
||||
void BitTorrent::DBResumeDataStorage::doLoadAll() const
|
||||
{
|
||||
const QString connectionName = u"ResumeDataStorageLoadAll"_qs;
|
||||
const QString connectionName = u"ResumeDataStorageLoadAll"_s;
|
||||
|
||||
{
|
||||
auto db = QSqlDatabase::addDatabase(u"QSQLITE"_qs, connectionName);
|
||||
auto db = QSqlDatabase::addDatabase(u"QSQLITE"_s, connectionName);
|
||||
db.setDatabaseName(path().data());
|
||||
if (!db.open())
|
||||
throw RuntimeError(db.lastError().text());
|
||||
|
||||
QSqlQuery query {db};
|
||||
|
||||
const auto selectTorrentIDStatement = u"SELECT %1 FROM %2 ORDER BY %3;"_qs
|
||||
const auto selectTorrentIDStatement = u"SELECT %1 FROM %2 ORDER BY %3;"_s
|
||||
.arg(quoted(DB_COLUMN_TORRENT_ID.name), quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_QUEUE_POSITION.name));
|
||||
|
||||
const QReadLocker locker {&m_dbLock};
|
||||
@ -424,7 +424,7 @@ void BitTorrent::DBResumeDataStorage::doLoadAll() const
|
||||
|
||||
emit const_cast<DBResumeDataStorage *>(this)->loadStarted(registeredTorrents);
|
||||
|
||||
const auto selectStatement = u"SELECT * FROM %1 ORDER BY %2;"_qs.arg(quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_QUEUE_POSITION.name));
|
||||
const auto selectStatement = u"SELECT * FROM %1 ORDER BY %2;"_s.arg(quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_QUEUE_POSITION.name));
|
||||
if (!query.exec(selectStatement))
|
||||
throw RuntimeError(query.lastError().text());
|
||||
|
||||
@ -442,7 +442,7 @@ void BitTorrent::DBResumeDataStorage::doLoadAll() const
|
||||
|
||||
int BitTorrent::DBResumeDataStorage::currentDBVersion() const
|
||||
{
|
||||
const auto selectDBVersionStatement = u"SELECT %1 FROM %2 WHERE %3 = %4;"_qs
|
||||
const auto selectDBVersionStatement = u"SELECT %1 FROM %2 WHERE %3 = %4;"_s
|
||||
.arg(quoted(DB_COLUMN_VALUE.name), quoted(DB_TABLE_META), quoted(DB_COLUMN_NAME.name), DB_COLUMN_NAME.placeholder);
|
||||
|
||||
auto db = QSqlDatabase::database(DB_CONNECTION_NAME);
|
||||
@ -533,8 +533,8 @@ void BitTorrent::DBResumeDataStorage::createDB() const
|
||||
if (!query.exec(createTableTorrentsQuery))
|
||||
throw RuntimeError(query.lastError().text());
|
||||
|
||||
const QString torrentsQueuePositionIndexName = u"%1_%2_INDEX"_qs.arg(DB_TABLE_TORRENTS, DB_COLUMN_QUEUE_POSITION.name);
|
||||
const QString createTorrentsQueuePositionIndexQuery = u"CREATE INDEX %1 ON %2 (%3)"_qs
|
||||
const QString torrentsQueuePositionIndexName = u"%1_%2_INDEX"_s.arg(DB_TABLE_TORRENTS, DB_COLUMN_QUEUE_POSITION.name);
|
||||
const QString createTorrentsQueuePositionIndexQuery = u"CREATE INDEX %1 ON %2 (%3)"_s
|
||||
.arg(quoted(torrentsQueuePositionIndexName), quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_QUEUE_POSITION.name));
|
||||
if (!query.exec(createTorrentsQueuePositionIndexQuery))
|
||||
throw RuntimeError(query.lastError().text());
|
||||
@ -567,11 +567,11 @@ void BitTorrent::DBResumeDataStorage::updateDB(const int fromVersion) const
|
||||
{
|
||||
if (fromVersion == 1)
|
||||
{
|
||||
const auto testQuery = u"SELECT COUNT(%1) FROM %2;"_qs
|
||||
const auto testQuery = u"SELECT COUNT(%1) FROM %2;"_s
|
||||
.arg(quoted(DB_COLUMN_DOWNLOAD_PATH.name), quoted(DB_TABLE_TORRENTS));
|
||||
if (!query.exec(testQuery))
|
||||
{
|
||||
const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_qs
|
||||
const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_s
|
||||
.arg(quoted(DB_TABLE_TORRENTS), makeColumnDefinition(DB_COLUMN_DOWNLOAD_PATH, "TEXT"));
|
||||
if (!query.exec(alterTableTorrentsQuery))
|
||||
throw RuntimeError(query.lastError().text());
|
||||
@ -580,11 +580,11 @@ void BitTorrent::DBResumeDataStorage::updateDB(const int fromVersion) const
|
||||
|
||||
if (fromVersion <= 2)
|
||||
{
|
||||
const auto testQuery = u"SELECT COUNT(%1) FROM %2;"_qs
|
||||
const auto testQuery = u"SELECT COUNT(%1) FROM %2;"_s
|
||||
.arg(quoted(DB_COLUMN_STOP_CONDITION.name), quoted(DB_TABLE_TORRENTS));
|
||||
if (!query.exec(testQuery))
|
||||
{
|
||||
const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_qs
|
||||
const auto alterTableTorrentsQuery = u"ALTER TABLE %1 ADD %2"_s
|
||||
.arg(quoted(DB_TABLE_TORRENTS), makeColumnDefinition(DB_COLUMN_STOP_CONDITION, "TEXT NOT NULL DEFAULT `None`"));
|
||||
if (!query.exec(alterTableTorrentsQuery))
|
||||
throw RuntimeError(query.lastError().text());
|
||||
@ -593,8 +593,8 @@ void BitTorrent::DBResumeDataStorage::updateDB(const int fromVersion) const
|
||||
|
||||
if (fromVersion <= 3)
|
||||
{
|
||||
const QString torrentsQueuePositionIndexName = u"%1_%2_INDEX"_qs.arg(DB_TABLE_TORRENTS, DB_COLUMN_QUEUE_POSITION.name);
|
||||
const QString createTorrentsQueuePositionIndexQuery = u"CREATE INDEX IF NOT EXISTS %1 ON %2 (%3)"_qs
|
||||
const QString torrentsQueuePositionIndexName = u"%1_%2_INDEX"_s.arg(DB_TABLE_TORRENTS, DB_COLUMN_QUEUE_POSITION.name);
|
||||
const QString createTorrentsQueuePositionIndexQuery = u"CREATE INDEX IF NOT EXISTS %1 ON %2 (%3)"_s
|
||||
.arg(quoted(torrentsQueuePositionIndexName), quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_QUEUE_POSITION.name));
|
||||
if (!query.exec(createTorrentsQueuePositionIndexQuery))
|
||||
throw RuntimeError(query.lastError().text());
|
||||
@ -625,14 +625,14 @@ void BitTorrent::DBResumeDataStorage::enableWALMode() const
|
||||
auto db = QSqlDatabase::database(DB_CONNECTION_NAME);
|
||||
QSqlQuery query {db};
|
||||
|
||||
if (!query.exec(u"PRAGMA journal_mode = WAL;"_qs))
|
||||
if (!query.exec(u"PRAGMA journal_mode = WAL;"_s))
|
||||
throw RuntimeError(query.lastError().text());
|
||||
|
||||
if (!query.next())
|
||||
throw RuntimeError(tr("Couldn't obtain query result."));
|
||||
|
||||
const QString result = query.value(0).toString();
|
||||
if (result.compare(u"WAL"_qs, Qt::CaseInsensitive) != 0)
|
||||
if (result.compare(u"WAL"_s, Qt::CaseInsensitive) != 0)
|
||||
throw RuntimeError(tr("WAL mode is probably unsupported due to filesystem limitations."));
|
||||
}
|
||||
|
||||
@ -645,7 +645,7 @@ BitTorrent::DBResumeDataStorage::Worker::Worker(const Path &dbPath, QReadWriteLo
|
||||
void BitTorrent::DBResumeDataStorage::Worker::run()
|
||||
{
|
||||
{
|
||||
auto db = QSqlDatabase::addDatabase(u"QSQLITE"_qs, m_connectionName);
|
||||
auto db = QSqlDatabase::addDatabase(u"QSQLITE"_s, m_connectionName);
|
||||
db.setDatabaseName(m_path.data());
|
||||
if (!db.open())
|
||||
throw RuntimeError(db.lastError().text());
|
||||
@ -830,7 +830,7 @@ namespace
|
||||
query.bindValue(DB_COLUMN_NAME.placeholder, m_resumeData.name);
|
||||
query.bindValue(DB_COLUMN_CATEGORY.placeholder, m_resumeData.category);
|
||||
query.bindValue(DB_COLUMN_TAGS.placeholder, (m_resumeData.tags.isEmpty()
|
||||
? QVariant(QVariant::String) : m_resumeData.tags.join(u","_qs)));
|
||||
? QVariant(QVariant::String) : m_resumeData.tags.join(u","_s)));
|
||||
query.bindValue(DB_COLUMN_CONTENT_LAYOUT.placeholder, Utils::String::fromEnum(m_resumeData.contentLayout));
|
||||
query.bindValue(DB_COLUMN_RATIO_LIMIT.placeholder, static_cast<int>(m_resumeData.ratioLimit * 1000));
|
||||
query.bindValue(DB_COLUMN_SEEDING_TIME_LIMIT.placeholder, m_resumeData.seedingTimeLimit);
|
||||
@ -867,7 +867,7 @@ namespace
|
||||
|
||||
void RemoveJob::perform(QSqlDatabase db)
|
||||
{
|
||||
const auto deleteTorrentStatement = u"DELETE FROM %1 WHERE %2 = %3;"_qs
|
||||
const auto deleteTorrentStatement = u"DELETE FROM %1 WHERE %2 = %3;"_s
|
||||
.arg(quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_TORRENT_ID.name), DB_COLUMN_TORRENT_ID.placeholder);
|
||||
|
||||
QSqlQuery query {db};
|
||||
@ -895,7 +895,7 @@ namespace
|
||||
|
||||
void StoreQueueJob::perform(QSqlDatabase db)
|
||||
{
|
||||
const auto updateQueuePosStatement = u"UPDATE %1 SET %2 = %3 WHERE %4 = %5;"_qs
|
||||
const auto updateQueuePosStatement = u"UPDATE %1 SET %2 = %3 WHERE %4 = %5;"_s
|
||||
.arg(quoted(DB_TABLE_TORRENTS), quoted(DB_COLUMN_QUEUE_POSITION.name), DB_COLUMN_QUEUE_POSITION.placeholder
|
||||
, quoted(DB_COLUMN_TORRENT_ID.name), DB_COLUMN_TORRENT_ID.placeholder);
|
||||
|
||||
|
@ -617,17 +617,17 @@ void FilterParserThread::run()
|
||||
{
|
||||
qDebug("Processing filter file");
|
||||
int ruleCount = 0;
|
||||
if (m_filePath.hasExtension(u".p2p"_qs))
|
||||
if (m_filePath.hasExtension(u".p2p"_s))
|
||||
{
|
||||
// PeerGuardian p2p file
|
||||
ruleCount = parseP2PFilterFile();
|
||||
}
|
||||
else if (m_filePath.hasExtension(u".p2b"_qs))
|
||||
else if (m_filePath.hasExtension(u".p2b"_s))
|
||||
{
|
||||
// PeerGuardian p2b file
|
||||
ruleCount = parseP2BFilterFile();
|
||||
}
|
||||
else if (m_filePath.hasExtension(u".dat"_qs))
|
||||
else if (m_filePath.hasExtension(u".dat"_s))
|
||||
{
|
||||
// eMule DAT format
|
||||
ruleCount = parseDATFilterFile();
|
||||
|
@ -53,9 +53,9 @@ namespace
|
||||
const int V1_BASE32_SIZE = SHA1Hash::length() * 1.6;
|
||||
|
||||
return ((((string.size() == V1_HEX_SIZE))
|
||||
&& !string.contains(QRegularExpression(u"[^0-9A-Fa-f]"_qs)))
|
||||
&& !string.contains(QRegularExpression(u"[^0-9A-Fa-f]"_s)))
|
||||
|| ((string.size() == V1_BASE32_SIZE)
|
||||
&& !string.contains(QRegularExpression(u"[^2-7A-Za-z]"_qs))));
|
||||
&& !string.contains(QRegularExpression(u"[^2-7A-Za-z]"_s))));
|
||||
}
|
||||
|
||||
bool isV2Hash(const QString &string)
|
||||
@ -66,7 +66,7 @@ namespace
|
||||
const int V2_HEX_SIZE = SHA256Hash::length() * 2;
|
||||
|
||||
return (string.size() == V2_HEX_SIZE)
|
||||
&& !string.contains(QRegularExpression(u"[^0-9A-Fa-f]"_qs));
|
||||
&& !string.contains(QRegularExpression(u"[^0-9A-Fa-f]"_s));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,8 +262,8 @@ QString PeerInfo::connectionType() const
|
||||
return C_UTP;
|
||||
|
||||
return (m_nativeInfo.connection_type == lt::peer_info::standard_bittorrent)
|
||||
? u"BT"_qs
|
||||
: u"Web"_qs;
|
||||
? u"BT"_s
|
||||
: u"Web"_s;
|
||||
}
|
||||
|
||||
qreal PeerInfo::calcRelevance(const QBitArray &allPieces) const
|
||||
@ -287,7 +287,7 @@ void PeerInfo::determineFlags()
|
||||
const auto updateFlags = [this](const QChar specifier, const QString &explanation)
|
||||
{
|
||||
m_flags += (specifier + u' ');
|
||||
m_flagsDescription += u"%1 = %2\n"_qs.arg(specifier, explanation);
|
||||
m_flagsDescription += u"%1 = %2\n"_s.arg(specifier, explanation);
|
||||
};
|
||||
|
||||
if (isInteresting())
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
PortForwarderImpl::PortForwarderImpl(BitTorrent::SessionImpl *provider, QObject *parent)
|
||||
: Net::PortForwarder(parent)
|
||||
, m_storeActive {u"Network/PortForwardingEnabled"_qs, true}
|
||||
, m_storeActive {u"Network/PortForwardingEnabled"_s, true}
|
||||
, m_provider {provider}
|
||||
{
|
||||
if (isEnabled())
|
||||
|
@ -115,7 +115,7 @@
|
||||
using namespace std::chrono_literals;
|
||||
using namespace BitTorrent;
|
||||
|
||||
const Path CATEGORIES_FILE_NAME {u"categories.json"_qs};
|
||||
const Path CATEGORIES_FILE_NAME {u"categories.json"_s};
|
||||
const int MAX_PROCESSING_RESUMEDATA_COUNT = 50;
|
||||
const int STATISTICS_SAVE_INTERVAL = std::chrono::milliseconds(15min).count();
|
||||
|
||||
@ -213,33 +213,33 @@ namespace
|
||||
{
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
case lt::socket_type_t::http:
|
||||
return u"HTTP"_qs;
|
||||
return u"HTTP"_s;
|
||||
case lt::socket_type_t::http_ssl:
|
||||
return u"HTTP_SSL"_qs;
|
||||
return u"HTTP_SSL"_s;
|
||||
#endif
|
||||
case lt::socket_type_t::i2p:
|
||||
return u"I2P"_qs;
|
||||
return u"I2P"_s;
|
||||
case lt::socket_type_t::socks5:
|
||||
return u"SOCKS5"_qs;
|
||||
return u"SOCKS5"_s;
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
case lt::socket_type_t::socks5_ssl:
|
||||
return u"SOCKS5_SSL"_qs;
|
||||
return u"SOCKS5_SSL"_s;
|
||||
#endif
|
||||
case lt::socket_type_t::tcp:
|
||||
return u"TCP"_qs;
|
||||
return u"TCP"_s;
|
||||
case lt::socket_type_t::tcp_ssl:
|
||||
return u"TCP_SSL"_qs;
|
||||
return u"TCP_SSL"_s;
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
case lt::socket_type_t::utp:
|
||||
return u"UTP"_qs;
|
||||
return u"UTP"_s;
|
||||
#else
|
||||
case lt::socket_type_t::udp:
|
||||
return u"UDP"_qs;
|
||||
return u"UDP"_s;
|
||||
#endif
|
||||
case lt::socket_type_t::utp_ssl:
|
||||
return u"UTP_SSL"_qs;
|
||||
return u"UTP_SSL"_s;
|
||||
}
|
||||
return u"INVALID"_qs;
|
||||
return u"INVALID"_s;
|
||||
}
|
||||
|
||||
QString toString(const lt::address &address)
|
||||
@ -378,7 +378,7 @@ Session *Session::instance()
|
||||
|
||||
bool Session::isValidCategoryName(const QString &name)
|
||||
{
|
||||
const QRegularExpression re {uR"(^([^\\\/]|[^\\\/]([^\\\/]|\/(?=[^\/]))*[^\\\/])$)"_qs};
|
||||
const QRegularExpression re {uR"(^([^\\\/]|[^\\\/]([^\\\/]|\/(?=[^\/]))*[^\\\/])$)"_s};
|
||||
return (name.isEmpty() || (name.indexOf(re) == 0));
|
||||
}
|
||||
|
||||
@ -406,131 +406,131 @@ QStringList Session::expandCategory(const QString &category)
|
||||
|
||||
SessionImpl::SessionImpl(QObject *parent)
|
||||
: Session(parent)
|
||||
, m_isDHTEnabled(BITTORRENT_SESSION_KEY(u"DHTEnabled"_qs), true)
|
||||
, m_isLSDEnabled(BITTORRENT_SESSION_KEY(u"LSDEnabled"_qs), true)
|
||||
, m_isPeXEnabled(BITTORRENT_SESSION_KEY(u"PeXEnabled"_qs), true)
|
||||
, m_isIPFilteringEnabled(BITTORRENT_SESSION_KEY(u"IPFilteringEnabled"_qs), false)
|
||||
, m_isTrackerFilteringEnabled(BITTORRENT_SESSION_KEY(u"TrackerFilteringEnabled"_qs), false)
|
||||
, m_IPFilterFile(BITTORRENT_SESSION_KEY(u"IPFilter"_qs))
|
||||
, m_announceToAllTrackers(BITTORRENT_SESSION_KEY(u"AnnounceToAllTrackers"_qs), false)
|
||||
, m_announceToAllTiers(BITTORRENT_SESSION_KEY(u"AnnounceToAllTiers"_qs), true)
|
||||
, m_asyncIOThreads(BITTORRENT_SESSION_KEY(u"AsyncIOThreadsCount"_qs), 10)
|
||||
, m_hashingThreads(BITTORRENT_SESSION_KEY(u"HashingThreadsCount"_qs), 1)
|
||||
, m_filePoolSize(BITTORRENT_SESSION_KEY(u"FilePoolSize"_qs), 500)
|
||||
, m_checkingMemUsage(BITTORRENT_SESSION_KEY(u"CheckingMemUsageSize"_qs), 32)
|
||||
, m_diskCacheSize(BITTORRENT_SESSION_KEY(u"DiskCacheSize"_qs), -1)
|
||||
, m_diskCacheTTL(BITTORRENT_SESSION_KEY(u"DiskCacheTTL"_qs), 60)
|
||||
, m_diskQueueSize(BITTORRENT_SESSION_KEY(u"DiskQueueSize"_qs), (1024 * 1024))
|
||||
, m_diskIOType(BITTORRENT_SESSION_KEY(u"DiskIOType"_qs), DiskIOType::Default)
|
||||
, m_diskIOReadMode(BITTORRENT_SESSION_KEY(u"DiskIOReadMode"_qs), DiskIOReadMode::EnableOSCache)
|
||||
, m_diskIOWriteMode(BITTORRENT_SESSION_KEY(u"DiskIOWriteMode"_qs), DiskIOWriteMode::EnableOSCache)
|
||||
, m_isDHTEnabled(BITTORRENT_SESSION_KEY(u"DHTEnabled"_s), true)
|
||||
, m_isLSDEnabled(BITTORRENT_SESSION_KEY(u"LSDEnabled"_s), true)
|
||||
, m_isPeXEnabled(BITTORRENT_SESSION_KEY(u"PeXEnabled"_s), true)
|
||||
, m_isIPFilteringEnabled(BITTORRENT_SESSION_KEY(u"IPFilteringEnabled"_s), false)
|
||||
, m_isTrackerFilteringEnabled(BITTORRENT_SESSION_KEY(u"TrackerFilteringEnabled"_s), false)
|
||||
, m_IPFilterFile(BITTORRENT_SESSION_KEY(u"IPFilter"_s))
|
||||
, m_announceToAllTrackers(BITTORRENT_SESSION_KEY(u"AnnounceToAllTrackers"_s), false)
|
||||
, m_announceToAllTiers(BITTORRENT_SESSION_KEY(u"AnnounceToAllTiers"_s), true)
|
||||
, m_asyncIOThreads(BITTORRENT_SESSION_KEY(u"AsyncIOThreadsCount"_s), 10)
|
||||
, m_hashingThreads(BITTORRENT_SESSION_KEY(u"HashingThreadsCount"_s), 1)
|
||||
, m_filePoolSize(BITTORRENT_SESSION_KEY(u"FilePoolSize"_s), 500)
|
||||
, m_checkingMemUsage(BITTORRENT_SESSION_KEY(u"CheckingMemUsageSize"_s), 32)
|
||||
, m_diskCacheSize(BITTORRENT_SESSION_KEY(u"DiskCacheSize"_s), -1)
|
||||
, m_diskCacheTTL(BITTORRENT_SESSION_KEY(u"DiskCacheTTL"_s), 60)
|
||||
, m_diskQueueSize(BITTORRENT_SESSION_KEY(u"DiskQueueSize"_s), (1024 * 1024))
|
||||
, m_diskIOType(BITTORRENT_SESSION_KEY(u"DiskIOType"_s), DiskIOType::Default)
|
||||
, m_diskIOReadMode(BITTORRENT_SESSION_KEY(u"DiskIOReadMode"_s), DiskIOReadMode::EnableOSCache)
|
||||
, m_diskIOWriteMode(BITTORRENT_SESSION_KEY(u"DiskIOWriteMode"_s), DiskIOWriteMode::EnableOSCache)
|
||||
#ifdef Q_OS_WIN
|
||||
, m_coalesceReadWriteEnabled(BITTORRENT_SESSION_KEY(u"CoalesceReadWrite"_qs), true)
|
||||
, m_coalesceReadWriteEnabled(BITTORRENT_SESSION_KEY(u"CoalesceReadWrite"_s), true)
|
||||
#else
|
||||
, m_coalesceReadWriteEnabled(BITTORRENT_SESSION_KEY(u"CoalesceReadWrite"_qs), false)
|
||||
, m_coalesceReadWriteEnabled(BITTORRENT_SESSION_KEY(u"CoalesceReadWrite"_s), false)
|
||||
#endif
|
||||
, m_usePieceExtentAffinity(BITTORRENT_SESSION_KEY(u"PieceExtentAffinity"_qs), false)
|
||||
, m_isSuggestMode(BITTORRENT_SESSION_KEY(u"SuggestMode"_qs), false)
|
||||
, m_sendBufferWatermark(BITTORRENT_SESSION_KEY(u"SendBufferWatermark"_qs), 500)
|
||||
, m_sendBufferLowWatermark(BITTORRENT_SESSION_KEY(u"SendBufferLowWatermark"_qs), 10)
|
||||
, m_sendBufferWatermarkFactor(BITTORRENT_SESSION_KEY(u"SendBufferWatermarkFactor"_qs), 50)
|
||||
, m_connectionSpeed(BITTORRENT_SESSION_KEY(u"ConnectionSpeed"_qs), 30)
|
||||
, m_socketSendBufferSize(BITTORRENT_SESSION_KEY(u"SocketSendBufferSize"_qs), 0)
|
||||
, m_socketReceiveBufferSize(BITTORRENT_SESSION_KEY(u"SocketReceiveBufferSize"_qs), 0)
|
||||
, m_socketBacklogSize(BITTORRENT_SESSION_KEY(u"SocketBacklogSize"_qs), 30)
|
||||
, m_isAnonymousModeEnabled(BITTORRENT_SESSION_KEY(u"AnonymousModeEnabled"_qs), false)
|
||||
, m_isQueueingEnabled(BITTORRENT_SESSION_KEY(u"QueueingSystemEnabled"_qs), false)
|
||||
, m_maxActiveDownloads(BITTORRENT_SESSION_KEY(u"MaxActiveDownloads"_qs), 3, lowerLimited(-1))
|
||||
, m_maxActiveUploads(BITTORRENT_SESSION_KEY(u"MaxActiveUploads"_qs), 3, lowerLimited(-1))
|
||||
, m_maxActiveTorrents(BITTORRENT_SESSION_KEY(u"MaxActiveTorrents"_qs), 5, lowerLimited(-1))
|
||||
, m_ignoreSlowTorrentsForQueueing(BITTORRENT_SESSION_KEY(u"IgnoreSlowTorrentsForQueueing"_qs), false)
|
||||
, m_downloadRateForSlowTorrents(BITTORRENT_SESSION_KEY(u"SlowTorrentsDownloadRate"_qs), 2)
|
||||
, m_uploadRateForSlowTorrents(BITTORRENT_SESSION_KEY(u"SlowTorrentsUploadRate"_qs), 2)
|
||||
, m_slowTorrentsInactivityTimer(BITTORRENT_SESSION_KEY(u"SlowTorrentsInactivityTimer"_qs), 60)
|
||||
, m_outgoingPortsMin(BITTORRENT_SESSION_KEY(u"OutgoingPortsMin"_qs), 0)
|
||||
, m_outgoingPortsMax(BITTORRENT_SESSION_KEY(u"OutgoingPortsMax"_qs), 0)
|
||||
, m_UPnPLeaseDuration(BITTORRENT_SESSION_KEY(u"UPnPLeaseDuration"_qs), 0)
|
||||
, m_peerToS(BITTORRENT_SESSION_KEY(u"PeerToS"_qs), 0x04)
|
||||
, m_ignoreLimitsOnLAN(BITTORRENT_SESSION_KEY(u"IgnoreLimitsOnLAN"_qs), false)
|
||||
, m_includeOverheadInLimits(BITTORRENT_SESSION_KEY(u"IncludeOverheadInLimits"_qs), false)
|
||||
, m_announceIP(BITTORRENT_SESSION_KEY(u"AnnounceIP"_qs))
|
||||
, m_maxConcurrentHTTPAnnounces(BITTORRENT_SESSION_KEY(u"MaxConcurrentHTTPAnnounces"_qs), 50)
|
||||
, m_isReannounceWhenAddressChangedEnabled(BITTORRENT_SESSION_KEY(u"ReannounceWhenAddressChanged"_qs), false)
|
||||
, m_stopTrackerTimeout(BITTORRENT_SESSION_KEY(u"StopTrackerTimeout"_qs), 5)
|
||||
, m_maxConnections(BITTORRENT_SESSION_KEY(u"MaxConnections"_qs), 500, lowerLimited(0, -1))
|
||||
, m_maxUploads(BITTORRENT_SESSION_KEY(u"MaxUploads"_qs), 20, lowerLimited(0, -1))
|
||||
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerTorrent"_qs), 100, lowerLimited(0, -1))
|
||||
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxUploadsPerTorrent"_qs), 4, lowerLimited(0, -1))
|
||||
, m_btProtocol(BITTORRENT_SESSION_KEY(u"BTProtocol"_qs), BTProtocol::Both
|
||||
, m_usePieceExtentAffinity(BITTORRENT_SESSION_KEY(u"PieceExtentAffinity"_s), false)
|
||||
, m_isSuggestMode(BITTORRENT_SESSION_KEY(u"SuggestMode"_s), false)
|
||||
, m_sendBufferWatermark(BITTORRENT_SESSION_KEY(u"SendBufferWatermark"_s), 500)
|
||||
, m_sendBufferLowWatermark(BITTORRENT_SESSION_KEY(u"SendBufferLowWatermark"_s), 10)
|
||||
, m_sendBufferWatermarkFactor(BITTORRENT_SESSION_KEY(u"SendBufferWatermarkFactor"_s), 50)
|
||||
, m_connectionSpeed(BITTORRENT_SESSION_KEY(u"ConnectionSpeed"_s), 30)
|
||||
, m_socketSendBufferSize(BITTORRENT_SESSION_KEY(u"SocketSendBufferSize"_s), 0)
|
||||
, m_socketReceiveBufferSize(BITTORRENT_SESSION_KEY(u"SocketReceiveBufferSize"_s), 0)
|
||||
, m_socketBacklogSize(BITTORRENT_SESSION_KEY(u"SocketBacklogSize"_s), 30)
|
||||
, m_isAnonymousModeEnabled(BITTORRENT_SESSION_KEY(u"AnonymousModeEnabled"_s), false)
|
||||
, m_isQueueingEnabled(BITTORRENT_SESSION_KEY(u"QueueingSystemEnabled"_s), false)
|
||||
, m_maxActiveDownloads(BITTORRENT_SESSION_KEY(u"MaxActiveDownloads"_s), 3, lowerLimited(-1))
|
||||
, m_maxActiveUploads(BITTORRENT_SESSION_KEY(u"MaxActiveUploads"_s), 3, lowerLimited(-1))
|
||||
, m_maxActiveTorrents(BITTORRENT_SESSION_KEY(u"MaxActiveTorrents"_s), 5, lowerLimited(-1))
|
||||
, m_ignoreSlowTorrentsForQueueing(BITTORRENT_SESSION_KEY(u"IgnoreSlowTorrentsForQueueing"_s), false)
|
||||
, m_downloadRateForSlowTorrents(BITTORRENT_SESSION_KEY(u"SlowTorrentsDownloadRate"_s), 2)
|
||||
, m_uploadRateForSlowTorrents(BITTORRENT_SESSION_KEY(u"SlowTorrentsUploadRate"_s), 2)
|
||||
, m_slowTorrentsInactivityTimer(BITTORRENT_SESSION_KEY(u"SlowTorrentsInactivityTimer"_s), 60)
|
||||
, m_outgoingPortsMin(BITTORRENT_SESSION_KEY(u"OutgoingPortsMin"_s), 0)
|
||||
, m_outgoingPortsMax(BITTORRENT_SESSION_KEY(u"OutgoingPortsMax"_s), 0)
|
||||
, m_UPnPLeaseDuration(BITTORRENT_SESSION_KEY(u"UPnPLeaseDuration"_s), 0)
|
||||
, m_peerToS(BITTORRENT_SESSION_KEY(u"PeerToS"_s), 0x04)
|
||||
, m_ignoreLimitsOnLAN(BITTORRENT_SESSION_KEY(u"IgnoreLimitsOnLAN"_s), false)
|
||||
, m_includeOverheadInLimits(BITTORRENT_SESSION_KEY(u"IncludeOverheadInLimits"_s), false)
|
||||
, m_announceIP(BITTORRENT_SESSION_KEY(u"AnnounceIP"_s))
|
||||
, m_maxConcurrentHTTPAnnounces(BITTORRENT_SESSION_KEY(u"MaxConcurrentHTTPAnnounces"_s), 50)
|
||||
, m_isReannounceWhenAddressChangedEnabled(BITTORRENT_SESSION_KEY(u"ReannounceWhenAddressChanged"_s), false)
|
||||
, m_stopTrackerTimeout(BITTORRENT_SESSION_KEY(u"StopTrackerTimeout"_s), 5)
|
||||
, m_maxConnections(BITTORRENT_SESSION_KEY(u"MaxConnections"_s), 500, lowerLimited(0, -1))
|
||||
, m_maxUploads(BITTORRENT_SESSION_KEY(u"MaxUploads"_s), 20, lowerLimited(0, -1))
|
||||
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerTorrent"_s), 100, lowerLimited(0, -1))
|
||||
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxUploadsPerTorrent"_s), 4, lowerLimited(0, -1))
|
||||
, m_btProtocol(BITTORRENT_SESSION_KEY(u"BTProtocol"_s), BTProtocol::Both
|
||||
, clampValue(BTProtocol::Both, BTProtocol::UTP))
|
||||
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY(u"uTPRateLimited"_qs), true)
|
||||
, m_utpMixedMode(BITTORRENT_SESSION_KEY(u"uTPMixedMode"_qs), MixedModeAlgorithm::TCP
|
||||
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY(u"uTPRateLimited"_s), true)
|
||||
, m_utpMixedMode(BITTORRENT_SESSION_KEY(u"uTPMixedMode"_s), MixedModeAlgorithm::TCP
|
||||
, clampValue(MixedModeAlgorithm::TCP, MixedModeAlgorithm::Proportional))
|
||||
, m_IDNSupportEnabled(BITTORRENT_SESSION_KEY(u"IDNSupportEnabled"_qs), false)
|
||||
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY(u"MultiConnectionsPerIp"_qs), false)
|
||||
, m_validateHTTPSTrackerCertificate(BITTORRENT_SESSION_KEY(u"ValidateHTTPSTrackerCertificate"_qs), true)
|
||||
, m_SSRFMitigationEnabled(BITTORRENT_SESSION_KEY(u"SSRFMitigation"_qs), true)
|
||||
, m_blockPeersOnPrivilegedPorts(BITTORRENT_SESSION_KEY(u"BlockPeersOnPrivilegedPorts"_qs), false)
|
||||
, m_isAddTrackersEnabled(BITTORRENT_SESSION_KEY(u"AddTrackersEnabled"_qs), false)
|
||||
, m_additionalTrackers(BITTORRENT_SESSION_KEY(u"AdditionalTrackers"_qs))
|
||||
, m_globalMaxRatio(BITTORRENT_SESSION_KEY(u"GlobalMaxRatio"_qs), -1, [](qreal r) { return r < 0 ? -1. : r;})
|
||||
, m_globalMaxSeedingMinutes(BITTORRENT_SESSION_KEY(u"GlobalMaxSeedingMinutes"_qs), -1, lowerLimited(-1))
|
||||
, m_isAddTorrentToQueueTop(BITTORRENT_SESSION_KEY(u"AddTorrentToTopOfQueue"_qs), false)
|
||||
, m_isAddTorrentPaused(BITTORRENT_SESSION_KEY(u"AddTorrentPaused"_qs), false)
|
||||
, m_torrentStopCondition(BITTORRENT_SESSION_KEY(u"TorrentStopCondition"_qs), Torrent::StopCondition::None)
|
||||
, m_torrentContentLayout(BITTORRENT_SESSION_KEY(u"TorrentContentLayout"_qs), TorrentContentLayout::Original)
|
||||
, m_isAppendExtensionEnabled(BITTORRENT_SESSION_KEY(u"AddExtensionToIncompleteFiles"_qs), false)
|
||||
, m_refreshInterval(BITTORRENT_SESSION_KEY(u"RefreshInterval"_qs), 1500)
|
||||
, m_isPreallocationEnabled(BITTORRENT_SESSION_KEY(u"Preallocation"_qs), false)
|
||||
, m_torrentExportDirectory(BITTORRENT_SESSION_KEY(u"TorrentExportDirectory"_qs))
|
||||
, m_finishedTorrentExportDirectory(BITTORRENT_SESSION_KEY(u"FinishedTorrentExportDirectory"_qs))
|
||||
, m_globalDownloadSpeedLimit(BITTORRENT_SESSION_KEY(u"GlobalDLSpeedLimit"_qs), 0, lowerLimited(0))
|
||||
, m_globalUploadSpeedLimit(BITTORRENT_SESSION_KEY(u"GlobalUPSpeedLimit"_qs), 0, lowerLimited(0))
|
||||
, m_altGlobalDownloadSpeedLimit(BITTORRENT_SESSION_KEY(u"AlternativeGlobalDLSpeedLimit"_qs), 10, lowerLimited(0))
|
||||
, m_altGlobalUploadSpeedLimit(BITTORRENT_SESSION_KEY(u"AlternativeGlobalUPSpeedLimit"_qs), 10, lowerLimited(0))
|
||||
, m_isAltGlobalSpeedLimitEnabled(BITTORRENT_SESSION_KEY(u"UseAlternativeGlobalSpeedLimit"_qs), false)
|
||||
, m_isBandwidthSchedulerEnabled(BITTORRENT_SESSION_KEY(u"BandwidthSchedulerEnabled"_qs), false)
|
||||
, m_isPerformanceWarningEnabled(BITTORRENT_SESSION_KEY(u"PerformanceWarning"_qs), false)
|
||||
, m_saveResumeDataInterval(BITTORRENT_SESSION_KEY(u"SaveResumeDataInterval"_qs), 60)
|
||||
, m_port(BITTORRENT_SESSION_KEY(u"Port"_qs), -1)
|
||||
, m_networkInterface(BITTORRENT_SESSION_KEY(u"Interface"_qs))
|
||||
, m_networkInterfaceName(BITTORRENT_SESSION_KEY(u"InterfaceName"_qs))
|
||||
, m_networkInterfaceAddress(BITTORRENT_SESSION_KEY(u"InterfaceAddress"_qs))
|
||||
, m_encryption(BITTORRENT_SESSION_KEY(u"Encryption"_qs), 0)
|
||||
, m_maxActiveCheckingTorrents(BITTORRENT_SESSION_KEY(u"MaxActiveCheckingTorrents"_qs), 1)
|
||||
, m_isProxyPeerConnectionsEnabled(BITTORRENT_SESSION_KEY(u"ProxyPeerConnections"_qs), false)
|
||||
, m_chokingAlgorithm(BITTORRENT_SESSION_KEY(u"ChokingAlgorithm"_qs), ChokingAlgorithm::FixedSlots
|
||||
, m_IDNSupportEnabled(BITTORRENT_SESSION_KEY(u"IDNSupportEnabled"_s), false)
|
||||
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY(u"MultiConnectionsPerIp"_s), false)
|
||||
, m_validateHTTPSTrackerCertificate(BITTORRENT_SESSION_KEY(u"ValidateHTTPSTrackerCertificate"_s), true)
|
||||
, m_SSRFMitigationEnabled(BITTORRENT_SESSION_KEY(u"SSRFMitigation"_s), true)
|
||||
, m_blockPeersOnPrivilegedPorts(BITTORRENT_SESSION_KEY(u"BlockPeersOnPrivilegedPorts"_s), false)
|
||||
, m_isAddTrackersEnabled(BITTORRENT_SESSION_KEY(u"AddTrackersEnabled"_s), false)
|
||||
, m_additionalTrackers(BITTORRENT_SESSION_KEY(u"AdditionalTrackers"_s))
|
||||
, m_globalMaxRatio(BITTORRENT_SESSION_KEY(u"GlobalMaxRatio"_s), -1, [](qreal r) { return r < 0 ? -1. : r;})
|
||||
, m_globalMaxSeedingMinutes(BITTORRENT_SESSION_KEY(u"GlobalMaxSeedingMinutes"_s), -1, lowerLimited(-1))
|
||||
, m_isAddTorrentToQueueTop(BITTORRENT_SESSION_KEY(u"AddTorrentToTopOfQueue"_s), false)
|
||||
, m_isAddTorrentPaused(BITTORRENT_SESSION_KEY(u"AddTorrentPaused"_s), false)
|
||||
, m_torrentStopCondition(BITTORRENT_SESSION_KEY(u"TorrentStopCondition"_s), Torrent::StopCondition::None)
|
||||
, m_torrentContentLayout(BITTORRENT_SESSION_KEY(u"TorrentContentLayout"_s), TorrentContentLayout::Original)
|
||||
, m_isAppendExtensionEnabled(BITTORRENT_SESSION_KEY(u"AddExtensionToIncompleteFiles"_s), false)
|
||||
, m_refreshInterval(BITTORRENT_SESSION_KEY(u"RefreshInterval"_s), 1500)
|
||||
, m_isPreallocationEnabled(BITTORRENT_SESSION_KEY(u"Preallocation"_s), false)
|
||||
, m_torrentExportDirectory(BITTORRENT_SESSION_KEY(u"TorrentExportDirectory"_s))
|
||||
, m_finishedTorrentExportDirectory(BITTORRENT_SESSION_KEY(u"FinishedTorrentExportDirectory"_s))
|
||||
, m_globalDownloadSpeedLimit(BITTORRENT_SESSION_KEY(u"GlobalDLSpeedLimit"_s), 0, lowerLimited(0))
|
||||
, m_globalUploadSpeedLimit(BITTORRENT_SESSION_KEY(u"GlobalUPSpeedLimit"_s), 0, lowerLimited(0))
|
||||
, m_altGlobalDownloadSpeedLimit(BITTORRENT_SESSION_KEY(u"AlternativeGlobalDLSpeedLimit"_s), 10, lowerLimited(0))
|
||||
, m_altGlobalUploadSpeedLimit(BITTORRENT_SESSION_KEY(u"AlternativeGlobalUPSpeedLimit"_s), 10, lowerLimited(0))
|
||||
, m_isAltGlobalSpeedLimitEnabled(BITTORRENT_SESSION_KEY(u"UseAlternativeGlobalSpeedLimit"_s), false)
|
||||
, m_isBandwidthSchedulerEnabled(BITTORRENT_SESSION_KEY(u"BandwidthSchedulerEnabled"_s), false)
|
||||
, m_isPerformanceWarningEnabled(BITTORRENT_SESSION_KEY(u"PerformanceWarning"_s), false)
|
||||
, m_saveResumeDataInterval(BITTORRENT_SESSION_KEY(u"SaveResumeDataInterval"_s), 60)
|
||||
, m_port(BITTORRENT_SESSION_KEY(u"Port"_s), -1)
|
||||
, m_networkInterface(BITTORRENT_SESSION_KEY(u"Interface"_s))
|
||||
, m_networkInterfaceName(BITTORRENT_SESSION_KEY(u"InterfaceName"_s))
|
||||
, m_networkInterfaceAddress(BITTORRENT_SESSION_KEY(u"InterfaceAddress"_s))
|
||||
, m_encryption(BITTORRENT_SESSION_KEY(u"Encryption"_s), 0)
|
||||
, m_maxActiveCheckingTorrents(BITTORRENT_SESSION_KEY(u"MaxActiveCheckingTorrents"_s), 1)
|
||||
, m_isProxyPeerConnectionsEnabled(BITTORRENT_SESSION_KEY(u"ProxyPeerConnections"_s), false)
|
||||
, m_chokingAlgorithm(BITTORRENT_SESSION_KEY(u"ChokingAlgorithm"_s), ChokingAlgorithm::FixedSlots
|
||||
, clampValue(ChokingAlgorithm::FixedSlots, ChokingAlgorithm::RateBased))
|
||||
, m_seedChokingAlgorithm(BITTORRENT_SESSION_KEY(u"SeedChokingAlgorithm"_qs), SeedChokingAlgorithm::FastestUpload
|
||||
, m_seedChokingAlgorithm(BITTORRENT_SESSION_KEY(u"SeedChokingAlgorithm"_s), SeedChokingAlgorithm::FastestUpload
|
||||
, clampValue(SeedChokingAlgorithm::RoundRobin, SeedChokingAlgorithm::AntiLeech))
|
||||
, m_storedTags(BITTORRENT_SESSION_KEY(u"Tags"_qs))
|
||||
, m_maxRatioAction(BITTORRENT_SESSION_KEY(u"MaxRatioAction"_qs), Pause)
|
||||
, m_savePath(BITTORRENT_SESSION_KEY(u"DefaultSavePath"_qs), specialFolderLocation(SpecialFolder::Downloads))
|
||||
, m_downloadPath(BITTORRENT_SESSION_KEY(u"TempPath"_qs), (savePath() / Path(u"temp"_qs)))
|
||||
, m_isDownloadPathEnabled(BITTORRENT_SESSION_KEY(u"TempPathEnabled"_qs), false)
|
||||
, m_isSubcategoriesEnabled(BITTORRENT_SESSION_KEY(u"SubcategoriesEnabled"_qs), false)
|
||||
, m_useCategoryPathsInManualMode(BITTORRENT_SESSION_KEY(u"UseCategoryPathsInManualMode"_qs), false)
|
||||
, m_isAutoTMMDisabledByDefault(BITTORRENT_SESSION_KEY(u"DisableAutoTMMByDefault"_qs), true)
|
||||
, m_isDisableAutoTMMWhenCategoryChanged(BITTORRENT_SESSION_KEY(u"DisableAutoTMMTriggers/CategoryChanged"_qs), false)
|
||||
, m_isDisableAutoTMMWhenDefaultSavePathChanged(BITTORRENT_SESSION_KEY(u"DisableAutoTMMTriggers/DefaultSavePathChanged"_qs), true)
|
||||
, m_isDisableAutoTMMWhenCategorySavePathChanged(BITTORRENT_SESSION_KEY(u"DisableAutoTMMTriggers/CategorySavePathChanged"_qs), true)
|
||||
, m_isTrackerEnabled(BITTORRENT_KEY(u"TrackerEnabled"_qs), false)
|
||||
, m_peerTurnover(BITTORRENT_SESSION_KEY(u"PeerTurnover"_qs), 4)
|
||||
, m_peerTurnoverCutoff(BITTORRENT_SESSION_KEY(u"PeerTurnoverCutOff"_qs), 90)
|
||||
, m_peerTurnoverInterval(BITTORRENT_SESSION_KEY(u"PeerTurnoverInterval"_qs), 300)
|
||||
, m_requestQueueSize(BITTORRENT_SESSION_KEY(u"RequestQueueSize"_qs), 500)
|
||||
, m_isExcludedFileNamesEnabled(BITTORRENT_KEY(u"ExcludedFileNamesEnabled"_qs), false)
|
||||
, m_excludedFileNames(BITTORRENT_SESSION_KEY(u"ExcludedFileNames"_qs))
|
||||
, m_bannedIPs(u"State/BannedIPs"_qs, QStringList(), Algorithm::sorted<QStringList>)
|
||||
, m_resumeDataStorageType(BITTORRENT_SESSION_KEY(u"ResumeDataStorageType"_qs), ResumeDataStorageType::Legacy)
|
||||
, m_isI2PEnabled {BITTORRENT_SESSION_KEY(u"I2P/Enabled"_qs), false}
|
||||
, m_I2PAddress {BITTORRENT_SESSION_KEY(u"I2P/Address"_qs), u"127.0.0.1"_qs}
|
||||
, m_I2PPort {BITTORRENT_SESSION_KEY(u"I2P/Port"_qs), 7656}
|
||||
, m_I2PMixedMode {BITTORRENT_SESSION_KEY(u"I2P/MixedMode"_qs), false}
|
||||
, m_I2PInboundQuantity {BITTORRENT_SESSION_KEY(u"I2P/InboundQuantity"_qs), 3}
|
||||
, m_I2POutboundQuantity {BITTORRENT_SESSION_KEY(u"I2P/OutboundQuantity"_qs), 3}
|
||||
, m_I2PInboundLength {BITTORRENT_SESSION_KEY(u"I2P/InboundLength"_qs), 3}
|
||||
, m_I2POutboundLength {BITTORRENT_SESSION_KEY(u"I2P/OutboundLength"_qs), 3}
|
||||
, m_storedTags(BITTORRENT_SESSION_KEY(u"Tags"_s))
|
||||
, m_maxRatioAction(BITTORRENT_SESSION_KEY(u"MaxRatioAction"_s), Pause)
|
||||
, m_savePath(BITTORRENT_SESSION_KEY(u"DefaultSavePath"_s), specialFolderLocation(SpecialFolder::Downloads))
|
||||
, m_downloadPath(BITTORRENT_SESSION_KEY(u"TempPath"_s), (savePath() / Path(u"temp"_s)))
|
||||
, m_isDownloadPathEnabled(BITTORRENT_SESSION_KEY(u"TempPathEnabled"_s), false)
|
||||
, m_isSubcategoriesEnabled(BITTORRENT_SESSION_KEY(u"SubcategoriesEnabled"_s), false)
|
||||
, m_useCategoryPathsInManualMode(BITTORRENT_SESSION_KEY(u"UseCategoryPathsInManualMode"_s), false)
|
||||
, m_isAutoTMMDisabledByDefault(BITTORRENT_SESSION_KEY(u"DisableAutoTMMByDefault"_s), true)
|
||||
, m_isDisableAutoTMMWhenCategoryChanged(BITTORRENT_SESSION_KEY(u"DisableAutoTMMTriggers/CategoryChanged"_s), false)
|
||||
, m_isDisableAutoTMMWhenDefaultSavePathChanged(BITTORRENT_SESSION_KEY(u"DisableAutoTMMTriggers/DefaultSavePathChanged"_s), true)
|
||||
, m_isDisableAutoTMMWhenCategorySavePathChanged(BITTORRENT_SESSION_KEY(u"DisableAutoTMMTriggers/CategorySavePathChanged"_s), true)
|
||||
, m_isTrackerEnabled(BITTORRENT_KEY(u"TrackerEnabled"_s), false)
|
||||
, m_peerTurnover(BITTORRENT_SESSION_KEY(u"PeerTurnover"_s), 4)
|
||||
, m_peerTurnoverCutoff(BITTORRENT_SESSION_KEY(u"PeerTurnoverCutOff"_s), 90)
|
||||
, m_peerTurnoverInterval(BITTORRENT_SESSION_KEY(u"PeerTurnoverInterval"_s), 300)
|
||||
, m_requestQueueSize(BITTORRENT_SESSION_KEY(u"RequestQueueSize"_s), 500)
|
||||
, m_isExcludedFileNamesEnabled(BITTORRENT_KEY(u"ExcludedFileNamesEnabled"_s), false)
|
||||
, m_excludedFileNames(BITTORRENT_SESSION_KEY(u"ExcludedFileNames"_s))
|
||||
, m_bannedIPs(u"State/BannedIPs"_s, QStringList(), Algorithm::sorted<QStringList>)
|
||||
, m_resumeDataStorageType(BITTORRENT_SESSION_KEY(u"ResumeDataStorageType"_s), ResumeDataStorageType::Legacy)
|
||||
, m_isI2PEnabled {BITTORRENT_SESSION_KEY(u"I2P/Enabled"_s), false}
|
||||
, m_I2PAddress {BITTORRENT_SESSION_KEY(u"I2P/Address"_s), u"127.0.0.1"_s}
|
||||
, m_I2PPort {BITTORRENT_SESSION_KEY(u"I2P/Port"_s), 7656}
|
||||
, m_I2PMixedMode {BITTORRENT_SESSION_KEY(u"I2P/MixedMode"_s), false}
|
||||
, m_I2PInboundQuantity {BITTORRENT_SESSION_KEY(u"I2P/InboundQuantity"_s), 3}
|
||||
, m_I2POutboundQuantity {BITTORRENT_SESSION_KEY(u"I2P/OutboundQuantity"_s), 3}
|
||||
, m_I2PInboundLength {BITTORRENT_SESSION_KEY(u"I2P/InboundLength"_s), 3}
|
||||
, m_I2POutboundLength {BITTORRENT_SESSION_KEY(u"I2P/OutboundLength"_s), 3}
|
||||
, m_seedingLimitTimer {new QTimer(this)}
|
||||
, m_resumeDataTimer {new QTimer(this)}
|
||||
, m_ioThread {new QThread}
|
||||
@ -879,7 +879,7 @@ bool SessionImpl::removeCategory(const QString &name)
|
||||
for (TorrentImpl *const torrent : asConst(m_torrents))
|
||||
{
|
||||
if (torrent->belongsToCategory(name))
|
||||
torrent->setCategory(u""_qs);
|
||||
torrent->setCategory(u""_s);
|
||||
}
|
||||
|
||||
// remove stored category and its subcategories if exist
|
||||
@ -1156,7 +1156,7 @@ void SessionImpl::prepareStartup()
|
||||
{
|
||||
qDebug("Initializing torrents resume data storage...");
|
||||
|
||||
const Path dbPath = specialFolderLocation(SpecialFolder::Data) / Path(u"torrents.db"_qs);
|
||||
const Path dbPath = specialFolderLocation(SpecialFolder::Data) / Path(u"torrents.db"_s);
|
||||
const bool dbStorageExists = dbPath.exists();
|
||||
|
||||
auto *context = new ResumeSessionContext(this);
|
||||
@ -1168,13 +1168,13 @@ void SessionImpl::prepareStartup()
|
||||
|
||||
if (!dbStorageExists)
|
||||
{
|
||||
const Path dataPath = specialFolderLocation(SpecialFolder::Data) / Path(u"BT_backup"_qs);
|
||||
const Path dataPath = specialFolderLocation(SpecialFolder::Data) / Path(u"BT_backup"_s);
|
||||
context->startupStorage = new BencodeResumeDataStorage(dataPath, this);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const Path dataPath = specialFolderLocation(SpecialFolder::Data) / Path(u"BT_backup"_qs);
|
||||
const Path dataPath = specialFolderLocation(SpecialFolder::Data) / Path(u"BT_backup"_s);
|
||||
m_resumeDataStorage = new BencodeResumeDataStorage(dataPath, this);
|
||||
|
||||
if (dbStorageExists)
|
||||
@ -2068,7 +2068,7 @@ void SessionImpl::configurePeerClasses()
|
||||
|
||||
void SessionImpl::enableTracker(const bool enable)
|
||||
{
|
||||
const QString profile = u"embeddedTracker"_qs;
|
||||
const QString profile = u"embeddedTracker"_s;
|
||||
auto *portForwarder = Net::PortForwarder::instance();
|
||||
|
||||
if (enable)
|
||||
@ -2146,23 +2146,23 @@ void SessionImpl::processShareLimits()
|
||||
|
||||
if (m_maxRatioAction == Remove)
|
||||
{
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Removed torrent."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Removed torrent."), torrentName));
|
||||
deleteTorrent(torrent->id());
|
||||
}
|
||||
else if (m_maxRatioAction == DeleteFiles)
|
||||
{
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Removed torrent and deleted its content."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Removed torrent and deleted its content."), torrentName));
|
||||
deleteTorrent(torrent->id(), DeleteTorrentAndFiles);
|
||||
}
|
||||
else if ((m_maxRatioAction == Pause) && !torrent->isPaused())
|
||||
{
|
||||
torrent->pause();
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Torrent paused."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Torrent paused."), torrentName));
|
||||
}
|
||||
else if ((m_maxRatioAction == EnableSuperSeeding) && !torrent->isPaused() && !torrent->superSeeding())
|
||||
{
|
||||
torrent->setSuperSeeding(true);
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Super seeding enabled."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Super seeding enabled."), torrentName));
|
||||
}
|
||||
|
||||
continue;
|
||||
@ -2189,23 +2189,23 @@ void SessionImpl::processShareLimits()
|
||||
|
||||
if (m_maxRatioAction == Remove)
|
||||
{
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Removed torrent."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Removed torrent."), torrentName));
|
||||
deleteTorrent(torrent->id());
|
||||
}
|
||||
else if (m_maxRatioAction == DeleteFiles)
|
||||
{
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Removed torrent and deleted its content."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Removed torrent and deleted its content."), torrentName));
|
||||
deleteTorrent(torrent->id(), DeleteTorrentAndFiles);
|
||||
}
|
||||
else if ((m_maxRatioAction == Pause) && !torrent->isPaused())
|
||||
{
|
||||
torrent->pause();
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Torrent paused."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Torrent paused."), torrentName));
|
||||
}
|
||||
else if ((m_maxRatioAction == EnableSuperSeeding) && !torrent->isPaused() && !torrent->superSeeding())
|
||||
{
|
||||
torrent->setSuperSeeding(true);
|
||||
LogMsg(u"%1 %2 %3"_qs.arg(description, tr("Super seeding enabled."), torrentName));
|
||||
LogMsg(u"%1 %2 %3"_s.arg(description, tr("Super seeding enabled."), torrentName));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2615,7 +2615,7 @@ LoadTorrentParams SessionImpl::initLoadTorrentParams(const AddTorrentParams &add
|
||||
|
||||
const QString category = addTorrentParams.category;
|
||||
if (!category.isEmpty() && !m_categories.contains(category) && !addCategory(category))
|
||||
loadTorrentParams.category = u""_qs;
|
||||
loadTorrentParams.category = u""_s;
|
||||
else
|
||||
loadTorrentParams.category = category;
|
||||
|
||||
@ -3013,13 +3013,13 @@ void SessionImpl::exportTorrentFile(const Torrent *torrent, const Path &folderPa
|
||||
return;
|
||||
|
||||
const QString validName = Utils::Fs::toValidFileName(torrent->name());
|
||||
QString torrentExportFilename = u"%1.torrent"_qs.arg(validName);
|
||||
QString torrentExportFilename = u"%1.torrent"_s.arg(validName);
|
||||
Path newTorrentPath = folderPath / Path(torrentExportFilename);
|
||||
int counter = 0;
|
||||
while (newTorrentPath.exists())
|
||||
{
|
||||
// Append number to torrent name to make it unique
|
||||
torrentExportFilename = u"%1 %2.torrent"_qs.arg(validName).arg(++counter);
|
||||
torrentExportFilename = u"%1 %2.torrent"_s.arg(validName).arg(++counter);
|
||||
newTorrentPath = folderPath / Path(torrentExportFilename);
|
||||
}
|
||||
|
||||
@ -3154,7 +3154,7 @@ void SessionImpl::setSavePath(const Path &path)
|
||||
|
||||
void SessionImpl::setDownloadPath(const Path &path)
|
||||
{
|
||||
const Path newPath = (path.isAbsolute() ? path : (savePath() / Path(u"temp"_qs) / path));
|
||||
const Path newPath = (path.isAbsolute() ? path : (savePath() / Path(u"temp"_s) / path));
|
||||
if (newPath == m_downloadPath)
|
||||
return;
|
||||
|
||||
@ -3230,13 +3230,13 @@ QStringList SessionImpl::getListeningIPs() const
|
||||
if (ifaceName.isEmpty())
|
||||
{
|
||||
if (ifaceAddr.isEmpty())
|
||||
return {u"0.0.0.0"_qs, u"::"_qs}; // Indicates all interfaces + all addresses (aka default)
|
||||
return {u"0.0.0.0"_s, u"::"_s}; // Indicates all interfaces + all addresses (aka default)
|
||||
|
||||
if (allIPv4)
|
||||
return {u"0.0.0.0"_qs};
|
||||
return {u"0.0.0.0"_s};
|
||||
|
||||
if (allIPv6)
|
||||
return {u"::"_qs};
|
||||
return {u"::"_s};
|
||||
}
|
||||
|
||||
const auto checkAndAddIP = [allIPv4, allIPv6, &IPs](const QHostAddress &addr, const QHostAddress &match)
|
||||
@ -4920,7 +4920,7 @@ void SessionImpl::handleTorrentFinished(TorrentImpl *const torrent)
|
||||
// Check whether it contains .torrent files
|
||||
for (const Path &torrentRelpath : asConst(torrent->filePaths()))
|
||||
{
|
||||
if (torrentRelpath.hasExtension(u".torrent"_qs))
|
||||
if (torrentRelpath.hasExtension(u".torrent"_s))
|
||||
{
|
||||
emit recursiveTorrentDownloadPossible(torrent);
|
||||
break;
|
||||
@ -5084,7 +5084,7 @@ void SessionImpl::storeCategories() const
|
||||
|
||||
void SessionImpl::upgradeCategories()
|
||||
{
|
||||
const auto legacyCategories = SettingValue<QVariantMap>(u"BitTorrent/Session/Categories"_qs).get();
|
||||
const auto legacyCategories = SettingValue<QVariantMap>(u"BitTorrent/Session/Categories"_s).get();
|
||||
for (auto it = legacyCategories.cbegin(); it != legacyCategories.cend(); ++it)
|
||||
{
|
||||
const QString &categoryName = it.key();
|
||||
@ -5214,7 +5214,7 @@ void SessionImpl::recursiveTorrentDownload(const TorrentID &id)
|
||||
|
||||
for (const Path &torrentRelpath : asConst(torrent->filePaths()))
|
||||
{
|
||||
if (torrentRelpath.hasExtension(u".torrent"_qs))
|
||||
if (torrentRelpath.hasExtension(u".torrent"_s))
|
||||
{
|
||||
const Path torrentFullpath = torrent->savePath() / torrentRelpath;
|
||||
|
||||
@ -5723,7 +5723,7 @@ void SessionImpl::handlePeerBlockedAlert(const lt::peer_blocked_alert *p)
|
||||
reason = tr("filtered port (%1)", "this peer was blocked. Reason: filtered port (8899).").arg(QString::number(p->endpoint.port()));
|
||||
break;
|
||||
case lt::peer_blocked_alert::i2p_mixed:
|
||||
reason = tr("%1 mixed mode restrictions", "this peer was blocked. Reason: I2P mixed mode restrictions.").arg(u"I2P"_qs); // don't translate I2P
|
||||
reason = tr("%1 mixed mode restrictions", "this peer was blocked. Reason: I2P mixed mode restrictions.").arg(u"I2P"_s); // don't translate I2P
|
||||
break;
|
||||
case lt::peer_blocked_alert::privileged_ports:
|
||||
reason = tr("privileged port (%1)", "this peer was blocked. Reason: privileged port (80).").arg(QString::number(p->endpoint.port()));
|
||||
@ -5732,7 +5732,7 @@ void SessionImpl::handlePeerBlockedAlert(const lt::peer_blocked_alert *p)
|
||||
reason = tr("%1 is disabled", "this peer was blocked. Reason: uTP is disabled.").arg(C_UTP); // don't translate μTP
|
||||
break;
|
||||
case lt::peer_blocked_alert::tcp_disabled:
|
||||
reason = tr("%1 is disabled", "this peer was blocked. Reason: TCP is disabled.").arg(u"TCP"_qs); // don't translate TCP
|
||||
reason = tr("%1 is disabled", "this peer was blocked. Reason: TCP is disabled.").arg(u"TCP"_s); // don't translate TCP
|
||||
break;
|
||||
}
|
||||
|
||||
@ -5983,7 +5983,7 @@ void SessionImpl::handleSocks5Alert(const lt::socks5_alert *p) const
|
||||
if (p->error)
|
||||
{
|
||||
const auto addr = p->ip.address();
|
||||
const QString endpoint = (addr.is_v6() ? u"[%1]:%2"_qs : u"%1:%2"_qs)
|
||||
const QString endpoint = (addr.is_v6() ? u"[%1]:%2"_s : u"%1:%2"_s)
|
||||
.arg(QString::fromStdString(addr.to_string()), QString::number(p->ip.port()));
|
||||
LogMsg(tr("SOCKS5 proxy error. Address: %1. Message: \"%2\".")
|
||||
.arg(endpoint, QString::fromLocal8Bit(p->error.message().c_str()))
|
||||
@ -6108,10 +6108,10 @@ void SessionImpl::saveStatistics() const
|
||||
return;
|
||||
|
||||
const QVariantHash stats {
|
||||
{u"AlltimeDL"_qs, m_status.allTimeDownload},
|
||||
{u"AlltimeUL"_qs, m_status.allTimeUpload}};
|
||||
std::unique_ptr<QSettings> settings = Profile::instance()->applicationSettings(u"qBittorrent-data"_qs);
|
||||
settings->setValue(u"Stats/AllStats"_qs, stats);
|
||||
{u"AlltimeDL"_s, m_status.allTimeDownload},
|
||||
{u"AlltimeUL"_s, m_status.allTimeUpload}};
|
||||
std::unique_ptr<QSettings> settings = Profile::instance()->applicationSettings(u"qBittorrent-data"_s);
|
||||
settings->setValue(u"Stats/AllStats"_s, stats);
|
||||
|
||||
m_statisticsLastUpdateTimer.start();
|
||||
m_isStatisticsDirty = false;
|
||||
@ -6119,9 +6119,9 @@ void SessionImpl::saveStatistics() const
|
||||
|
||||
void SessionImpl::loadStatistics()
|
||||
{
|
||||
const std::unique_ptr<QSettings> settings = Profile::instance()->applicationSettings(u"qBittorrent-data"_qs);
|
||||
const QVariantHash value = settings->value(u"Stats/AllStats"_qs).toHash();
|
||||
const std::unique_ptr<QSettings> settings = Profile::instance()->applicationSettings(u"qBittorrent-data"_s);
|
||||
const QVariantHash value = settings->value(u"Stats/AllStats"_s).toHash();
|
||||
|
||||
m_previouslyDownloaded = value[u"AlltimeDL"_qs].toLongLong();
|
||||
m_previouslyUploaded = value[u"AlltimeUL"_qs].toLongLong();
|
||||
m_previouslyDownloaded = value[u"AlltimeDL"_s].toLongLong();
|
||||
m_previouslyUploaded = value[u"AlltimeUL"_s].toLongLong();
|
||||
}
|
||||
|
@ -330,8 +330,8 @@ TorrentImpl::TorrentImpl(SessionImpl *session, lt::session *nativeSession
|
||||
|
||||
// Remove .unwanted directory if empty
|
||||
const Path newPath = spath / newRelPath;
|
||||
qDebug() << "Attempting to remove \".unwanted\" folder at " << (newPath / Path(u".unwanted"_qs)).toString();
|
||||
Utils::Fs::rmdir(newPath / Path(u".unwanted"_qs));
|
||||
qDebug() << "Attempting to remove \".unwanted\" folder at " << (newPath / Path(u".unwanted"_s)).toString();
|
||||
Utils::Fs::rmdir(newPath / Path(u".unwanted"_s));
|
||||
}
|
||||
}
|
||||
// == END UPGRADE CODE ==
|
||||
@ -2143,7 +2143,7 @@ void TorrentImpl::handleMetadataReceivedAlert(const lt::metadata_received_alert
|
||||
|
||||
void TorrentImpl::handlePerformanceAlert(const lt::performance_alert *p) const
|
||||
{
|
||||
LogMsg((tr("Performance alert: %1. More info: %2").arg(QString::fromStdString(p->message()), u"https://libtorrent.org/reference-Alerts.html#enum-performance-warning-t"_qs))
|
||||
LogMsg((tr("Performance alert: %1. More info: %2").arg(QString::fromStdString(p->message()), u"https://libtorrent.org/reference-Alerts.html#enum-performance-warning-t"_s))
|
||||
, Log::INFO);
|
||||
}
|
||||
|
||||
@ -2480,7 +2480,7 @@ void TorrentImpl::flushCache() const
|
||||
|
||||
QString TorrentImpl::createMagnetURI() const
|
||||
{
|
||||
QString ret = u"magnet:?"_qs;
|
||||
QString ret = u"magnet:?"_s;
|
||||
|
||||
const SHA1Hash infoHash1 = infoHash().v1();
|
||||
if (infoHash1.isValid())
|
||||
|
@ -53,23 +53,23 @@ namespace
|
||||
// constants
|
||||
const int PEER_ID_SIZE = 20;
|
||||
|
||||
const QString ANNOUNCE_REQUEST_PATH = u"/announce"_qs;
|
||||
const QString ANNOUNCE_REQUEST_PATH = u"/announce"_s;
|
||||
|
||||
const QString ANNOUNCE_REQUEST_COMPACT = u"compact"_qs;
|
||||
const QString ANNOUNCE_REQUEST_INFO_HASH = u"info_hash"_qs;
|
||||
const QString ANNOUNCE_REQUEST_IP = u"ip"_qs;
|
||||
const QString ANNOUNCE_REQUEST_LEFT = u"left"_qs;
|
||||
const QString ANNOUNCE_REQUEST_NO_PEER_ID = u"no_peer_id"_qs;
|
||||
const QString ANNOUNCE_REQUEST_NUM_WANT = u"numwant"_qs;
|
||||
const QString ANNOUNCE_REQUEST_PEER_ID = u"peer_id"_qs;
|
||||
const QString ANNOUNCE_REQUEST_PORT = u"port"_qs;
|
||||
const QString ANNOUNCE_REQUEST_COMPACT = u"compact"_s;
|
||||
const QString ANNOUNCE_REQUEST_INFO_HASH = u"info_hash"_s;
|
||||
const QString ANNOUNCE_REQUEST_IP = u"ip"_s;
|
||||
const QString ANNOUNCE_REQUEST_LEFT = u"left"_s;
|
||||
const QString ANNOUNCE_REQUEST_NO_PEER_ID = u"no_peer_id"_s;
|
||||
const QString ANNOUNCE_REQUEST_NUM_WANT = u"numwant"_s;
|
||||
const QString ANNOUNCE_REQUEST_PEER_ID = u"peer_id"_s;
|
||||
const QString ANNOUNCE_REQUEST_PORT = u"port"_s;
|
||||
|
||||
const QString ANNOUNCE_REQUEST_EVENT = u"event"_qs;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_COMPLETED = u"completed"_qs;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_EMPTY = u"empty"_qs;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_STARTED = u"started"_qs;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_STOPPED = u"stopped"_qs;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_PAUSED = u"paused"_qs;
|
||||
const QString ANNOUNCE_REQUEST_EVENT = u"event"_s;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_COMPLETED = u"completed"_s;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_EMPTY = u"empty"_s;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_STARTED = u"started"_s;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_STOPPED = u"stopped"_s;
|
||||
const QString ANNOUNCE_REQUEST_EVENT_PAUSED = u"paused"_s;
|
||||
|
||||
const char ANNOUNCE_RESPONSE_COMPLETE[] = "complete";
|
||||
const char ANNOUNCE_RESPONSE_EXTERNAL_IP[] = "external ip";
|
||||
@ -297,32 +297,32 @@ void Tracker::processAnnounceRequest()
|
||||
// 1. info_hash
|
||||
const auto infoHashIter = queryParams.find(ANNOUNCE_REQUEST_INFO_HASH);
|
||||
if (infoHashIter == queryParams.end())
|
||||
throw TrackerError(u"Missing \"info_hash\" parameter"_qs);
|
||||
throw TrackerError(u"Missing \"info_hash\" parameter"_s);
|
||||
|
||||
const auto torrentID = TorrentID::fromString(QString::fromLatin1(infoHashIter->toHex()));
|
||||
if (!torrentID.isValid())
|
||||
throw TrackerError(u"Invalid \"info_hash\" parameter"_qs);
|
||||
throw TrackerError(u"Invalid \"info_hash\" parameter"_s);
|
||||
|
||||
announceReq.torrentID = torrentID;
|
||||
|
||||
// 2. peer_id
|
||||
const auto peerIdIter = queryParams.find(ANNOUNCE_REQUEST_PEER_ID);
|
||||
if (peerIdIter == queryParams.end())
|
||||
throw TrackerError(u"Missing \"peer_id\" parameter"_qs);
|
||||
throw TrackerError(u"Missing \"peer_id\" parameter"_s);
|
||||
|
||||
if (peerIdIter->size() > PEER_ID_SIZE)
|
||||
throw TrackerError(u"Invalid \"peer_id\" parameter"_qs);
|
||||
throw TrackerError(u"Invalid \"peer_id\" parameter"_s);
|
||||
|
||||
announceReq.peer.peerId = *peerIdIter;
|
||||
|
||||
// 3. port
|
||||
const auto portIter = queryParams.find(ANNOUNCE_REQUEST_PORT);
|
||||
if (portIter == queryParams.end())
|
||||
throw TrackerError(u"Missing \"port\" parameter"_qs);
|
||||
throw TrackerError(u"Missing \"port\" parameter"_s);
|
||||
|
||||
const ushort portNum = portIter->toUShort();
|
||||
if (portNum == 0)
|
||||
throw TrackerError(u"Invalid \"port\" parameter"_qs);
|
||||
throw TrackerError(u"Invalid \"port\" parameter"_s);
|
||||
|
||||
announceReq.peer.port = portNum;
|
||||
|
||||
@ -332,7 +332,7 @@ void Tracker::processAnnounceRequest()
|
||||
{
|
||||
const int num = numWantIter->toInt();
|
||||
if (num < 0)
|
||||
throw TrackerError(u"Invalid \"numwant\" parameter"_qs);
|
||||
throw TrackerError(u"Invalid \"numwant\" parameter"_s);
|
||||
announceReq.numwant = num;
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ void Tracker::processAnnounceRequest()
|
||||
}
|
||||
else
|
||||
{
|
||||
throw TrackerError(u"Invalid \"event\" parameter"_qs);
|
||||
throw TrackerError(u"Invalid \"event\" parameter"_s);
|
||||
}
|
||||
|
||||
prepareAnnounceResponse(announceReq);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2016 Mike Tzou
|
||||
* Copyright (C) 2016-2023 Mike Tzou (Chocobo1)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -48,12 +48,18 @@ constexpr typename std::add_const_t<T> asConst(T &&t) noexcept { return std::for
|
||||
template <typename T>
|
||||
void asConst(const T &&) = delete;
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
// https://doc.qt.io/qt-6/qstring.html#operator-22-22_qs
|
||||
inline QString operator"" _qs(const char16_t *str, const std::size_t size)
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
|
||||
// https://doc.qt.io/qt-6/qstring.html#operator-22-22_s
|
||||
inline QString operator"" _s(const char16_t *str, const std::size_t size)
|
||||
{
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
return QString::fromRawData(reinterpret_cast<const QChar *>(str), static_cast<int>(size));
|
||||
#else
|
||||
return operator""_qs(str, size);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
#endif
|
||||
|
||||
inline const QString TORRENT_FILE_EXTENSION = u".torrent"_qs;
|
||||
inline const QString TORRENT_FILE_EXTENSION = u".torrent"_s;
|
||||
|
@ -82,8 +82,8 @@ void Connection::read()
|
||||
LogMsg(tr("Http request size exceeds limitation, closing socket. Limit: %1, IP: %2")
|
||||
.arg(bufferLimit).arg(m_socket->peerAddress().toString()), Log::WARNING);
|
||||
|
||||
Response resp(413, u"Payload Too Large"_qs);
|
||||
resp.headers[HEADER_CONNECTION] = u"close"_qs;
|
||||
Response resp(413, u"Payload Too Large"_s);
|
||||
resp.headers[HEADER_CONNECTION] = u"close"_s;
|
||||
|
||||
sendResponse(resp);
|
||||
m_socket->close();
|
||||
@ -96,8 +96,8 @@ void Connection::read()
|
||||
LogMsg(tr("Bad Http request, closing socket. IP: %1")
|
||||
.arg(m_socket->peerAddress().toString()), Log::WARNING);
|
||||
|
||||
Response resp(400, u"Bad Request"_qs);
|
||||
resp.headers[HEADER_CONNECTION] = u"close"_qs;
|
||||
Response resp(400, u"Bad Request"_s);
|
||||
resp.headers[HEADER_CONNECTION] = u"close"_s;
|
||||
|
||||
sendResponse(resp);
|
||||
m_socket->close();
|
||||
@ -110,10 +110,10 @@ void Connection::read()
|
||||
|
||||
Response resp = m_requestHandler->processRequest(result.request, env);
|
||||
|
||||
if (acceptsGzipEncoding(result.request.headers[u"accept-encoding"_qs]))
|
||||
resp.headers[HEADER_CONTENT_ENCODING] = u"gzip"_qs;
|
||||
if (acceptsGzipEncoding(result.request.headers[u"accept-encoding"_s]))
|
||||
resp.headers[HEADER_CONTENT_ENCODING] = u"gzip"_s;
|
||||
|
||||
resp.headers[HEADER_CONNECTION] = u"keep-alive"_qs;
|
||||
resp.headers[HEADER_CONNECTION] = u"keep-alive"_s;
|
||||
|
||||
sendResponse(resp);
|
||||
m_receivedData = m_receivedData.mid(result.frameSize);
|
||||
@ -176,11 +176,11 @@ bool Connection::acceptsGzipEncoding(QString codings)
|
||||
if (list.isEmpty())
|
||||
return false;
|
||||
|
||||
const bool canGzip = isCodingAvailable(list, u"gzip"_qs);
|
||||
const bool canGzip = isCodingAvailable(list, u"gzip"_s);
|
||||
if (canGzip)
|
||||
return true;
|
||||
|
||||
const bool canAny = isCodingAvailable(list, u"*"_qs);
|
||||
const bool canAny = isCodingAvailable(list, u"*"_s);
|
||||
if (canAny)
|
||||
return true;
|
||||
|
||||
|
@ -48,41 +48,41 @@ QString HTTPError::statusText() const
|
||||
}
|
||||
|
||||
BadRequestHTTPError::BadRequestHTTPError(const QString &message)
|
||||
: HTTPError(400, u"Bad Request"_qs, message)
|
||||
: HTTPError(400, u"Bad Request"_s, message)
|
||||
{
|
||||
}
|
||||
|
||||
UnauthorizedHTTPError::UnauthorizedHTTPError(const QString &message)
|
||||
: HTTPError(401, u"Unauthorized"_qs, message)
|
||||
: HTTPError(401, u"Unauthorized"_s, message)
|
||||
{
|
||||
}
|
||||
|
||||
ForbiddenHTTPError::ForbiddenHTTPError(const QString &message)
|
||||
: HTTPError(403, u"Forbidden"_qs, message)
|
||||
: HTTPError(403, u"Forbidden"_s, message)
|
||||
{
|
||||
}
|
||||
|
||||
NotFoundHTTPError::NotFoundHTTPError(const QString &message)
|
||||
: HTTPError(404, u"Not Found"_qs, message)
|
||||
: HTTPError(404, u"Not Found"_s, message)
|
||||
{
|
||||
}
|
||||
|
||||
MethodNotAllowedHTTPError::MethodNotAllowedHTTPError(const QString &message)
|
||||
: HTTPError(405, u"Method Not Allowed"_qs, message)
|
||||
: HTTPError(405, u"Method Not Allowed"_s, message)
|
||||
{
|
||||
}
|
||||
|
||||
ConflictHTTPError::ConflictHTTPError(const QString &message)
|
||||
: HTTPError(409, u"Conflict"_qs, message)
|
||||
: HTTPError(409, u"Conflict"_s, message)
|
||||
{
|
||||
}
|
||||
|
||||
UnsupportedMediaTypeHTTPError::UnsupportedMediaTypeHTTPError(const QString &message)
|
||||
: HTTPError(415, u"Unsupported Media Type"_qs, message)
|
||||
: HTTPError(415, u"Unsupported Media Type"_s, message)
|
||||
{
|
||||
}
|
||||
|
||||
InternalServerErrorHTTPError::InternalServerErrorHTTPError(const QString &message)
|
||||
: HTTPError(500, u"Internal Server Error"_qs, message)
|
||||
: HTTPError(500, u"Internal Server Error"_s, message)
|
||||
{
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ bool RequestParser::parseRequestLine(const QString &line)
|
||||
{
|
||||
// [rfc7230] 3.1.1. Request Line
|
||||
|
||||
const QRegularExpression re(u"^([A-Z]+)\\s+(\\S+)\\s+HTTP\\/(\\d\\.\\d)$"_qs);
|
||||
const QRegularExpression re(u"^([A-Z]+)\\s+(\\S+)\\s+HTTP\\/(\\d\\.\\d)$"_s);
|
||||
const QRegularExpressionMatch match = re.match(line);
|
||||
|
||||
if (!match.hasMatch())
|
||||
@ -264,7 +264,7 @@ bool RequestParser::parsePostMessage(const QByteArray &data)
|
||||
// [rfc2046] 5.1.1. Common Syntax
|
||||
|
||||
// find boundary delimiter
|
||||
const QString boundaryFieldName = u"boundary="_qs;
|
||||
const QString boundaryFieldName = u"boundary="_s;
|
||||
const int idx = contentType.indexOf(boundaryFieldName);
|
||||
if (idx < 0)
|
||||
{
|
||||
@ -343,8 +343,8 @@ bool RequestParser::parseFormData(const QByteArray &data)
|
||||
}
|
||||
|
||||
// pick data
|
||||
const QString filename = u"filename"_qs;
|
||||
const QString name = u"name"_qs;
|
||||
const QString filename = u"filename"_s;
|
||||
const QString name = u"name"_s;
|
||||
|
||||
if (headersMap.contains(filename))
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ namespace Http
|
||||
class ResponseBuilder
|
||||
{
|
||||
public:
|
||||
void status(uint code = 200, const QString &text = u"OK"_qs);
|
||||
void status(uint code = 200, const QString &text = u"OK"_s);
|
||||
void setHeader(const Header &header);
|
||||
void print(const QString &text, const QString &type = CONTENT_TYPE_HTML);
|
||||
void print(const QByteArray &data, const QString &type = CONTENT_TYPE_HTML);
|
||||
|
@ -74,7 +74,7 @@ QString Http::httpDate()
|
||||
// [RFC 7231] 7.1.1.1. Date/Time Formats
|
||||
// example: "Sun, 06 Nov 1994 08:49:37 GMT"
|
||||
|
||||
return QLocale::c().toString(QDateTime::currentDateTimeUtc(), u"ddd, dd MMM yyyy HH:mm:ss"_qs)
|
||||
return QLocale::c().toString(QDateTime::currentDateTimeUtc(), u"ddd, dd MMM yyyy HH:mm:ss"_s)
|
||||
.append(u" GMT");
|
||||
}
|
||||
|
||||
@ -106,5 +106,5 @@ void Http::compressContent(Response &response)
|
||||
return;
|
||||
|
||||
response.content = compressedData;
|
||||
response.headers[HEADER_CONTENT_ENCODING] = u"gzip"_qs;
|
||||
response.headers[HEADER_CONTENT_ENCODING] = u"gzip"_s;
|
||||
}
|
||||
|
@ -55,28 +55,28 @@ namespace
|
||||
|
||||
QList<QSslCipher> safeCipherList()
|
||||
{
|
||||
const QStringList badCiphers {u"idea"_qs, u"rc4"_qs};
|
||||
const QStringList badCiphers {u"idea"_s, u"rc4"_s};
|
||||
// Contains Ciphersuites that use RSA for the Key Exchange but they don't mention it in their name
|
||||
const QStringList badRSAShorthandSuites {
|
||||
u"AES256-GCM-SHA384"_qs, u"AES128-GCM-SHA256"_qs, u"AES256-SHA256"_qs,
|
||||
u"AES128-SHA256"_qs, u"AES256-SHA"_qs, u"AES128-SHA"_qs};
|
||||
u"AES256-GCM-SHA384"_s, u"AES128-GCM-SHA256"_s, u"AES256-SHA256"_s,
|
||||
u"AES128-SHA256"_s, u"AES256-SHA"_s, u"AES128-SHA"_s};
|
||||
// Contains Ciphersuites that use AES CBC mode but they don't mention it in their name
|
||||
const QStringList badAESShorthandSuites {
|
||||
u"ECDHE-ECDSA-AES256-SHA384"_qs, u"ECDHE-RSA-AES256-SHA384"_qs, u"DHE-RSA-AES256-SHA256"_qs,
|
||||
u"ECDHE-ECDSA-AES128-SHA256"_qs, u"ECDHE-RSA-AES128-SHA256"_qs, u"DHE-RSA-AES128-SHA256"_qs,
|
||||
u"ECDHE-ECDSA-AES256-SHA"_qs, u"ECDHE-RSA-AES256-SHA"_qs, u"DHE-RSA-AES256-SHA"_qs,
|
||||
u"ECDHE-ECDSA-AES128-SHA"_qs, u"ECDHE-RSA-AES128-SHA"_qs, u"DHE-RSA-AES128-SHA"_qs};
|
||||
u"ECDHE-ECDSA-AES256-SHA384"_s, u"ECDHE-RSA-AES256-SHA384"_s, u"DHE-RSA-AES256-SHA256"_s,
|
||||
u"ECDHE-ECDSA-AES128-SHA256"_s, u"ECDHE-RSA-AES128-SHA256"_s, u"DHE-RSA-AES128-SHA256"_s,
|
||||
u"ECDHE-ECDSA-AES256-SHA"_s, u"ECDHE-RSA-AES256-SHA"_s, u"DHE-RSA-AES256-SHA"_s,
|
||||
u"ECDHE-ECDSA-AES128-SHA"_s, u"ECDHE-RSA-AES128-SHA"_s, u"DHE-RSA-AES128-SHA"_s};
|
||||
const QList<QSslCipher> allCiphers {QSslConfiguration::supportedCiphers()};
|
||||
QList<QSslCipher> safeCiphers;
|
||||
std::copy_if(allCiphers.cbegin(), allCiphers.cend(), std::back_inserter(safeCiphers),
|
||||
[&badCiphers, &badRSAShorthandSuites, &badAESShorthandSuites](const QSslCipher &cipher)
|
||||
{
|
||||
const QString name = cipher.name();
|
||||
if (name.contains(u"-cbc-"_qs, Qt::CaseInsensitive) // AES CBC mode is considered vulnerable to BEAST attack
|
||||
|| name.startsWith(u"adh-"_qs, Qt::CaseInsensitive) // Key Exchange: Diffie-Hellman, doesn't support Perfect Forward Secrecy
|
||||
|| name.startsWith(u"aecdh-"_qs, Qt::CaseInsensitive) // Key Exchange: Elliptic Curve Diffie-Hellman, doesn't support Perfect Forward Secrecy
|
||||
|| name.startsWith(u"psk-"_qs, Qt::CaseInsensitive) // Key Exchange: Pre-Shared Key, doesn't support Perfect Forward Secrecy
|
||||
|| name.startsWith(u"rsa-"_qs, Qt::CaseInsensitive) // Key Exchange: Rivest Shamir Adleman (RSA), doesn't support Perfect Forward Secrecy
|
||||
if (name.contains(u"-cbc-"_s, Qt::CaseInsensitive) // AES CBC mode is considered vulnerable to BEAST attack
|
||||
|| name.startsWith(u"adh-"_s, Qt::CaseInsensitive) // Key Exchange: Diffie-Hellman, doesn't support Perfect Forward Secrecy
|
||||
|| name.startsWith(u"aecdh-"_s, Qt::CaseInsensitive) // Key Exchange: Elliptic Curve Diffie-Hellman, doesn't support Perfect Forward Secrecy
|
||||
|| name.startsWith(u"psk-"_s, Qt::CaseInsensitive) // Key Exchange: Pre-Shared Key, doesn't support Perfect Forward Secrecy
|
||||
|| name.startsWith(u"rsa-"_s, Qt::CaseInsensitive) // Key Exchange: Rivest Shamir Adleman (RSA), doesn't support Perfect Forward Secrecy
|
||||
|| badRSAShorthandSuites.contains(name, Qt::CaseInsensitive)
|
||||
|| badAESShorthandSuites.contains(name, Qt::CaseInsensitive))
|
||||
{
|
||||
|
@ -37,42 +37,42 @@
|
||||
|
||||
namespace Http
|
||||
{
|
||||
inline const QString METHOD_GET = u"GET"_qs;
|
||||
inline const QString METHOD_POST = u"POST"_qs;
|
||||
inline const QString METHOD_GET = u"GET"_s;
|
||||
inline const QString METHOD_POST = u"POST"_s;
|
||||
|
||||
inline const QString HEADER_CACHE_CONTROL = u"cache-control"_qs;
|
||||
inline const QString HEADER_CONNECTION = u"connection"_qs;
|
||||
inline const QString HEADER_CONTENT_DISPOSITION = u"content-disposition"_qs;
|
||||
inline const QString HEADER_CONTENT_ENCODING = u"content-encoding"_qs;
|
||||
inline const QString HEADER_CONTENT_LENGTH = u"content-length"_qs;
|
||||
inline const QString HEADER_CONTENT_SECURITY_POLICY = u"content-security-policy"_qs;
|
||||
inline const QString HEADER_CONTENT_TYPE = u"content-type"_qs;
|
||||
inline const QString HEADER_CROSS_ORIGIN_OPENER_POLICY = u"cross-origin-opener-policy"_qs;
|
||||
inline const QString HEADER_DATE = u"date"_qs;
|
||||
inline const QString HEADER_HOST = u"host"_qs;
|
||||
inline const QString HEADER_ORIGIN = u"origin"_qs;
|
||||
inline const QString HEADER_REFERER = u"referer"_qs;
|
||||
inline const QString HEADER_REFERRER_POLICY = u"referrer-policy"_qs;
|
||||
inline const QString HEADER_SET_COOKIE = u"set-cookie"_qs;
|
||||
inline const QString HEADER_X_CONTENT_TYPE_OPTIONS = u"x-content-type-options"_qs;
|
||||
inline const QString HEADER_X_FORWARDED_FOR = u"x-forwarded-for"_qs;
|
||||
inline const QString HEADER_X_FORWARDED_HOST = u"x-forwarded-host"_qs;
|
||||
inline const QString HEADER_X_FRAME_OPTIONS = u"x-frame-options"_qs;
|
||||
inline const QString HEADER_X_XSS_PROTECTION = u"x-xss-protection"_qs;
|
||||
inline const QString HEADER_CACHE_CONTROL = u"cache-control"_s;
|
||||
inline const QString HEADER_CONNECTION = u"connection"_s;
|
||||
inline const QString HEADER_CONTENT_DISPOSITION = u"content-disposition"_s;
|
||||
inline const QString HEADER_CONTENT_ENCODING = u"content-encoding"_s;
|
||||
inline const QString HEADER_CONTENT_LENGTH = u"content-length"_s;
|
||||
inline const QString HEADER_CONTENT_SECURITY_POLICY = u"content-security-policy"_s;
|
||||
inline const QString HEADER_CONTENT_TYPE = u"content-type"_s;
|
||||
inline const QString HEADER_CROSS_ORIGIN_OPENER_POLICY = u"cross-origin-opener-policy"_s;
|
||||
inline const QString HEADER_DATE = u"date"_s;
|
||||
inline const QString HEADER_HOST = u"host"_s;
|
||||
inline const QString HEADER_ORIGIN = u"origin"_s;
|
||||
inline const QString HEADER_REFERER = u"referer"_s;
|
||||
inline const QString HEADER_REFERRER_POLICY = u"referrer-policy"_s;
|
||||
inline const QString HEADER_SET_COOKIE = u"set-cookie"_s;
|
||||
inline const QString HEADER_X_CONTENT_TYPE_OPTIONS = u"x-content-type-options"_s;
|
||||
inline const QString HEADER_X_FORWARDED_FOR = u"x-forwarded-for"_s;
|
||||
inline const QString HEADER_X_FORWARDED_HOST = u"x-forwarded-host"_s;
|
||||
inline const QString HEADER_X_FRAME_OPTIONS = u"x-frame-options"_s;
|
||||
inline const QString HEADER_X_XSS_PROTECTION = u"x-xss-protection"_s;
|
||||
|
||||
inline const QString HEADER_REQUEST_METHOD_GET = u"GET"_qs;
|
||||
inline const QString HEADER_REQUEST_METHOD_HEAD = u"HEAD"_qs;
|
||||
inline const QString HEADER_REQUEST_METHOD_POST = u"POST"_qs;
|
||||
inline const QString HEADER_REQUEST_METHOD_GET = u"GET"_s;
|
||||
inline const QString HEADER_REQUEST_METHOD_HEAD = u"HEAD"_s;
|
||||
inline const QString HEADER_REQUEST_METHOD_POST = u"POST"_s;
|
||||
|
||||
inline const QString CONTENT_TYPE_HTML = u"text/html"_qs;
|
||||
inline const QString CONTENT_TYPE_CSS = u"text/css"_qs;
|
||||
inline const QString CONTENT_TYPE_TXT = u"text/plain; charset=UTF-8"_qs;
|
||||
inline const QString CONTENT_TYPE_JS = u"application/javascript"_qs;
|
||||
inline const QString CONTENT_TYPE_JSON = u"application/json"_qs;
|
||||
inline const QString CONTENT_TYPE_GIF = u"image/gif"_qs;
|
||||
inline const QString CONTENT_TYPE_PNG = u"image/png"_qs;
|
||||
inline const QString CONTENT_TYPE_FORM_ENCODED = u"application/x-www-form-urlencoded"_qs;
|
||||
inline const QString CONTENT_TYPE_FORM_DATA = u"multipart/form-data"_qs;
|
||||
inline const QString CONTENT_TYPE_HTML = u"text/html"_s;
|
||||
inline const QString CONTENT_TYPE_CSS = u"text/css"_s;
|
||||
inline const QString CONTENT_TYPE_TXT = u"text/plain; charset=UTF-8"_s;
|
||||
inline const QString CONTENT_TYPE_JS = u"application/javascript"_s;
|
||||
inline const QString CONTENT_TYPE_JSON = u"application/json"_s;
|
||||
inline const QString CONTENT_TYPE_GIF = u"image/gif"_s;
|
||||
inline const QString CONTENT_TYPE_PNG = u"image/png"_s;
|
||||
inline const QString CONTENT_TYPE_FORM_ENCODED = u"application/x-www-form-urlencoded"_s;
|
||||
inline const QString CONTENT_TYPE_FORM_DATA = u"multipart/form-data"_s;
|
||||
|
||||
// portability: "\r\n" doesn't guarantee mapping to the correct symbol
|
||||
inline const char CRLF[] = {0x0D, 0x0A, '\0'};
|
||||
@ -124,7 +124,7 @@ namespace Http
|
||||
HeaderMap headers;
|
||||
QByteArray content;
|
||||
|
||||
Response(uint code = 200, const QString &text = u"OK"_qs)
|
||||
Response(uint code = 200, const QString &text = u"OK"_s)
|
||||
: status {code, text}
|
||||
{
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void DNSUpdater::checkPublicIP()
|
||||
Q_ASSERT(m_state == OK);
|
||||
|
||||
DownloadManager::instance()->download(
|
||||
DownloadRequest(u"http://checkip.dyndns.org"_qs).userAgent(QStringLiteral("qBittorrent/" QBT_VERSION_2))
|
||||
DownloadRequest(u"http://checkip.dyndns.org"_s).userAgent(QStringLiteral("qBittorrent/" QBT_VERSION_2))
|
||||
, Preferences::instance()->useProxyForGeneralPurposes(), this, &DNSUpdater::ipRequestFinished);
|
||||
|
||||
m_lastIPCheckTime = QDateTime::currentDateTime();
|
||||
@ -93,7 +93,7 @@ void DNSUpdater::ipRequestFinished(const DownloadResult &result)
|
||||
}
|
||||
|
||||
// Parse response
|
||||
const QRegularExpressionMatch ipRegexMatch = QRegularExpression(u"Current IP Address:\\s+([^<]+)</body>"_qs).match(QString::fromUtf8(result.data));
|
||||
const QRegularExpressionMatch ipRegexMatch = QRegularExpression(u"Current IP Address:\\s+([^<]+)</body>"_s).match(QString::fromUtf8(result.data));
|
||||
if (ipRegexMatch.hasMatch())
|
||||
{
|
||||
QString ipStr = ipRegexMatch.captured(1);
|
||||
@ -134,9 +134,9 @@ QString DNSUpdater::getUpdateUrl() const
|
||||
{
|
||||
QUrl url;
|
||||
#ifdef QT_NO_OPENSSL
|
||||
url.setScheme(u"http"_qs);
|
||||
url.setScheme(u"http"_s);
|
||||
#else
|
||||
url.setScheme(u"https"_qs);
|
||||
url.setScheme(u"https"_s);
|
||||
#endif
|
||||
url.setUserName(m_username);
|
||||
url.setPassword(m_password);
|
||||
@ -146,21 +146,21 @@ QString DNSUpdater::getUpdateUrl() const
|
||||
switch (m_service)
|
||||
{
|
||||
case DNS::Service::DynDNS:
|
||||
url.setHost(u"members.dyndns.org"_qs);
|
||||
url.setHost(u"members.dyndns.org"_s);
|
||||
break;
|
||||
case DNS::Service::NoIP:
|
||||
url.setHost(u"dynupdate.no-ip.com"_qs);
|
||||
url.setHost(u"dynupdate.no-ip.com"_s);
|
||||
break;
|
||||
default:
|
||||
qWarning() << "Unrecognized Dynamic DNS service!";
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
url.setPath(u"/nic/update"_qs);
|
||||
url.setPath(u"/nic/update"_s);
|
||||
|
||||
QUrlQuery urlQuery(url);
|
||||
urlQuery.addQueryItem(u"hostname"_qs, m_domain);
|
||||
urlQuery.addQueryItem(u"myip"_qs, m_lastIP.toString());
|
||||
urlQuery.addQueryItem(u"hostname"_s, m_domain);
|
||||
urlQuery.addQueryItem(u"myip"_s, m_lastIP.toString());
|
||||
url.setQuery(urlQuery);
|
||||
Q_ASSERT(url.isValid());
|
||||
|
||||
@ -223,7 +223,7 @@ void DNSUpdater::processIPUpdateReply(const QString &reply)
|
||||
|
||||
if (code == u"!donator")
|
||||
{
|
||||
LogMsg(tr("Dynamic DNS error: %1 was returned by the service, please submit a bug report at https://bugs.qbittorrent.org.").arg(u"!donator"_qs),
|
||||
LogMsg(tr("Dynamic DNS error: %1 was returned by the service, please submit a bug report at https://bugs.qbittorrent.org.").arg(u"!donator"_s),
|
||||
Log::CRITICAL);
|
||||
m_state = FATAL;
|
||||
return;
|
||||
@ -250,7 +250,7 @@ void DNSUpdater::updateCredentials()
|
||||
if (m_domain != pref->getDynDomainName())
|
||||
{
|
||||
m_domain = pref->getDynDomainName();
|
||||
const QRegularExpressionMatch domainRegexMatch = QRegularExpression(u"^(?:(?!\\d|-)[a-zA-Z0-9\\-]{1,63}\\.)+[a-zA-Z]{2,}$"_qs).match(m_domain);
|
||||
const QRegularExpressionMatch domainRegexMatch = QRegularExpression(u"^(?:(?!\\d|-)[a-zA-Z0-9\\-]{1,63}\\.)+[a-zA-Z]{2,}$"_s).match(m_domain);
|
||||
if (!domainRegexMatch.hasMatch())
|
||||
{
|
||||
LogMsg(tr("Dynamic DNS error: supplied domain name is invalid."), Log::CRITICAL);
|
||||
@ -301,9 +301,9 @@ QUrl DNSUpdater::getRegistrationUrl(const DNS::Service service)
|
||||
switch (service)
|
||||
{
|
||||
case DNS::Service::DynDNS:
|
||||
return {u"https://account.dyn.com/entrance/"_qs};
|
||||
return {u"https://account.dyn.com/entrance/"_s};
|
||||
case DNS::Service::NoIP:
|
||||
return {u"https://www.noip.com/remote-access"_qs};
|
||||
return {u"https://www.noip.com/remote-access"_s};
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
break;
|
||||
|
@ -190,7 +190,7 @@ QString GeoIPDatabase::lookup(const QHostAddress &hostAddr) const
|
||||
const QVariant val = readDataField(tmp);
|
||||
if (val.userType() == QMetaType::QVariantHash)
|
||||
{
|
||||
country = val.toHash()[u"country"_qs].toHash()[u"iso_code"_qs].toString();
|
||||
country = val.toHash()[u"country"_s].toHash()[u"iso_code"_s].toString();
|
||||
m_countries[id] = country;
|
||||
}
|
||||
}
|
||||
@ -233,26 +233,26 @@ bool GeoIPDatabase::parseMetadata(const QVariantHash &metadata, QString &error)
|
||||
|
||||
qDebug() << "Parsing MaxMindDB metadata...";
|
||||
|
||||
CHECK_METADATA_REQ(u"binary_format_major_version"_qs, UShort);
|
||||
CHECK_METADATA_REQ(u"binary_format_minor_version"_qs, UShort);
|
||||
const uint versionMajor = metadata.value(u"binary_format_major_version"_qs).toUInt();
|
||||
const uint versionMinor = metadata.value(u"binary_format_minor_version"_qs).toUInt();
|
||||
CHECK_METADATA_REQ(u"binary_format_major_version"_s, UShort);
|
||||
CHECK_METADATA_REQ(u"binary_format_minor_version"_s, UShort);
|
||||
const uint versionMajor = metadata.value(u"binary_format_major_version"_s).toUInt();
|
||||
const uint versionMinor = metadata.value(u"binary_format_minor_version"_s).toUInt();
|
||||
if (versionMajor != 2)
|
||||
{
|
||||
error = tr("Unsupported database version: %1.%2").arg(versionMajor).arg(versionMinor);
|
||||
return false;
|
||||
}
|
||||
|
||||
CHECK_METADATA_REQ(u"ip_version"_qs, UShort);
|
||||
m_ipVersion = metadata.value(u"ip_version"_qs).value<quint16>();
|
||||
CHECK_METADATA_REQ(u"ip_version"_s, UShort);
|
||||
m_ipVersion = metadata.value(u"ip_version"_s).value<quint16>();
|
||||
if (m_ipVersion != 6)
|
||||
{
|
||||
error = tr("Unsupported IP version: %1").arg(m_ipVersion);
|
||||
return false;
|
||||
}
|
||||
|
||||
CHECK_METADATA_REQ(u"record_size"_qs, UShort);
|
||||
m_recordSize = metadata.value(u"record_size"_qs).value<quint16>();
|
||||
CHECK_METADATA_REQ(u"record_size"_s, UShort);
|
||||
m_recordSize = metadata.value(u"record_size"_s).value<quint16>();
|
||||
if (m_recordSize != 24)
|
||||
{
|
||||
error = tr("Unsupported record size: %1").arg(m_recordSize);
|
||||
@ -261,18 +261,18 @@ bool GeoIPDatabase::parseMetadata(const QVariantHash &metadata, QString &error)
|
||||
m_nodeSize = m_recordSize / 4;
|
||||
m_recordBytes = m_nodeSize / 2;
|
||||
|
||||
CHECK_METADATA_REQ(u"node_count"_qs, UInt);
|
||||
m_nodeCount = metadata.value(u"node_count"_qs).value<quint32>();
|
||||
CHECK_METADATA_REQ(u"node_count"_s, UInt);
|
||||
m_nodeCount = metadata.value(u"node_count"_s).value<quint32>();
|
||||
m_indexSize = m_nodeCount * m_nodeSize;
|
||||
|
||||
CHECK_METADATA_REQ(u"database_type"_qs, QString);
|
||||
m_dbType = metadata.value(u"database_type"_qs).toString();
|
||||
CHECK_METADATA_REQ(u"database_type"_s, QString);
|
||||
m_dbType = metadata.value(u"database_type"_s).toString();
|
||||
|
||||
CHECK_METADATA_REQ(u"build_epoch"_qs, ULongLong);
|
||||
m_buildEpoch = QDateTime::fromSecsSinceEpoch(metadata.value(u"build_epoch"_qs).toULongLong());
|
||||
CHECK_METADATA_REQ(u"build_epoch"_s, ULongLong);
|
||||
m_buildEpoch = QDateTime::fromSecsSinceEpoch(metadata.value(u"build_epoch"_s).toULongLong());
|
||||
|
||||
CHECK_METADATA_OPT(u"languages"_qs, QVariantList);
|
||||
CHECK_METADATA_OPT(u"description"_qs, QVariantHash);
|
||||
CHECK_METADATA_OPT(u"languages"_s, QVariantList);
|
||||
CHECK_METADATA_OPT(u"description"_s, QVariantHash);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -43,9 +43,9 @@
|
||||
#include "downloadmanager.h"
|
||||
#include "geoipdatabase.h"
|
||||
|
||||
const QString DATABASE_URL = u"https://download.db-ip.com/free/dbip-country-lite-%1.mmdb.gz"_qs;
|
||||
const QString GEODB_FOLDER = u"GeoDB"_qs;
|
||||
const QString GEODB_FILENAME = u"dbip-country-lite.mmdb"_qs;
|
||||
const QString DATABASE_URL = u"https://download.db-ip.com/free/dbip-country-lite-%1.mmdb.gz"_s;
|
||||
const QString GEODB_FOLDER = u"GeoDB"_s;
|
||||
const QString GEODB_FILENAME = u"dbip-country-lite.mmdb"_s;
|
||||
|
||||
using namespace Net;
|
||||
|
||||
@ -150,255 +150,255 @@ QString GeoIPManager::CountryName(const QString &countryISOCode)
|
||||
// http://www.iso.org/iso/home/standards/country_codes/country_names_and_code_elements_txt-temp.htm
|
||||
|
||||
// Officially assigned
|
||||
{u"AD"_qs, tr("Andorra")},
|
||||
{u"AE"_qs, tr("United Arab Emirates")},
|
||||
{u"AF"_qs, tr("Afghanistan")},
|
||||
{u"AG"_qs, tr("Antigua and Barbuda")},
|
||||
{u"AI"_qs, tr("Anguilla")},
|
||||
{u"AL"_qs, tr("Albania")},
|
||||
{u"AM"_qs, tr("Armenia")},
|
||||
{u"AO"_qs, tr("Angola")},
|
||||
{u"AQ"_qs, tr("Antarctica")},
|
||||
{u"AR"_qs, tr("Argentina")},
|
||||
{u"AS"_qs, tr("American Samoa")},
|
||||
{u"AT"_qs, tr("Austria")},
|
||||
{u"AU"_qs, tr("Australia")},
|
||||
{u"AW"_qs, tr("Aruba")},
|
||||
{u"AX"_qs, tr("Aland Islands")},
|
||||
{u"AZ"_qs, tr("Azerbaijan")},
|
||||
{u"BA"_qs, tr("Bosnia and Herzegovina")},
|
||||
{u"BB"_qs, tr("Barbados")},
|
||||
{u"BD"_qs, tr("Bangladesh")},
|
||||
{u"BE"_qs, tr("Belgium")},
|
||||
{u"BF"_qs, tr("Burkina Faso")},
|
||||
{u"BG"_qs, tr("Bulgaria")},
|
||||
{u"BH"_qs, tr("Bahrain")},
|
||||
{u"BI"_qs, tr("Burundi")},
|
||||
{u"BJ"_qs, tr("Benin")},
|
||||
{u"BL"_qs, tr("Saint Barthelemy")},
|
||||
{u"BM"_qs, tr("Bermuda")},
|
||||
{u"BN"_qs, tr("Brunei Darussalam")},
|
||||
{u"BO"_qs, tr("Bolivia, Plurinational State of")},
|
||||
{u"BQ"_qs, tr("Bonaire, Sint Eustatius and Saba")},
|
||||
{u"BR"_qs, tr("Brazil")},
|
||||
{u"BS"_qs, tr("Bahamas")},
|
||||
{u"BT"_qs, tr("Bhutan")},
|
||||
{u"BV"_qs, tr("Bouvet Island")},
|
||||
{u"BW"_qs, tr("Botswana")},
|
||||
{u"BY"_qs, tr("Belarus")},
|
||||
{u"BZ"_qs, tr("Belize")},
|
||||
{u"CA"_qs, tr("Canada")},
|
||||
{u"CC"_qs, tr("Cocos (Keeling) Islands")},
|
||||
{u"CD"_qs, tr("Congo, The Democratic Republic of the")},
|
||||
{u"CF"_qs, tr("Central African Republic")},
|
||||
{u"CG"_qs, tr("Congo")},
|
||||
{u"CH"_qs, tr("Switzerland")},
|
||||
{u"CI"_qs, tr("Cote d'Ivoire")},
|
||||
{u"CK"_qs, tr("Cook Islands")},
|
||||
{u"CL"_qs, tr("Chile")},
|
||||
{u"CM"_qs, tr("Cameroon")},
|
||||
{u"CN"_qs, tr("China")},
|
||||
{u"CO"_qs, tr("Colombia")},
|
||||
{u"CR"_qs, tr("Costa Rica")},
|
||||
{u"CU"_qs, tr("Cuba")},
|
||||
{u"CV"_qs, tr("Cape Verde")},
|
||||
{u"CW"_qs, tr("Curacao")},
|
||||
{u"CX"_qs, tr("Christmas Island")},
|
||||
{u"CY"_qs, tr("Cyprus")},
|
||||
{u"CZ"_qs, tr("Czech Republic")},
|
||||
{u"DE"_qs, tr("Germany")},
|
||||
{u"DJ"_qs, tr("Djibouti")},
|
||||
{u"DK"_qs, tr("Denmark")},
|
||||
{u"DM"_qs, tr("Dominica")},
|
||||
{u"DO"_qs, tr("Dominican Republic")},
|
||||
{u"DZ"_qs, tr("Algeria")},
|
||||
{u"EC"_qs, tr("Ecuador")},
|
||||
{u"EE"_qs, tr("Estonia")},
|
||||
{u"EG"_qs, tr("Egypt")},
|
||||
{u"EH"_qs, tr("Western Sahara")},
|
||||
{u"ER"_qs, tr("Eritrea")},
|
||||
{u"ES"_qs, tr("Spain")},
|
||||
{u"ET"_qs, tr("Ethiopia")},
|
||||
{u"FI"_qs, tr("Finland")},
|
||||
{u"FJ"_qs, tr("Fiji")},
|
||||
{u"FK"_qs, tr("Falkland Islands (Malvinas)")},
|
||||
{u"FM"_qs, tr("Micronesia, Federated States of")},
|
||||
{u"FO"_qs, tr("Faroe Islands")},
|
||||
{u"FR"_qs, tr("France")},
|
||||
{u"GA"_qs, tr("Gabon")},
|
||||
{u"GB"_qs, tr("United Kingdom")},
|
||||
{u"GD"_qs, tr("Grenada")},
|
||||
{u"GE"_qs, tr("Georgia")},
|
||||
{u"GF"_qs, tr("French Guiana")},
|
||||
{u"GG"_qs, tr("Guernsey")},
|
||||
{u"GH"_qs, tr("Ghana")},
|
||||
{u"GI"_qs, tr("Gibraltar")},
|
||||
{u"GL"_qs, tr("Greenland")},
|
||||
{u"GM"_qs, tr("Gambia")},
|
||||
{u"GN"_qs, tr("Guinea")},
|
||||
{u"GP"_qs, tr("Guadeloupe")},
|
||||
{u"GQ"_qs, tr("Equatorial Guinea")},
|
||||
{u"GR"_qs, tr("Greece")},
|
||||
{u"GS"_qs, tr("South Georgia and the South Sandwich Islands")},
|
||||
{u"GT"_qs, tr("Guatemala")},
|
||||
{u"GU"_qs, tr("Guam")},
|
||||
{u"GW"_qs, tr("Guinea-Bissau")},
|
||||
{u"GY"_qs, tr("Guyana")},
|
||||
{u"HK"_qs, tr("Hong Kong")},
|
||||
{u"HM"_qs, tr("Heard Island and McDonald Islands")},
|
||||
{u"HN"_qs, tr("Honduras")},
|
||||
{u"HR"_qs, tr("Croatia")},
|
||||
{u"HT"_qs, tr("Haiti")},
|
||||
{u"HU"_qs, tr("Hungary")},
|
||||
{u"ID"_qs, tr("Indonesia")},
|
||||
{u"IE"_qs, tr("Ireland")},
|
||||
{u"IL"_qs, tr("Israel")},
|
||||
{u"IM"_qs, tr("Isle of Man")},
|
||||
{u"IN"_qs, tr("India")},
|
||||
{u"IO"_qs, tr("British Indian Ocean Territory")},
|
||||
{u"IQ"_qs, tr("Iraq")},
|
||||
{u"IR"_qs, tr("Iran, Islamic Republic of")},
|
||||
{u"IS"_qs, tr("Iceland")},
|
||||
{u"IT"_qs, tr("Italy")},
|
||||
{u"JE"_qs, tr("Jersey")},
|
||||
{u"JM"_qs, tr("Jamaica")},
|
||||
{u"JO"_qs, tr("Jordan")},
|
||||
{u"JP"_qs, tr("Japan")},
|
||||
{u"KE"_qs, tr("Kenya")},
|
||||
{u"KG"_qs, tr("Kyrgyzstan")},
|
||||
{u"KH"_qs, tr("Cambodia")},
|
||||
{u"KI"_qs, tr("Kiribati")},
|
||||
{u"KM"_qs, tr("Comoros")},
|
||||
{u"KN"_qs, tr("Saint Kitts and Nevis")},
|
||||
{u"KP"_qs, tr("Korea, Democratic People's Republic of")},
|
||||
{u"KR"_qs, tr("Korea, Republic of")},
|
||||
{u"KW"_qs, tr("Kuwait")},
|
||||
{u"KY"_qs, tr("Cayman Islands")},
|
||||
{u"KZ"_qs, tr("Kazakhstan")},
|
||||
{u"LA"_qs, tr("Lao People's Democratic Republic")},
|
||||
{u"LB"_qs, tr("Lebanon")},
|
||||
{u"LC"_qs, tr("Saint Lucia")},
|
||||
{u"LI"_qs, tr("Liechtenstein")},
|
||||
{u"LK"_qs, tr("Sri Lanka")},
|
||||
{u"LR"_qs, tr("Liberia")},
|
||||
{u"LS"_qs, tr("Lesotho")},
|
||||
{u"LT"_qs, tr("Lithuania")},
|
||||
{u"LU"_qs, tr("Luxembourg")},
|
||||
{u"LV"_qs, tr("Latvia")},
|
||||
{u"LY"_qs, tr("Libya")},
|
||||
{u"MA"_qs, tr("Morocco")},
|
||||
{u"MC"_qs, tr("Monaco")},
|
||||
{u"MD"_qs, tr("Moldova, Republic of")},
|
||||
{u"ME"_qs, tr("Montenegro")},
|
||||
{u"MF"_qs, tr("Saint Martin (French part)")},
|
||||
{u"MG"_qs, tr("Madagascar")},
|
||||
{u"MH"_qs, tr("Marshall Islands")},
|
||||
{u"MK"_qs, tr("Macedonia, The Former Yugoslav Republic of")},
|
||||
{u"ML"_qs, tr("Mali")},
|
||||
{u"MM"_qs, tr("Myanmar")},
|
||||
{u"MN"_qs, tr("Mongolia")},
|
||||
{u"MO"_qs, tr("Macao")},
|
||||
{u"MP"_qs, tr("Northern Mariana Islands")},
|
||||
{u"MQ"_qs, tr("Martinique")},
|
||||
{u"MR"_qs, tr("Mauritania")},
|
||||
{u"MS"_qs, tr("Montserrat")},
|
||||
{u"MT"_qs, tr("Malta")},
|
||||
{u"MU"_qs, tr("Mauritius")},
|
||||
{u"MV"_qs, tr("Maldives")},
|
||||
{u"MW"_qs, tr("Malawi")},
|
||||
{u"MX"_qs, tr("Mexico")},
|
||||
{u"MY"_qs, tr("Malaysia")},
|
||||
{u"MZ"_qs, tr("Mozambique")},
|
||||
{u"NA"_qs, tr("Namibia")},
|
||||
{u"NC"_qs, tr("New Caledonia")},
|
||||
{u"NE"_qs, tr("Niger")},
|
||||
{u"NF"_qs, tr("Norfolk Island")},
|
||||
{u"NG"_qs, tr("Nigeria")},
|
||||
{u"NI"_qs, tr("Nicaragua")},
|
||||
{u"NL"_qs, tr("Netherlands")},
|
||||
{u"NO"_qs, tr("Norway")},
|
||||
{u"NP"_qs, tr("Nepal")},
|
||||
{u"NR"_qs, tr("Nauru")},
|
||||
{u"NU"_qs, tr("Niue")},
|
||||
{u"NZ"_qs, tr("New Zealand")},
|
||||
{u"OM"_qs, tr("Oman")},
|
||||
{u"PA"_qs, tr("Panama")},
|
||||
{u"PE"_qs, tr("Peru")},
|
||||
{u"PF"_qs, tr("French Polynesia")},
|
||||
{u"PG"_qs, tr("Papua New Guinea")},
|
||||
{u"PH"_qs, tr("Philippines")},
|
||||
{u"PK"_qs, tr("Pakistan")},
|
||||
{u"PL"_qs, tr("Poland")},
|
||||
{u"PM"_qs, tr("Saint Pierre and Miquelon")},
|
||||
{u"PN"_qs, tr("Pitcairn")},
|
||||
{u"PR"_qs, tr("Puerto Rico")},
|
||||
{u"PS"_qs, tr("Palestine, State of")},
|
||||
{u"PT"_qs, tr("Portugal")},
|
||||
{u"PW"_qs, tr("Palau")},
|
||||
{u"PY"_qs, tr("Paraguay")},
|
||||
{u"QA"_qs, tr("Qatar")},
|
||||
{u"RE"_qs, tr("Reunion")},
|
||||
{u"RO"_qs, tr("Romania")},
|
||||
{u"RS"_qs, tr("Serbia")},
|
||||
{u"RU"_qs, tr("Russian Federation")},
|
||||
{u"RW"_qs, tr("Rwanda")},
|
||||
{u"SA"_qs, tr("Saudi Arabia")},
|
||||
{u"SB"_qs, tr("Solomon Islands")},
|
||||
{u"SC"_qs, tr("Seychelles")},
|
||||
{u"SD"_qs, tr("Sudan")},
|
||||
{u"SE"_qs, tr("Sweden")},
|
||||
{u"SG"_qs, tr("Singapore")},
|
||||
{u"SH"_qs, tr("Saint Helena, Ascension and Tristan da Cunha")},
|
||||
{u"SI"_qs, tr("Slovenia")},
|
||||
{u"SJ"_qs, tr("Svalbard and Jan Mayen")},
|
||||
{u"SK"_qs, tr("Slovakia")},
|
||||
{u"SL"_qs, tr("Sierra Leone")},
|
||||
{u"SM"_qs, tr("San Marino")},
|
||||
{u"SN"_qs, tr("Senegal")},
|
||||
{u"SO"_qs, tr("Somalia")},
|
||||
{u"SR"_qs, tr("Suriname")},
|
||||
{u"SS"_qs, tr("South Sudan")},
|
||||
{u"ST"_qs, tr("Sao Tome and Principe")},
|
||||
{u"SV"_qs, tr("El Salvador")},
|
||||
{u"SX"_qs, tr("Sint Maarten (Dutch part)")},
|
||||
{u"SY"_qs, tr("Syrian Arab Republic")},
|
||||
{u"SZ"_qs, tr("Swaziland")},
|
||||
{u"TC"_qs, tr("Turks and Caicos Islands")},
|
||||
{u"TD"_qs, tr("Chad")},
|
||||
{u"TF"_qs, tr("French Southern Territories")},
|
||||
{u"TG"_qs, tr("Togo")},
|
||||
{u"TH"_qs, tr("Thailand")},
|
||||
{u"TJ"_qs, tr("Tajikistan")},
|
||||
{u"TK"_qs, tr("Tokelau")},
|
||||
{u"TL"_qs, tr("Timor-Leste")},
|
||||
{u"TM"_qs, tr("Turkmenistan")},
|
||||
{u"TN"_qs, tr("Tunisia")},
|
||||
{u"TO"_qs, tr("Tonga")},
|
||||
{u"TR"_qs, tr("Turkey")},
|
||||
{u"TT"_qs, tr("Trinidad and Tobago")},
|
||||
{u"TV"_qs, tr("Tuvalu")},
|
||||
{u"TW"_qs, tr("Taiwan")},
|
||||
{u"TZ"_qs, tr("Tanzania, United Republic of")},
|
||||
{u"UA"_qs, tr("Ukraine")},
|
||||
{u"UG"_qs, tr("Uganda")},
|
||||
{u"UM"_qs, tr("United States Minor Outlying Islands")},
|
||||
{u"US"_qs, tr("United States")},
|
||||
{u"UY"_qs, tr("Uruguay")},
|
||||
{u"UZ"_qs, tr("Uzbekistan")},
|
||||
{u"VA"_qs, tr("Holy See (Vatican City State)")},
|
||||
{u"VC"_qs, tr("Saint Vincent and the Grenadines")},
|
||||
{u"VE"_qs, tr("Venezuela, Bolivarian Republic of")},
|
||||
{u"VG"_qs, tr("Virgin Islands, British")},
|
||||
{u"VI"_qs, tr("Virgin Islands, U.S.")},
|
||||
{u"VN"_qs, tr("Vietnam")},
|
||||
{u"VU"_qs, tr("Vanuatu")},
|
||||
{u"WF"_qs, tr("Wallis and Futuna")},
|
||||
{u"WS"_qs, tr("Samoa")},
|
||||
{u"YE"_qs, tr("Yemen")},
|
||||
{u"YT"_qs, tr("Mayotte")},
|
||||
{u"ZA"_qs, tr("South Africa")},
|
||||
{u"ZM"_qs, tr("Zambia")},
|
||||
{u"ZW"_qs, tr("Zimbabwe")},
|
||||
{u"AD"_s, tr("Andorra")},
|
||||
{u"AE"_s, tr("United Arab Emirates")},
|
||||
{u"AF"_s, tr("Afghanistan")},
|
||||
{u"AG"_s, tr("Antigua and Barbuda")},
|
||||
{u"AI"_s, tr("Anguilla")},
|
||||
{u"AL"_s, tr("Albania")},
|
||||
{u"AM"_s, tr("Armenia")},
|
||||
{u"AO"_s, tr("Angola")},
|
||||
{u"AQ"_s, tr("Antarctica")},
|
||||
{u"AR"_s, tr("Argentina")},
|
||||
{u"AS"_s, tr("American Samoa")},
|
||||
{u"AT"_s, tr("Austria")},
|
||||
{u"AU"_s, tr("Australia")},
|
||||
{u"AW"_s, tr("Aruba")},
|
||||
{u"AX"_s, tr("Aland Islands")},
|
||||
{u"AZ"_s, tr("Azerbaijan")},
|
||||
{u"BA"_s, tr("Bosnia and Herzegovina")},
|
||||
{u"BB"_s, tr("Barbados")},
|
||||
{u"BD"_s, tr("Bangladesh")},
|
||||
{u"BE"_s, tr("Belgium")},
|
||||
{u"BF"_s, tr("Burkina Faso")},
|
||||
{u"BG"_s, tr("Bulgaria")},
|
||||
{u"BH"_s, tr("Bahrain")},
|
||||
{u"BI"_s, tr("Burundi")},
|
||||
{u"BJ"_s, tr("Benin")},
|
||||
{u"BL"_s, tr("Saint Barthelemy")},
|
||||
{u"BM"_s, tr("Bermuda")},
|
||||
{u"BN"_s, tr("Brunei Darussalam")},
|
||||
{u"BO"_s, tr("Bolivia, Plurinational State of")},
|
||||
{u"BQ"_s, tr("Bonaire, Sint Eustatius and Saba")},
|
||||
{u"BR"_s, tr("Brazil")},
|
||||
{u"BS"_s, tr("Bahamas")},
|
||||
{u"BT"_s, tr("Bhutan")},
|
||||
{u"BV"_s, tr("Bouvet Island")},
|
||||
{u"BW"_s, tr("Botswana")},
|
||||
{u"BY"_s, tr("Belarus")},
|
||||
{u"BZ"_s, tr("Belize")},
|
||||
{u"CA"_s, tr("Canada")},
|
||||
{u"CC"_s, tr("Cocos (Keeling) Islands")},
|
||||
{u"CD"_s, tr("Congo, The Democratic Republic of the")},
|
||||
{u"CF"_s, tr("Central African Republic")},
|
||||
{u"CG"_s, tr("Congo")},
|
||||
{u"CH"_s, tr("Switzerland")},
|
||||
{u"CI"_s, tr("Cote d'Ivoire")},
|
||||
{u"CK"_s, tr("Cook Islands")},
|
||||
{u"CL"_s, tr("Chile")},
|
||||
{u"CM"_s, tr("Cameroon")},
|
||||
{u"CN"_s, tr("China")},
|
||||
{u"CO"_s, tr("Colombia")},
|
||||
{u"CR"_s, tr("Costa Rica")},
|
||||
{u"CU"_s, tr("Cuba")},
|
||||
{u"CV"_s, tr("Cape Verde")},
|
||||
{u"CW"_s, tr("Curacao")},
|
||||
{u"CX"_s, tr("Christmas Island")},
|
||||
{u"CY"_s, tr("Cyprus")},
|
||||
{u"CZ"_s, tr("Czech Republic")},
|
||||
{u"DE"_s, tr("Germany")},
|
||||
{u"DJ"_s, tr("Djibouti")},
|
||||
{u"DK"_s, tr("Denmark")},
|
||||
{u"DM"_s, tr("Dominica")},
|
||||
{u"DO"_s, tr("Dominican Republic")},
|
||||
{u"DZ"_s, tr("Algeria")},
|
||||
{u"EC"_s, tr("Ecuador")},
|
||||
{u"EE"_s, tr("Estonia")},
|
||||
{u"EG"_s, tr("Egypt")},
|
||||
{u"EH"_s, tr("Western Sahara")},
|
||||
{u"ER"_s, tr("Eritrea")},
|
||||
{u"ES"_s, tr("Spain")},
|
||||
{u"ET"_s, tr("Ethiopia")},
|
||||
{u"FI"_s, tr("Finland")},
|
||||
{u"FJ"_s, tr("Fiji")},
|
||||
{u"FK"_s, tr("Falkland Islands (Malvinas)")},
|
||||
{u"FM"_s, tr("Micronesia, Federated States of")},
|
||||
{u"FO"_s, tr("Faroe Islands")},
|
||||
{u"FR"_s, tr("France")},
|
||||
{u"GA"_s, tr("Gabon")},
|
||||
{u"GB"_s, tr("United Kingdom")},
|
||||
{u"GD"_s, tr("Grenada")},
|
||||
{u"GE"_s, tr("Georgia")},
|
||||
{u"GF"_s, tr("French Guiana")},
|
||||
{u"GG"_s, tr("Guernsey")},
|
||||
{u"GH"_s, tr("Ghana")},
|
||||
{u"GI"_s, tr("Gibraltar")},
|
||||
{u"GL"_s, tr("Greenland")},
|
||||
{u"GM"_s, tr("Gambia")},
|
||||
{u"GN"_s, tr("Guinea")},
|
||||
{u"GP"_s, tr("Guadeloupe")},
|
||||
{u"GQ"_s, tr("Equatorial Guinea")},
|
||||
{u"GR"_s, tr("Greece")},
|
||||
{u"GS"_s, tr("South Georgia and the South Sandwich Islands")},
|
||||
{u"GT"_s, tr("Guatemala")},
|
||||
{u"GU"_s, tr("Guam")},
|
||||
{u"GW"_s, tr("Guinea-Bissau")},
|
||||
{u"GY"_s, tr("Guyana")},
|
||||
{u"HK"_s, tr("Hong Kong")},
|
||||
{u"HM"_s, tr("Heard Island and McDonald Islands")},
|
||||
{u"HN"_s, tr("Honduras")},
|
||||
{u"HR"_s, tr("Croatia")},
|
||||
{u"HT"_s, tr("Haiti")},
|
||||
{u"HU"_s, tr("Hungary")},
|
||||
{u"ID"_s, tr("Indonesia")},
|
||||
{u"IE"_s, tr("Ireland")},
|
||||
{u"IL"_s, tr("Israel")},
|
||||
{u"IM"_s, tr("Isle of Man")},
|
||||
{u"IN"_s, tr("India")},
|
||||
{u"IO"_s, tr("British Indian Ocean Territory")},
|
||||
{u"IQ"_s, tr("Iraq")},
|
||||
{u"IR"_s, tr("Iran, Islamic Republic of")},
|
||||
{u"IS"_s, tr("Iceland")},
|
||||
{u"IT"_s, tr("Italy")},
|
||||
{u"JE"_s, tr("Jersey")},
|
||||
{u"JM"_s, tr("Jamaica")},
|
||||
{u"JO"_s, tr("Jordan")},
|
||||
{u"JP"_s, tr("Japan")},
|
||||
{u"KE"_s, tr("Kenya")},
|
||||
{u"KG"_s, tr("Kyrgyzstan")},
|
||||
{u"KH"_s, tr("Cambodia")},
|
||||
{u"KI"_s, tr("Kiribati")},
|
||||
{u"KM"_s, tr("Comoros")},
|
||||
{u"KN"_s, tr("Saint Kitts and Nevis")},
|
||||
{u"KP"_s, tr("Korea, Democratic People's Republic of")},
|
||||
{u"KR"_s, tr("Korea, Republic of")},
|
||||
{u"KW"_s, tr("Kuwait")},
|
||||
{u"KY"_s, tr("Cayman Islands")},
|
||||
{u"KZ"_s, tr("Kazakhstan")},
|
||||
{u"LA"_s, tr("Lao People's Democratic Republic")},
|
||||
{u"LB"_s, tr("Lebanon")},
|
||||
{u"LC"_s, tr("Saint Lucia")},
|
||||
{u"LI"_s, tr("Liechtenstein")},
|
||||
{u"LK"_s, tr("Sri Lanka")},
|
||||
{u"LR"_s, tr("Liberia")},
|
||||
{u"LS"_s, tr("Lesotho")},
|
||||
{u"LT"_s, tr("Lithuania")},
|
||||
{u"LU"_s, tr("Luxembourg")},
|
||||
{u"LV"_s, tr("Latvia")},
|
||||
{u"LY"_s, tr("Libya")},
|
||||
{u"MA"_s, tr("Morocco")},
|
||||
{u"MC"_s, tr("Monaco")},
|
||||
{u"MD"_s, tr("Moldova, Republic of")},
|
||||
{u"ME"_s, tr("Montenegro")},
|
||||
{u"MF"_s, tr("Saint Martin (French part)")},
|
||||
{u"MG"_s, tr("Madagascar")},
|
||||
{u"MH"_s, tr("Marshall Islands")},
|
||||
{u"MK"_s, tr("Macedonia, The Former Yugoslav Republic of")},
|
||||
{u"ML"_s, tr("Mali")},
|
||||
{u"MM"_s, tr("Myanmar")},
|
||||
{u"MN"_s, tr("Mongolia")},
|
||||
{u"MO"_s, tr("Macao")},
|
||||
{u"MP"_s, tr("Northern Mariana Islands")},
|
||||
{u"MQ"_s, tr("Martinique")},
|
||||
{u"MR"_s, tr("Mauritania")},
|
||||
{u"MS"_s, tr("Montserrat")},
|
||||
{u"MT"_s, tr("Malta")},
|
||||
{u"MU"_s, tr("Mauritius")},
|
||||
{u"MV"_s, tr("Maldives")},
|
||||
{u"MW"_s, tr("Malawi")},
|
||||
{u"MX"_s, tr("Mexico")},
|
||||
{u"MY"_s, tr("Malaysia")},
|
||||
{u"MZ"_s, tr("Mozambique")},
|
||||
{u"NA"_s, tr("Namibia")},
|
||||
{u"NC"_s, tr("New Caledonia")},
|
||||
{u"NE"_s, tr("Niger")},
|
||||
{u"NF"_s, tr("Norfolk Island")},
|
||||
{u"NG"_s, tr("Nigeria")},
|
||||
{u"NI"_s, tr("Nicaragua")},
|
||||
{u"NL"_s, tr("Netherlands")},
|
||||
{u"NO"_s, tr("Norway")},
|
||||
{u"NP"_s, tr("Nepal")},
|
||||
{u"NR"_s, tr("Nauru")},
|
||||
{u"NU"_s, tr("Niue")},
|
||||
{u"NZ"_s, tr("New Zealand")},
|
||||
{u"OM"_s, tr("Oman")},
|
||||
{u"PA"_s, tr("Panama")},
|
||||
{u"PE"_s, tr("Peru")},
|
||||
{u"PF"_s, tr("French Polynesia")},
|
||||
{u"PG"_s, tr("Papua New Guinea")},
|
||||
{u"PH"_s, tr("Philippines")},
|
||||
{u"PK"_s, tr("Pakistan")},
|
||||
{u"PL"_s, tr("Poland")},
|
||||
{u"PM"_s, tr("Saint Pierre and Miquelon")},
|
||||
{u"PN"_s, tr("Pitcairn")},
|
||||
{u"PR"_s, tr("Puerto Rico")},
|
||||
{u"PS"_s, tr("Palestine, State of")},
|
||||
{u"PT"_s, tr("Portugal")},
|
||||
{u"PW"_s, tr("Palau")},
|
||||
{u"PY"_s, tr("Paraguay")},
|
||||
{u"QA"_s, tr("Qatar")},
|
||||
{u"RE"_s, tr("Reunion")},
|
||||
{u"RO"_s, tr("Romania")},
|
||||
{u"RS"_s, tr("Serbia")},
|
||||
{u"RU"_s, tr("Russian Federation")},
|
||||
{u"RW"_s, tr("Rwanda")},
|
||||
{u"SA"_s, tr("Saudi Arabia")},
|
||||
{u"SB"_s, tr("Solomon Islands")},
|
||||
{u"SC"_s, tr("Seychelles")},
|
||||
{u"SD"_s, tr("Sudan")},
|
||||
{u"SE"_s, tr("Sweden")},
|
||||
{u"SG"_s, tr("Singapore")},
|
||||
{u"SH"_s, tr("Saint Helena, Ascension and Tristan da Cunha")},
|
||||
{u"SI"_s, tr("Slovenia")},
|
||||
{u"SJ"_s, tr("Svalbard and Jan Mayen")},
|
||||
{u"SK"_s, tr("Slovakia")},
|
||||
{u"SL"_s, tr("Sierra Leone")},
|
||||
{u"SM"_s, tr("San Marino")},
|
||||
{u"SN"_s, tr("Senegal")},
|
||||
{u"SO"_s, tr("Somalia")},
|
||||
{u"SR"_s, tr("Suriname")},
|
||||
{u"SS"_s, tr("South Sudan")},
|
||||
{u"ST"_s, tr("Sao Tome and Principe")},
|
||||
{u"SV"_s, tr("El Salvador")},
|
||||
{u"SX"_s, tr("Sint Maarten (Dutch part)")},
|
||||
{u"SY"_s, tr("Syrian Arab Republic")},
|
||||
{u"SZ"_s, tr("Swaziland")},
|
||||
{u"TC"_s, tr("Turks and Caicos Islands")},
|
||||
{u"TD"_s, tr("Chad")},
|
||||
{u"TF"_s, tr("French Southern Territories")},
|
||||
{u"TG"_s, tr("Togo")},
|
||||
{u"TH"_s, tr("Thailand")},
|
||||
{u"TJ"_s, tr("Tajikistan")},
|
||||
{u"TK"_s, tr("Tokelau")},
|
||||
{u"TL"_s, tr("Timor-Leste")},
|
||||
{u"TM"_s, tr("Turkmenistan")},
|
||||
{u"TN"_s, tr("Tunisia")},
|
||||
{u"TO"_s, tr("Tonga")},
|
||||
{u"TR"_s, tr("Turkey")},
|
||||
{u"TT"_s, tr("Trinidad and Tobago")},
|
||||
{u"TV"_s, tr("Tuvalu")},
|
||||
{u"TW"_s, tr("Taiwan")},
|
||||
{u"TZ"_s, tr("Tanzania, United Republic of")},
|
||||
{u"UA"_s, tr("Ukraine")},
|
||||
{u"UG"_s, tr("Uganda")},
|
||||
{u"UM"_s, tr("United States Minor Outlying Islands")},
|
||||
{u"US"_s, tr("United States")},
|
||||
{u"UY"_s, tr("Uruguay")},
|
||||
{u"UZ"_s, tr("Uzbekistan")},
|
||||
{u"VA"_s, tr("Holy See (Vatican City State)")},
|
||||
{u"VC"_s, tr("Saint Vincent and the Grenadines")},
|
||||
{u"VE"_s, tr("Venezuela, Bolivarian Republic of")},
|
||||
{u"VG"_s, tr("Virgin Islands, British")},
|
||||
{u"VI"_s, tr("Virgin Islands, U.S.")},
|
||||
{u"VN"_s, tr("Vietnam")},
|
||||
{u"VU"_s, tr("Vanuatu")},
|
||||
{u"WF"_s, tr("Wallis and Futuna")},
|
||||
{u"WS"_s, tr("Samoa")},
|
||||
{u"YE"_s, tr("Yemen")},
|
||||
{u"YT"_s, tr("Mayotte")},
|
||||
{u"ZA"_s, tr("South Africa")},
|
||||
{u"ZM"_s, tr("Zambia")},
|
||||
{u"ZW"_s, tr("Zimbabwe")},
|
||||
|
||||
{{}, tr("N/A")}
|
||||
};
|
||||
|
@ -52,18 +52,18 @@ ProxyConfigurationManager *ProxyConfigurationManager::m_instance = nullptr;
|
||||
|
||||
ProxyConfigurationManager::ProxyConfigurationManager(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_storeProxyType {SETTINGS_KEY(u"Type"_qs)}
|
||||
, m_storeProxyIP {SETTINGS_KEY(u"IP"_qs)}
|
||||
, m_storeProxyPort {SETTINGS_KEY(u"Port"_qs)}
|
||||
, m_storeProxyAuthEnabled {SETTINGS_KEY(u"AuthEnabled"_qs)}
|
||||
, m_storeProxyUsername {SETTINGS_KEY(u"Username"_qs)}
|
||||
, m_storeProxyPassword {SETTINGS_KEY(u"Password"_qs)}
|
||||
, m_storeProxyHostnameLookupEnabled {SETTINGS_KEY(u"HostnameLookupEnabled"_qs)}
|
||||
, m_storeProxyType {SETTINGS_KEY(u"Type"_s)}
|
||||
, m_storeProxyIP {SETTINGS_KEY(u"IP"_s)}
|
||||
, m_storeProxyPort {SETTINGS_KEY(u"Port"_s)}
|
||||
, m_storeProxyAuthEnabled {SETTINGS_KEY(u"AuthEnabled"_s)}
|
||||
, m_storeProxyUsername {SETTINGS_KEY(u"Username"_s)}
|
||||
, m_storeProxyPassword {SETTINGS_KEY(u"Password"_s)}
|
||||
, m_storeProxyHostnameLookupEnabled {SETTINGS_KEY(u"HostnameLookupEnabled"_s)}
|
||||
{
|
||||
m_config.type = m_storeProxyType.get(ProxyType::HTTP);
|
||||
if ((m_config.type < ProxyType::HTTP) || (m_config.type > ProxyType::SOCKS4))
|
||||
m_config.type = ProxyType::HTTP;
|
||||
m_config.ip = m_storeProxyIP.get(u"0.0.0.0"_qs);
|
||||
m_config.ip = m_storeProxyIP.get(u"0.0.0.0"_s);
|
||||
m_config.port = m_storeProxyPort.get(8080);
|
||||
m_config.authEnabled = m_storeProxyAuthEnabled;
|
||||
m_config.username = m_storeProxyUsername;
|
||||
|
@ -48,7 +48,7 @@ namespace Net
|
||||
struct ProxyConfiguration
|
||||
{
|
||||
ProxyType type = ProxyType::HTTP;
|
||||
QString ip = u"0.0.0.0"_qs;
|
||||
QString ip = u"0.0.0.0"_s;
|
||||
ushort port = 8080;
|
||||
bool authEnabled = false;
|
||||
QString username;
|
||||
|
@ -85,7 +85,7 @@ namespace
|
||||
{
|
||||
QString hostname = QHostInfo::localHostName();
|
||||
if (hostname.isEmpty())
|
||||
hostname = u"localhost"_qs;
|
||||
hostname = u"localhost"_s;
|
||||
|
||||
return hostname.toLocal8Bit();
|
||||
}
|
||||
@ -138,16 +138,16 @@ void Smtp::sendMail(const QString &from, const QString &to, const QString &subje
|
||||
{
|
||||
const Preferences *const pref = Preferences::instance();
|
||||
m_message = "Date: " + getCurrentDateTime().toLatin1() + "\r\n"
|
||||
+ encodeMimeHeader(u"From"_qs, u"qBittorrent <%1>"_qs.arg(from))
|
||||
+ encodeMimeHeader(u"Subject"_qs, subject)
|
||||
+ encodeMimeHeader(u"To"_qs, to)
|
||||
+ encodeMimeHeader(u"From"_s, u"qBittorrent <%1>"_s.arg(from))
|
||||
+ encodeMimeHeader(u"Subject"_s, subject)
|
||||
+ encodeMimeHeader(u"To"_s, to)
|
||||
+ "MIME-Version: 1.0\r\n"
|
||||
+ "Content-Type: text/plain; charset=UTF-8\r\n"
|
||||
+ "Content-Transfer-Encoding: base64\r\n"
|
||||
+ "\r\n";
|
||||
// Encode the body in base64
|
||||
QString crlfBody = body;
|
||||
const QByteArray b = crlfBody.replace(u"\n"_qs, u"\r\n"_qs).toUtf8().toBase64();
|
||||
const QByteArray b = crlfBody.replace(u"\n"_s, u"\r\n"_s).toUtf8().toBase64();
|
||||
const int ct = b.length();
|
||||
for (int i = 0; i < ct; i += 78)
|
||||
m_message += b.mid(i, 78);
|
||||
@ -424,7 +424,7 @@ void Smtp::parseEhloResponse(const QByteArray &code, const bool continued, const
|
||||
|
||||
if (m_state != EhloDone) return;
|
||||
|
||||
if (m_extensions.contains(u"STARTTLS"_qs) && m_useSsl)
|
||||
if (m_extensions.contains(u"STARTTLS"_s) && m_useSsl)
|
||||
{
|
||||
qDebug() << "STARTTLS";
|
||||
startTLS();
|
||||
@ -438,7 +438,7 @@ void Smtp::parseEhloResponse(const QByteArray &code, const bool continued, const
|
||||
void Smtp::authenticate()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
if (!m_extensions.contains(u"AUTH"_qs) ||
|
||||
if (!m_extensions.contains(u"AUTH"_s) ||
|
||||
m_username.isEmpty() || m_password.isEmpty())
|
||||
{
|
||||
// Skip authentication
|
||||
@ -453,7 +453,7 @@ void Smtp::authenticate()
|
||||
// AUTH extension is supported, check which
|
||||
// authentication modes are supported by
|
||||
// the server
|
||||
const QStringList auth = m_extensions[u"AUTH"_qs].toUpper().split(u' ', Qt::SkipEmptyParts);
|
||||
const QStringList auth = m_extensions[u"AUTH"_s].toUpper().split(u' ', Qt::SkipEmptyParts);
|
||||
if (auth.contains(u"CRAM-MD5"))
|
||||
{
|
||||
qDebug() << "Using CRAM-MD5 authentication...";
|
||||
|
@ -63,7 +63,7 @@ namespace
|
||||
#ifdef Q_OS_WIN
|
||||
bool hasDriveLetter(const QStringView path)
|
||||
{
|
||||
const QRegularExpression driveLetterRegex {u"^[A-Za-z]:/"_qs};
|
||||
const QRegularExpression driveLetterRegex {u"^[A-Za-z]:/"_s};
|
||||
return driveLetterRegex.match(path).hasMatch();
|
||||
}
|
||||
#endif
|
||||
@ -93,12 +93,12 @@ bool Path::isValid() const
|
||||
view = view.mid(3);
|
||||
|
||||
// \\37 is using base-8 number system
|
||||
const QRegularExpression regex {u"[\\0-\\37:?\"*<>|]"_qs};
|
||||
const QRegularExpression regex {u"[\\0-\\37:?\"*<>|]"_s};
|
||||
return !regex.match(view).hasMatch();
|
||||
#elif defined(Q_OS_MACOS)
|
||||
const QRegularExpression regex {u"[\\0:]"_qs};
|
||||
const QRegularExpression regex {u"[\\0:]"_s};
|
||||
#else
|
||||
const QRegularExpression regex {u"\\0"_qs};
|
||||
const QRegularExpression regex {u"\\0"_s};
|
||||
#endif
|
||||
return !m_pathStr.contains(regex);
|
||||
}
|
||||
@ -138,7 +138,7 @@ Path Path::rootItem() const
|
||||
return *this;
|
||||
|
||||
if (slashIndex == 0) // *nix absolute path
|
||||
return createUnchecked(u"/"_qs);
|
||||
return createUnchecked(u"/"_s);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// should be `c:/` instead of `c:`
|
||||
@ -157,7 +157,7 @@ Path Path::parentPath() const
|
||||
return {};
|
||||
|
||||
if (slashIndex == 0) // *nix absolute path
|
||||
return (m_pathStr.size() == 1) ? Path() : createUnchecked(u"/"_qs);
|
||||
return (m_pathStr.size() == 1) ? Path() : createUnchecked(u"/"_s);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// should be `c:/` instead of `c:`
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -92,7 +92,7 @@ Path Private::DefaultProfile::dataLocation() const
|
||||
// On Linux keep using the legacy directory ~/.local/share/data/ if it exists
|
||||
const Path genericDataPath {QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)};
|
||||
const Path profilePath {profileName()};
|
||||
const Path legacyDir = genericDataPath / Path(u"data"_qs) / profilePath;
|
||||
const Path legacyDir = genericDataPath / Path(u"data"_s) / profilePath;
|
||||
|
||||
const Path dataDir = genericDataPath / profilePath;
|
||||
|
||||
@ -131,10 +131,10 @@ Private::CustomProfile::CustomProfile(const Path &rootPath, const QString &confi
|
||||
: Profile {configurationName}
|
||||
, m_rootPath {rootPath}
|
||||
, m_basePath {m_rootPath / Path(profileName())}
|
||||
, m_cacheLocation {m_basePath / Path(u"cache"_qs)}
|
||||
, m_configLocation {m_basePath / Path(u"config"_qs)}
|
||||
, m_dataLocation {m_basePath / Path(u"data"_qs)}
|
||||
, m_downloadLocation {m_basePath / Path(u"downloads"_qs)}
|
||||
, m_cacheLocation {m_basePath / Path(u"cache"_s)}
|
||||
, m_configLocation {m_basePath / Path(u"config"_s)}
|
||||
, m_dataLocation {m_basePath / Path(u"data"_s)}
|
||||
, m_downloadLocation {m_basePath / Path(u"downloads"_s)}
|
||||
{
|
||||
}
|
||||
|
||||
@ -172,9 +172,9 @@ std::unique_ptr<QSettings> Private::CustomProfile::applicationSettings(const QSt
|
||||
{
|
||||
// here we force QSettings::IniFormat format always because we need it to be portable across platforms
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
|
||||
const auto CONF_FILE_EXTENSION = u".ini"_qs;
|
||||
const auto CONF_FILE_EXTENSION = u".ini"_s;
|
||||
#else
|
||||
const auto CONF_FILE_EXTENSION = u".conf"_qs;
|
||||
const auto CONF_FILE_EXTENSION = u".conf"_s;
|
||||
#endif
|
||||
const Path settingsFilePath = configLocation() / Path(name + CONF_FILE_EXTENSION);
|
||||
return std::make_unique<QSettings>(settingsFilePath.data(), QSettings::IniFormat);
|
||||
|
@ -37,14 +37,14 @@
|
||||
|
||||
using namespace RSS;
|
||||
|
||||
const QString Article::KeyId = u"id"_qs;
|
||||
const QString Article::KeyDate = u"date"_qs;
|
||||
const QString Article::KeyTitle = u"title"_qs;
|
||||
const QString Article::KeyAuthor = u"author"_qs;
|
||||
const QString Article::KeyDescription = u"description"_qs;
|
||||
const QString Article::KeyTorrentURL = u"torrentURL"_qs;
|
||||
const QString Article::KeyLink = u"link"_qs;
|
||||
const QString Article::KeyIsRead = u"isRead"_qs;
|
||||
const QString Article::KeyId = u"id"_s;
|
||||
const QString Article::KeyDate = u"date"_s;
|
||||
const QString Article::KeyTitle = u"title"_s;
|
||||
const QString Article::KeyAuthor = u"author"_s;
|
||||
const QString Article::KeyDescription = u"description"_s;
|
||||
const QString Article::KeyTorrentURL = u"torrentURL"_s;
|
||||
const QString Article::KeyLink = u"link"_s;
|
||||
const QString Article::KeyIsRead = u"isRead"_s;
|
||||
|
||||
Article::Article(Feed *feed, const QVariantHash &varHash)
|
||||
: QObject(feed)
|
||||
|
@ -61,8 +61,8 @@ struct ProcessingJob
|
||||
QVariantHash articleData;
|
||||
};
|
||||
|
||||
const QString CONF_FOLDER_NAME = u"rss"_qs;
|
||||
const QString RULES_FILE_NAME = u"download_rules.json"_qs;
|
||||
const QString CONF_FOLDER_NAME = u"rss"_s;
|
||||
const QString RULES_FILE_NAME = u"download_rules.json"_s;
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -97,13 +97,13 @@ QPointer<AutoDownloader> AutoDownloader::m_instance = nullptr;
|
||||
|
||||
QString computeSmartFilterRegex(const QStringList &filters)
|
||||
{
|
||||
return u"(?:_|\\b)(?:%1)(?:_|\\b)"_qs.arg(filters.join(u")|(?:"));
|
||||
return u"(?:_|\\b)(?:%1)(?:_|\\b)"_s.arg(filters.join(u")|(?:"));
|
||||
}
|
||||
|
||||
AutoDownloader::AutoDownloader()
|
||||
: m_storeProcessingEnabled(u"RSS/AutoDownloader/EnableProcessing"_qs, false)
|
||||
, m_storeSmartEpisodeFilter(u"RSS/AutoDownloader/SmartEpisodeFilter"_qs)
|
||||
, m_storeDownloadRepacks(u"RSS/AutoDownloader/DownloadRepacks"_qs)
|
||||
: m_storeProcessingEnabled(u"RSS/AutoDownloader/EnableProcessing"_s, false)
|
||||
, m_storeSmartEpisodeFilter(u"RSS/AutoDownloader/SmartEpisodeFilter"_s)
|
||||
, m_storeDownloadRepacks(u"RSS/AutoDownloader/DownloadRepacks"_s)
|
||||
, m_processingTimer(new QTimer(this))
|
||||
, m_ioThread(new QThread)
|
||||
{
|
||||
@ -175,7 +175,7 @@ bool AutoDownloader::hasRule(const QString &ruleName) const
|
||||
AutoDownloadRule AutoDownloader::ruleByName(const QString &ruleName) const
|
||||
{
|
||||
const auto index = m_rulesByName.value(ruleName, -1);
|
||||
return m_rules.value(index, AutoDownloadRule(u"Unknown Rule"_qs));
|
||||
return m_rules.value(index, AutoDownloadRule(u"Unknown Rule"_s));
|
||||
}
|
||||
|
||||
QList<AutoDownloadRule> AutoDownloader::rules() const
|
||||
@ -312,10 +312,10 @@ QStringList AutoDownloader::smartEpisodeFilters() const
|
||||
{
|
||||
const QStringList defaultFilters =
|
||||
{
|
||||
u"s(\\d+)e(\\d+)"_qs, // Format 1: s01e01
|
||||
u"(\\d+)x(\\d+)"_qs, // Format 2: 01x01
|
||||
u"(\\d{4}[.\\-]\\d{1,2}[.\\-]\\d{1,2})"_qs, // Format 3: 2017.01.01
|
||||
u"(\\d{1,2}[.\\-]\\d{1,2}[.\\-]\\d{4})"_qs // Format 4: 01.01.2017
|
||||
u"s(\\d+)e(\\d+)"_s, // Format 1: s01e01
|
||||
u"(\\d+)x(\\d+)"_s, // Format 2: 01x01
|
||||
u"(\\d{4}[.\\-]\\d{1,2}[.\\-]\\d{1,2})"_s, // Format 3: 2017.01.01
|
||||
u"(\\d{1,2}[.\\-]\\d{1,2}[.\\-]\\d{4})"_s // Format 4: 01.01.2017
|
||||
};
|
||||
return defaultFilters;
|
||||
}
|
||||
@ -529,8 +529,8 @@ void AutoDownloader::loadRules(const QByteArray &data)
|
||||
|
||||
void AutoDownloader::loadRulesLegacy()
|
||||
{
|
||||
const std::unique_ptr<QSettings> settings = Profile::instance()->applicationSettings(u"qBittorrent-rss"_qs);
|
||||
const QVariantHash rules = settings->value(u"download_rules"_qs).toHash();
|
||||
const std::unique_ptr<QSettings> settings = Profile::instance()->applicationSettings(u"qBittorrent-rss"_s);
|
||||
const QVariantHash rules = settings->value(u"download_rules"_s).toHash();
|
||||
for (const QVariant &ruleVar : rules)
|
||||
{
|
||||
const auto rule = AutoDownloadRule::fromLegacyDict(ruleVar.toHash());
|
||||
|
@ -101,25 +101,25 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
const QString S_NAME = u"name"_qs;
|
||||
const QString S_ENABLED = u"enabled"_qs;
|
||||
const QString S_PRIORITY = u"priority"_qs;
|
||||
const QString S_USE_REGEX = u"useRegex"_qs;
|
||||
const QString S_MUST_CONTAIN = u"mustContain"_qs;
|
||||
const QString S_MUST_NOT_CONTAIN = u"mustNotContain"_qs;
|
||||
const QString S_EPISODE_FILTER = u"episodeFilter"_qs;
|
||||
const QString S_AFFECTED_FEEDS = u"affectedFeeds"_qs;
|
||||
const QString S_LAST_MATCH = u"lastMatch"_qs;
|
||||
const QString S_IGNORE_DAYS = u"ignoreDays"_qs;
|
||||
const QString S_SMART_FILTER = u"smartFilter"_qs;
|
||||
const QString S_PREVIOUSLY_MATCHED = u"previouslyMatchedEpisodes"_qs;
|
||||
const QString S_NAME = u"name"_s;
|
||||
const QString S_ENABLED = u"enabled"_s;
|
||||
const QString S_PRIORITY = u"priority"_s;
|
||||
const QString S_USE_REGEX = u"useRegex"_s;
|
||||
const QString S_MUST_CONTAIN = u"mustContain"_s;
|
||||
const QString S_MUST_NOT_CONTAIN = u"mustNotContain"_s;
|
||||
const QString S_EPISODE_FILTER = u"episodeFilter"_s;
|
||||
const QString S_AFFECTED_FEEDS = u"affectedFeeds"_s;
|
||||
const QString S_LAST_MATCH = u"lastMatch"_s;
|
||||
const QString S_IGNORE_DAYS = u"ignoreDays"_s;
|
||||
const QString S_SMART_FILTER = u"smartFilter"_s;
|
||||
const QString S_PREVIOUSLY_MATCHED = u"previouslyMatchedEpisodes"_s;
|
||||
|
||||
const QString S_SAVE_PATH = u"savePath"_qs;
|
||||
const QString S_ASSIGNED_CATEGORY = u"assignedCategory"_qs;
|
||||
const QString S_ADD_PAUSED = u"addPaused"_qs;
|
||||
const QString S_CONTENT_LAYOUT = u"torrentContentLayout"_qs;
|
||||
const QString S_SAVE_PATH = u"savePath"_s;
|
||||
const QString S_ASSIGNED_CATEGORY = u"assignedCategory"_s;
|
||||
const QString S_ADD_PAUSED = u"addPaused"_s;
|
||||
const QString S_CONTENT_LAYOUT = u"torrentContentLayout"_s;
|
||||
|
||||
const QString S_TORRENT_PARAMS = u"torrentParams"_qs;
|
||||
const QString S_TORRENT_PARAMS = u"torrentParams"_s;
|
||||
|
||||
namespace RSS
|
||||
{
|
||||
@ -230,7 +230,7 @@ QRegularExpression AutoDownloadRule::cachedRegex(const QString &expression, cons
|
||||
|
||||
bool AutoDownloadRule::matchesExpression(const QString &articleTitle, const QString &expression) const
|
||||
{
|
||||
const QRegularExpression whitespace {u"\\s+"_qs};
|
||||
const QRegularExpression whitespace {u"\\s+"_s};
|
||||
|
||||
if (expression.isEmpty())
|
||||
{
|
||||
@ -293,7 +293,7 @@ bool AutoDownloadRule::matchesEpisodeFilterExpression(const QString &articleTitl
|
||||
if (m_dataPtr->episodeFilter.isEmpty())
|
||||
return true;
|
||||
|
||||
const QRegularExpression filterRegex {cachedRegex(u"(^\\d{1,4})x(.*;$)"_qs)};
|
||||
const QRegularExpression filterRegex {cachedRegex(u"(^\\d{1,4})x(.*;$)"_s)};
|
||||
const QRegularExpressionMatch matcher {filterRegex.match(m_dataPtr->episodeFilter)};
|
||||
if (!matcher.hasMatch())
|
||||
return false;
|
||||
@ -313,8 +313,8 @@ bool AutoDownloadRule::matchesEpisodeFilterExpression(const QString &articleTitl
|
||||
|
||||
if (episode.indexOf(u'-') != -1)
|
||||
{ // Range detected
|
||||
const QString partialPattern1 {u"\\bs0?(\\d{1,4})[ -_\\.]?e(0?\\d{1,4})(?:\\D|\\b)"_qs};
|
||||
const QString partialPattern2 {u"\\b(\\d{1,4})x(0?\\d{1,4})(?:\\D|\\b)"_qs};
|
||||
const QString partialPattern1 {u"\\bs0?(\\d{1,4})[ -_\\.]?e(0?\\d{1,4})(?:\\D|\\b)"_s};
|
||||
const QString partialPattern2 {u"\\b(\\d{1,4})x(0?\\d{1,4})(?:\\D|\\b)"_s};
|
||||
|
||||
// Extract partial match from article and compare as digits
|
||||
QRegularExpressionMatch matcher = cachedRegex(partialPattern1).match(articleTitle);
|
||||
@ -353,7 +353,7 @@ bool AutoDownloadRule::matchesEpisodeFilterExpression(const QString &articleTitl
|
||||
}
|
||||
else
|
||||
{ // Single number
|
||||
const QString expStr {u"\\b(?:s0?%1[ -_\\.]?e0?%2|%1x0?%2)(?:\\D|\\b)"_qs.arg(season, episode)};
|
||||
const QString expStr {u"\\b(?:s0?%1[ -_\\.]?e0?%2|%1x0?%2)(?:\\D|\\b)"_s.arg(season, episode)};
|
||||
if (cachedRegex(expStr).match(articleTitle).hasMatch())
|
||||
return true;
|
||||
}
|
||||
@ -385,7 +385,7 @@ bool AutoDownloadRule::matchesSmartEpisodeFilter(const QString &articleTitle) co
|
||||
if (!isRepack && !isProper)
|
||||
return false;
|
||||
|
||||
const QString fullEpisodeStr = u"%1%2%3"_qs.arg(episodeStr,
|
||||
const QString fullEpisodeStr = u"%1%2%3"_s.arg(episodeStr,
|
||||
isRepack ? u"-REPACK" : u"",
|
||||
isProper ? u"-PROPER" : u"");
|
||||
const bool previouslyMatchedFull = m_dataPtr->previouslyMatchedEpisodes.contains(fullEpisodeStr);
|
||||
@ -565,39 +565,39 @@ QVariantHash AutoDownloadRule::toLegacyDict() const
|
||||
{
|
||||
const BitTorrent::AddTorrentParams &addTorrentParams = m_dataPtr->addTorrentParams;
|
||||
|
||||
return {{u"name"_qs, name()},
|
||||
{u"must_contain"_qs, mustContain()},
|
||||
{u"must_not_contain"_qs, mustNotContain()},
|
||||
{u"save_path"_qs, addTorrentParams.savePath.toString()},
|
||||
{u"affected_feeds"_qs, feedURLs()},
|
||||
{u"enabled"_qs, isEnabled()},
|
||||
{u"category_assigned"_qs, addTorrentParams.category},
|
||||
{u"use_regex"_qs, useRegex()},
|
||||
{u"add_paused"_qs, toAddPausedLegacy(addTorrentParams.addPaused)},
|
||||
{u"episode_filter"_qs, episodeFilter()},
|
||||
{u"last_match"_qs, lastMatch()},
|
||||
{u"ignore_days"_qs, ignoreDays()}};
|
||||
return {{u"name"_s, name()},
|
||||
{u"must_contain"_s, mustContain()},
|
||||
{u"must_not_contain"_s, mustNotContain()},
|
||||
{u"save_path"_s, addTorrentParams.savePath.toString()},
|
||||
{u"affected_feeds"_s, feedURLs()},
|
||||
{u"enabled"_s, isEnabled()},
|
||||
{u"category_assigned"_s, addTorrentParams.category},
|
||||
{u"use_regex"_s, useRegex()},
|
||||
{u"add_paused"_s, toAddPausedLegacy(addTorrentParams.addPaused)},
|
||||
{u"episode_filter"_s, episodeFilter()},
|
||||
{u"last_match"_s, lastMatch()},
|
||||
{u"ignore_days"_s, ignoreDays()}};
|
||||
}
|
||||
|
||||
AutoDownloadRule AutoDownloadRule::fromLegacyDict(const QVariantHash &dict)
|
||||
{
|
||||
BitTorrent::AddTorrentParams addTorrentParams;
|
||||
addTorrentParams.savePath = Path(dict.value(u"save_path"_qs).toString());
|
||||
addTorrentParams.category = dict.value(u"category_assigned"_qs).toString();
|
||||
addTorrentParams.addPaused = addPausedLegacyToOptionalBool(dict.value(u"add_paused"_qs).toInt());
|
||||
addTorrentParams.savePath = Path(dict.value(u"save_path"_s).toString());
|
||||
addTorrentParams.category = dict.value(u"category_assigned"_s).toString();
|
||||
addTorrentParams.addPaused = addPausedLegacyToOptionalBool(dict.value(u"add_paused"_s).toInt());
|
||||
if (!addTorrentParams.savePath.isEmpty())
|
||||
addTorrentParams.useAutoTMM = false;
|
||||
|
||||
AutoDownloadRule rule {dict.value(u"name"_qs).toString()};
|
||||
AutoDownloadRule rule {dict.value(u"name"_s).toString()};
|
||||
|
||||
rule.setUseRegex(dict.value(u"use_regex"_qs, false).toBool());
|
||||
rule.setMustContain(dict.value(u"must_contain"_qs).toString());
|
||||
rule.setMustNotContain(dict.value(u"must_not_contain"_qs).toString());
|
||||
rule.setEpisodeFilter(dict.value(u"episode_filter"_qs).toString());
|
||||
rule.setFeedURLs(dict.value(u"affected_feeds"_qs).toStringList());
|
||||
rule.setEnabled(dict.value(u"enabled"_qs, false).toBool());
|
||||
rule.setLastMatch(dict.value(u"last_match"_qs).toDateTime());
|
||||
rule.setIgnoreDays(dict.value(u"ignore_days"_qs).toInt());
|
||||
rule.setUseRegex(dict.value(u"use_regex"_s, false).toBool());
|
||||
rule.setMustContain(dict.value(u"must_contain"_s).toString());
|
||||
rule.setMustNotContain(dict.value(u"must_not_contain"_s).toString());
|
||||
rule.setEpisodeFilter(dict.value(u"episode_filter"_s).toString());
|
||||
rule.setFeedURLs(dict.value(u"affected_feeds"_s).toStringList());
|
||||
rule.setEnabled(dict.value(u"enabled"_s, false).toBool());
|
||||
rule.setLastMatch(dict.value(u"last_match"_s).toDateTime());
|
||||
rule.setIgnoreDays(dict.value(u"ignore_days"_s).toInt());
|
||||
rule.setAddTorrentParams(addTorrentParams);
|
||||
|
||||
return rule;
|
||||
|
@ -53,13 +53,13 @@
|
||||
#include "rss_parser.h"
|
||||
#include "rss_session.h"
|
||||
|
||||
const QString KEY_UID = u"uid"_qs;
|
||||
const QString KEY_URL = u"url"_qs;
|
||||
const QString KEY_TITLE = u"title"_qs;
|
||||
const QString KEY_LASTBUILDDATE = u"lastBuildDate"_qs;
|
||||
const QString KEY_ISLOADING = u"isLoading"_qs;
|
||||
const QString KEY_HASERROR = u"hasError"_qs;
|
||||
const QString KEY_ARTICLES = u"articles"_qs;
|
||||
const QString KEY_UID = u"uid"_s;
|
||||
const QString KEY_URL = u"url"_s;
|
||||
const QString KEY_TITLE = u"title"_s;
|
||||
const QString KEY_LASTBUILDDATE = u"lastBuildDate"_s;
|
||||
const QString KEY_ISLOADING = u"isLoading"_s;
|
||||
const QString KEY_HASERROR = u"hasError"_s;
|
||||
const QString KEY_ARTICLES = u"articles"_s;
|
||||
|
||||
using namespace RSS;
|
||||
|
||||
@ -73,7 +73,7 @@ Feed::Feed(const QUuid &uid, const QString &url, const QString &path, Session *s
|
||||
m_dataFileName = Path(uidHex + u".json");
|
||||
|
||||
// Move to new file naming scheme (since v4.1.2)
|
||||
const QString legacyFilename = Utils::Fs::toValidFileName(m_url, u"_"_qs) + u".json";
|
||||
const QString legacyFilename = Utils::Fs::toValidFileName(m_url, u"_"_s) + u".json";
|
||||
const Path storageDir = m_session->dataFileStorage()->storageDir();
|
||||
const Path dataFilePath = storageDir / m_dataFileName;
|
||||
if (!dataFilePath.exists())
|
||||
@ -376,7 +376,7 @@ void Feed::downloadIcon()
|
||||
// Download the RSS Feed icon
|
||||
// XXX: This works for most sites but it is not perfect
|
||||
const QUrl url(m_url);
|
||||
const auto iconUrl = u"%1://%2/favicon.ico"_qs.arg(url.scheme(), url.host());
|
||||
const auto iconUrl = u"%1://%2/favicon.ico"_s.arg(url.scheme(), url.host());
|
||||
Net::DownloadManager::instance()->download(
|
||||
Net::DownloadRequest(iconUrl).saveToFile(true).destFileName(m_iconPath)
|
||||
, Preferences::instance()->useProxyForRSS(), this, &Feed::handleIconDownloadFinished);
|
||||
|
@ -67,7 +67,7 @@ QString Item::name() const
|
||||
bool Item::isValidPath(const QString &path)
|
||||
{
|
||||
const QRegularExpression re(
|
||||
uR"(\A[^\%1]+(\%1[^\%1]+)*\z)"_qs.arg(Item::PathSeparator)
|
||||
uR"(\A[^\%1]+(\%1[^\%1]+)*\z)"_s.arg(Item::PathSeparator)
|
||||
, QRegularExpression::DontCaptureOption);
|
||||
|
||||
if (path.isEmpty() || !re.match(path).hasMatch())
|
||||
|
@ -56,303 +56,303 @@ namespace
|
||||
// http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
|
||||
static const QHash<QString, QString> HTMLEntities
|
||||
{
|
||||
{u"nbsp"_qs, u" "_qs}, // no-break space = non-breaking space, U+00A0 ISOnum
|
||||
{u"iexcl"_qs, u"¡"_qs}, // inverted exclamation mark, U+00A1 ISOnum
|
||||
{u"cent"_qs, u"¢"_qs}, // cent sign, U+00A2 ISOnum
|
||||
{u"pound"_qs, u"£"_qs}, // pound sign, U+00A3 ISOnum
|
||||
{u"curren"_qs, u"¤"_qs}, // currency sign, U+00A4 ISOnum
|
||||
{u"yen"_qs, u"¥"_qs}, // yen sign = yuan sign, U+00A5 ISOnum
|
||||
{u"brvbar"_qs, u"¦"_qs}, // broken bar = broken vertical bar, U+00A6 ISOnum
|
||||
{u"sect"_qs, u"§"_qs}, // section sign, U+00A7 ISOnum
|
||||
{u"uml"_qs, u"¨"_qs}, // diaeresis = spacing diaeresis, U+00A8 ISOdia
|
||||
{u"copy"_qs, u"©"_qs}, // copyright sign, U+00A9 ISOnum
|
||||
{u"ordf"_qs, u"ª"_qs}, // feminine ordinal indicator, U+00AA ISOnum
|
||||
{u"laquo"_qs, u"«"_qs}, // left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum
|
||||
{u"not"_qs, u"¬"_qs}, // not sign = angled dash, U+00AC ISOnum
|
||||
{u"shy"_qs, u"­"_qs}, // soft hyphen = discretionary hyphen, U+00AD ISOnum
|
||||
{u"reg"_qs, u"®"_qs}, // registered sign = registered trade mark sign, U+00AE ISOnum
|
||||
{u"macr"_qs, u"¯"_qs}, // macron = spacing macron = overline = APL overbar, U+00AF ISOdia
|
||||
{u"deg"_qs, u"°"_qs}, // degree sign, U+00B0 ISOnum
|
||||
{u"plusmn"_qs, u"±"_qs}, // plus-minus sign = plus-or-minus sign, U+00B1 ISOnum
|
||||
{u"sup2"_qs, u"²"_qs}, // superscript two = superscript digit two = squared, U+00B2 ISOnum
|
||||
{u"sup3"_qs, u"³"_qs}, // superscript three = superscript digit three = cubed, U+00B3 ISOnum
|
||||
{u"acute"_qs, u"´"_qs}, // acute accent = spacing acute, U+00B4 ISOdia
|
||||
{u"micro"_qs, u"µ"_qs}, // micro sign, U+00B5 ISOnum
|
||||
{u"para"_qs, u"¶"_qs}, // pilcrow sign = paragraph sign, U+00B6 ISOnum
|
||||
{u"middot"_qs, u"·"_qs}, // middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum
|
||||
{u"cedil"_qs, u"¸"_qs}, // cedilla = spacing cedilla, U+00B8 ISOdia
|
||||
{u"sup1"_qs, u"¹"_qs}, // superscript one = superscript digit one, U+00B9 ISOnum
|
||||
{u"ordm"_qs, u"º"_qs}, // masculine ordinal indicator, U+00BA ISOnum
|
||||
{u"raquo"_qs, u"»"_qs}, // right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum
|
||||
{u"frac14"_qs, u"¼"_qs}, // vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum
|
||||
{u"frac12"_qs, u"½"_qs}, // vulgar fraction one half = fraction one half, U+00BD ISOnum
|
||||
{u"frac34"_qs, u"¾"_qs}, // vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum
|
||||
{u"iquest"_qs, u"¿"_qs}, // inverted question mark = turned question mark, U+00BF ISOnum
|
||||
{u"Agrave"_qs, u"À"_qs}, // latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1
|
||||
{u"Aacute"_qs, u"Á"_qs}, // latin capital letter A with acute, U+00C1 ISOlat1
|
||||
{u"Acirc"_qs, u"Â"_qs}, // latin capital letter A with circumflex, U+00C2 ISOlat1
|
||||
{u"Atilde"_qs, u"Ã"_qs}, // latin capital letter A with tilde, U+00C3 ISOlat1
|
||||
{u"Auml"_qs, u"Ä"_qs}, // latin capital letter A with diaeresis, U+00C4 ISOlat1
|
||||
{u"Aring"_qs, u"Å"_qs}, // latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1
|
||||
{u"AElig"_qs, u"Æ"_qs}, // latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
|
||||
{u"Ccedil"_qs, u"Ç"_qs}, // latin capital letter C with cedilla, U+00C7 ISOlat1
|
||||
{u"Egrave"_qs, u"È"_qs}, // latin capital letter E with grave, U+00C8 ISOlat1
|
||||
{u"Eacute"_qs, u"É"_qs}, // latin capital letter E with acute, U+00C9 ISOlat1
|
||||
{u"Ecirc"_qs, u"Ê"_qs}, // latin capital letter E with circumflex, U+00CA ISOlat1
|
||||
{u"Euml"_qs, u"Ë"_qs}, // latin capital letter E with diaeresis, U+00CB ISOlat1
|
||||
{u"Igrave"_qs, u"Ì"_qs}, // latin capital letter I with grave, U+00CC ISOlat1
|
||||
{u"Iacute"_qs, u"Í"_qs}, // latin capital letter I with acute, U+00CD ISOlat1
|
||||
{u"Icirc"_qs, u"Î"_qs}, // latin capital letter I with circumflex, U+00CE ISOlat1
|
||||
{u"Iuml"_qs, u"Ï"_qs}, // latin capital letter I with diaeresis, U+00CF ISOlat1
|
||||
{u"ETH"_qs, u"Ð"_qs}, // latin capital letter ETH, U+00D0 ISOlat1
|
||||
{u"Ntilde"_qs, u"Ñ"_qs}, // latin capital letter N with tilde, U+00D1 ISOlat1
|
||||
{u"Ograve"_qs, u"Ò"_qs}, // latin capital letter O with grave, U+00D2 ISOlat1
|
||||
{u"Oacute"_qs, u"Ó"_qs}, // latin capital letter O with acute, U+00D3 ISOlat1
|
||||
{u"Ocirc"_qs, u"Ô"_qs}, // latin capital letter O with circumflex, U+00D4 ISOlat1
|
||||
{u"Otilde"_qs, u"Õ"_qs}, // latin capital letter O with tilde, U+00D5 ISOlat1
|
||||
{u"Ouml"_qs, u"Ö"_qs}, // latin capital letter O with diaeresis, U+00D6 ISOlat1
|
||||
{u"times"_qs, u"×"_qs}, // multiplication sign, U+00D7 ISOnum
|
||||
{u"Oslash"_qs, u"Ø"_qs}, // latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1
|
||||
{u"Ugrave"_qs, u"Ù"_qs}, // latin capital letter U with grave, U+00D9 ISOlat1
|
||||
{u"Uacute"_qs, u"Ú"_qs}, // latin capital letter U with acute, U+00DA ISOlat1
|
||||
{u"Ucirc"_qs, u"Û"_qs}, // latin capital letter U with circumflex, U+00DB ISOlat1
|
||||
{u"Uuml"_qs, u"Ü"_qs}, // latin capital letter U with diaeresis, U+00DC ISOlat1
|
||||
{u"Yacute"_qs, u"Ý"_qs}, // latin capital letter Y with acute, U+00DD ISOlat1
|
||||
{u"THORN"_qs, u"Þ"_qs}, // latin capital letter THORN, U+00DE ISOlat1
|
||||
{u"szlig"_qs, u"ß"_qs}, // latin small letter sharp s = ess-zed, U+00DF ISOlat1
|
||||
{u"agrave"_qs, u"à"_qs}, // latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1
|
||||
{u"aacute"_qs, u"á"_qs}, // latin small letter a with acute, U+00E1 ISOlat1
|
||||
{u"acirc"_qs, u"â"_qs}, // latin small letter a with circumflex, U+00E2 ISOlat1
|
||||
{u"atilde"_qs, u"ã"_qs}, // latin small letter a with tilde, U+00E3 ISOlat1
|
||||
{u"auml"_qs, u"ä"_qs}, // latin small letter a with diaeresis, U+00E4 ISOlat1
|
||||
{u"aring"_qs, u"å"_qs}, // latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1
|
||||
{u"aelig"_qs, u"æ"_qs}, // latin small letter ae = latin small ligature ae, U+00E6 ISOlat1
|
||||
{u"ccedil"_qs, u"ç"_qs}, // latin small letter c with cedilla, U+00E7 ISOlat1
|
||||
{u"egrave"_qs, u"è"_qs}, // latin small letter e with grave, U+00E8 ISOlat1
|
||||
{u"eacute"_qs, u"é"_qs}, // latin small letter e with acute, U+00E9 ISOlat1
|
||||
{u"ecirc"_qs, u"ê"_qs}, // latin small letter e with circumflex, U+00EA ISOlat1
|
||||
{u"euml"_qs, u"ë"_qs}, // latin small letter e with diaeresis, U+00EB ISOlat1
|
||||
{u"igrave"_qs, u"ì"_qs}, // latin small letter i with grave, U+00EC ISOlat1
|
||||
{u"iacute"_qs, u"í"_qs}, // latin small letter i with acute, U+00ED ISOlat1
|
||||
{u"icirc"_qs, u"î"_qs}, // latin small letter i with circumflex, U+00EE ISOlat1
|
||||
{u"iuml"_qs, u"ï"_qs}, // latin small letter i with diaeresis, U+00EF ISOlat1
|
||||
{u"eth"_qs, u"ð"_qs}, // latin small letter eth, U+00F0 ISOlat1
|
||||
{u"ntilde"_qs, u"ñ"_qs}, // latin small letter n with tilde, U+00F1 ISOlat1
|
||||
{u"ograve"_qs, u"ò"_qs}, // latin small letter o with grave, U+00F2 ISOlat1
|
||||
{u"oacute"_qs, u"ó"_qs}, // latin small letter o with acute, U+00F3 ISOlat1
|
||||
{u"ocirc"_qs, u"ô"_qs}, // latin small letter o with circumflex, U+00F4 ISOlat1
|
||||
{u"otilde"_qs, u"õ"_qs}, // latin small letter o with tilde, U+00F5 ISOlat1
|
||||
{u"ouml"_qs, u"ö"_qs}, // latin small letter o with diaeresis, U+00F6 ISOlat1
|
||||
{u"divide"_qs, u"÷"_qs}, // division sign, U+00F7 ISOnum
|
||||
{u"oslash"_qs, u"ø"_qs}, // latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1
|
||||
{u"ugrave"_qs, u"ù"_qs}, // latin small letter u with grave, U+00F9 ISOlat1
|
||||
{u"uacute"_qs, u"ú"_qs}, // latin small letter u with acute, U+00FA ISOlat1
|
||||
{u"ucirc"_qs, u"û"_qs}, // latin small letter u with circumflex, U+00FB ISOlat1
|
||||
{u"uuml"_qs, u"ü"_qs}, // latin small letter u with diaeresis, U+00FC ISOlat1
|
||||
{u"yacute"_qs, u"ý"_qs}, // latin small letter y with acute, U+00FD ISOlat1
|
||||
{u"thorn"_qs, u"þ"_qs}, // latin small letter thorn, U+00FE ISOlat1
|
||||
{u"yuml"_qs, u"ÿ"_qs}, // latin small letter y with diaeresis, U+00FF ISOlat1
|
||||
{u"nbsp"_s, u" "_s}, // no-break space = non-breaking space, U+00A0 ISOnum
|
||||
{u"iexcl"_s, u"¡"_s}, // inverted exclamation mark, U+00A1 ISOnum
|
||||
{u"cent"_s, u"¢"_s}, // cent sign, U+00A2 ISOnum
|
||||
{u"pound"_s, u"£"_s}, // pound sign, U+00A3 ISOnum
|
||||
{u"curren"_s, u"¤"_s}, // currency sign, U+00A4 ISOnum
|
||||
{u"yen"_s, u"¥"_s}, // yen sign = yuan sign, U+00A5 ISOnum
|
||||
{u"brvbar"_s, u"¦"_s}, // broken bar = broken vertical bar, U+00A6 ISOnum
|
||||
{u"sect"_s, u"§"_s}, // section sign, U+00A7 ISOnum
|
||||
{u"uml"_s, u"¨"_s}, // diaeresis = spacing diaeresis, U+00A8 ISOdia
|
||||
{u"copy"_s, u"©"_s}, // copyright sign, U+00A9 ISOnum
|
||||
{u"ordf"_s, u"ª"_s}, // feminine ordinal indicator, U+00AA ISOnum
|
||||
{u"laquo"_s, u"«"_s}, // left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum
|
||||
{u"not"_s, u"¬"_s}, // not sign = angled dash, U+00AC ISOnum
|
||||
{u"shy"_s, u"­"_s}, // soft hyphen = discretionary hyphen, U+00AD ISOnum
|
||||
{u"reg"_s, u"®"_s}, // registered sign = registered trade mark sign, U+00AE ISOnum
|
||||
{u"macr"_s, u"¯"_s}, // macron = spacing macron = overline = APL overbar, U+00AF ISOdia
|
||||
{u"deg"_s, u"°"_s}, // degree sign, U+00B0 ISOnum
|
||||
{u"plusmn"_s, u"±"_s}, // plus-minus sign = plus-or-minus sign, U+00B1 ISOnum
|
||||
{u"sup2"_s, u"²"_s}, // superscript two = superscript digit two = squared, U+00B2 ISOnum
|
||||
{u"sup3"_s, u"³"_s}, // superscript three = superscript digit three = cubed, U+00B3 ISOnum
|
||||
{u"acute"_s, u"´"_s}, // acute accent = spacing acute, U+00B4 ISOdia
|
||||
{u"micro"_s, u"µ"_s}, // micro sign, U+00B5 ISOnum
|
||||
{u"para"_s, u"¶"_s}, // pilcrow sign = paragraph sign, U+00B6 ISOnum
|
||||
{u"middot"_s, u"·"_s}, // middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum
|
||||
{u"cedil"_s, u"¸"_s}, // cedilla = spacing cedilla, U+00B8 ISOdia
|
||||
{u"sup1"_s, u"¹"_s}, // superscript one = superscript digit one, U+00B9 ISOnum
|
||||
{u"ordm"_s, u"º"_s}, // masculine ordinal indicator, U+00BA ISOnum
|
||||
{u"raquo"_s, u"»"_s}, // right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum
|
||||
{u"frac14"_s, u"¼"_s}, // vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum
|
||||
{u"frac12"_s, u"½"_s}, // vulgar fraction one half = fraction one half, U+00BD ISOnum
|
||||
{u"frac34"_s, u"¾"_s}, // vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum
|
||||
{u"iquest"_s, u"¿"_s}, // inverted question mark = turned question mark, U+00BF ISOnum
|
||||
{u"Agrave"_s, u"À"_s}, // latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1
|
||||
{u"Aacute"_s, u"Á"_s}, // latin capital letter A with acute, U+00C1 ISOlat1
|
||||
{u"Acirc"_s, u"Â"_s}, // latin capital letter A with circumflex, U+00C2 ISOlat1
|
||||
{u"Atilde"_s, u"Ã"_s}, // latin capital letter A with tilde, U+00C3 ISOlat1
|
||||
{u"Auml"_s, u"Ä"_s}, // latin capital letter A with diaeresis, U+00C4 ISOlat1
|
||||
{u"Aring"_s, u"Å"_s}, // latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1
|
||||
{u"AElig"_s, u"Æ"_s}, // latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
|
||||
{u"Ccedil"_s, u"Ç"_s}, // latin capital letter C with cedilla, U+00C7 ISOlat1
|
||||
{u"Egrave"_s, u"È"_s}, // latin capital letter E with grave, U+00C8 ISOlat1
|
||||
{u"Eacute"_s, u"É"_s}, // latin capital letter E with acute, U+00C9 ISOlat1
|
||||
{u"Ecirc"_s, u"Ê"_s}, // latin capital letter E with circumflex, U+00CA ISOlat1
|
||||
{u"Euml"_s, u"Ë"_s}, // latin capital letter E with diaeresis, U+00CB ISOlat1
|
||||
{u"Igrave"_s, u"Ì"_s}, // latin capital letter I with grave, U+00CC ISOlat1
|
||||
{u"Iacute"_s, u"Í"_s}, // latin capital letter I with acute, U+00CD ISOlat1
|
||||
{u"Icirc"_s, u"Î"_s}, // latin capital letter I with circumflex, U+00CE ISOlat1
|
||||
{u"Iuml"_s, u"Ï"_s}, // latin capital letter I with diaeresis, U+00CF ISOlat1
|
||||
{u"ETH"_s, u"Ð"_s}, // latin capital letter ETH, U+00D0 ISOlat1
|
||||
{u"Ntilde"_s, u"Ñ"_s}, // latin capital letter N with tilde, U+00D1 ISOlat1
|
||||
{u"Ograve"_s, u"Ò"_s}, // latin capital letter O with grave, U+00D2 ISOlat1
|
||||
{u"Oacute"_s, u"Ó"_s}, // latin capital letter O with acute, U+00D3 ISOlat1
|
||||
{u"Ocirc"_s, u"Ô"_s}, // latin capital letter O with circumflex, U+00D4 ISOlat1
|
||||
{u"Otilde"_s, u"Õ"_s}, // latin capital letter O with tilde, U+00D5 ISOlat1
|
||||
{u"Ouml"_s, u"Ö"_s}, // latin capital letter O with diaeresis, U+00D6 ISOlat1
|
||||
{u"times"_s, u"×"_s}, // multiplication sign, U+00D7 ISOnum
|
||||
{u"Oslash"_s, u"Ø"_s}, // latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1
|
||||
{u"Ugrave"_s, u"Ù"_s}, // latin capital letter U with grave, U+00D9 ISOlat1
|
||||
{u"Uacute"_s, u"Ú"_s}, // latin capital letter U with acute, U+00DA ISOlat1
|
||||
{u"Ucirc"_s, u"Û"_s}, // latin capital letter U with circumflex, U+00DB ISOlat1
|
||||
{u"Uuml"_s, u"Ü"_s}, // latin capital letter U with diaeresis, U+00DC ISOlat1
|
||||
{u"Yacute"_s, u"Ý"_s}, // latin capital letter Y with acute, U+00DD ISOlat1
|
||||
{u"THORN"_s, u"Þ"_s}, // latin capital letter THORN, U+00DE ISOlat1
|
||||
{u"szlig"_s, u"ß"_s}, // latin small letter sharp s = ess-zed, U+00DF ISOlat1
|
||||
{u"agrave"_s, u"à"_s}, // latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1
|
||||
{u"aacute"_s, u"á"_s}, // latin small letter a with acute, U+00E1 ISOlat1
|
||||
{u"acirc"_s, u"â"_s}, // latin small letter a with circumflex, U+00E2 ISOlat1
|
||||
{u"atilde"_s, u"ã"_s}, // latin small letter a with tilde, U+00E3 ISOlat1
|
||||
{u"auml"_s, u"ä"_s}, // latin small letter a with diaeresis, U+00E4 ISOlat1
|
||||
{u"aring"_s, u"å"_s}, // latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1
|
||||
{u"aelig"_s, u"æ"_s}, // latin small letter ae = latin small ligature ae, U+00E6 ISOlat1
|
||||
{u"ccedil"_s, u"ç"_s}, // latin small letter c with cedilla, U+00E7 ISOlat1
|
||||
{u"egrave"_s, u"è"_s}, // latin small letter e with grave, U+00E8 ISOlat1
|
||||
{u"eacute"_s, u"é"_s}, // latin small letter e with acute, U+00E9 ISOlat1
|
||||
{u"ecirc"_s, u"ê"_s}, // latin small letter e with circumflex, U+00EA ISOlat1
|
||||
{u"euml"_s, u"ë"_s}, // latin small letter e with diaeresis, U+00EB ISOlat1
|
||||
{u"igrave"_s, u"ì"_s}, // latin small letter i with grave, U+00EC ISOlat1
|
||||
{u"iacute"_s, u"í"_s}, // latin small letter i with acute, U+00ED ISOlat1
|
||||
{u"icirc"_s, u"î"_s}, // latin small letter i with circumflex, U+00EE ISOlat1
|
||||
{u"iuml"_s, u"ï"_s}, // latin small letter i with diaeresis, U+00EF ISOlat1
|
||||
{u"eth"_s, u"ð"_s}, // latin small letter eth, U+00F0 ISOlat1
|
||||
{u"ntilde"_s, u"ñ"_s}, // latin small letter n with tilde, U+00F1 ISOlat1
|
||||
{u"ograve"_s, u"ò"_s}, // latin small letter o with grave, U+00F2 ISOlat1
|
||||
{u"oacute"_s, u"ó"_s}, // latin small letter o with acute, U+00F3 ISOlat1
|
||||
{u"ocirc"_s, u"ô"_s}, // latin small letter o with circumflex, U+00F4 ISOlat1
|
||||
{u"otilde"_s, u"õ"_s}, // latin small letter o with tilde, U+00F5 ISOlat1
|
||||
{u"ouml"_s, u"ö"_s}, // latin small letter o with diaeresis, U+00F6 ISOlat1
|
||||
{u"divide"_s, u"÷"_s}, // division sign, U+00F7 ISOnum
|
||||
{u"oslash"_s, u"ø"_s}, // latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1
|
||||
{u"ugrave"_s, u"ù"_s}, // latin small letter u with grave, U+00F9 ISOlat1
|
||||
{u"uacute"_s, u"ú"_s}, // latin small letter u with acute, U+00FA ISOlat1
|
||||
{u"ucirc"_s, u"û"_s}, // latin small letter u with circumflex, U+00FB ISOlat1
|
||||
{u"uuml"_s, u"ü"_s}, // latin small letter u with diaeresis, U+00FC ISOlat1
|
||||
{u"yacute"_s, u"ý"_s}, // latin small letter y with acute, U+00FD ISOlat1
|
||||
{u"thorn"_s, u"þ"_s}, // latin small letter thorn, U+00FE ISOlat1
|
||||
{u"yuml"_s, u"ÿ"_s}, // latin small letter y with diaeresis, U+00FF ISOlat1
|
||||
|
||||
// Latin Extended-A
|
||||
{u"OElig"_qs, u"Œ"_qs}, // latin capital ligature OE, U+0152 ISOlat2
|
||||
{u"oelig"_qs, u"œ"_qs}, // latin small ligature oe, U+0153 ISOlat2
|
||||
{u"OElig"_s, u"Œ"_s}, // latin capital ligature OE, U+0152 ISOlat2
|
||||
{u"oelig"_s, u"œ"_s}, // latin small ligature oe, U+0153 ISOlat2
|
||||
// ligature is a misnomer, this is a separate character in some languages
|
||||
{u"Scaron"_qs, u"Š"_qs}, // latin capital letter S with caron, U+0160 ISOlat2
|
||||
{u"scaron"_qs, u"š"_qs}, // latin small letter s with caron, U+0161 ISOlat2
|
||||
{u"Yuml"_qs, u"Ÿ"_qs}, // latin capital letter Y with diaeresis, U+0178 ISOlat2
|
||||
{u"Scaron"_s, u"Š"_s}, // latin capital letter S with caron, U+0160 ISOlat2
|
||||
{u"scaron"_s, u"š"_s}, // latin small letter s with caron, U+0161 ISOlat2
|
||||
{u"Yuml"_s, u"Ÿ"_s}, // latin capital letter Y with diaeresis, U+0178 ISOlat2
|
||||
|
||||
// Spacing Modifier Letters
|
||||
{u"circ"_qs, u"ˆ"_qs}, // modifier letter circumflex accent, U+02C6 ISOpub
|
||||
{u"tilde"_qs, u"˜"_qs}, // small tilde, U+02DC ISOdia
|
||||
{u"circ"_s, u"ˆ"_s}, // modifier letter circumflex accent, U+02C6 ISOpub
|
||||
{u"tilde"_s, u"˜"_s}, // small tilde, U+02DC ISOdia
|
||||
|
||||
// General Punctuation
|
||||
{u"ensp"_qs, u" "_qs}, // en space, U+2002 ISOpub
|
||||
{u"emsp"_qs, u" "_qs}, // em space, U+2003 ISOpub
|
||||
{u"thinsp"_qs, u" "_qs}, // thin space, U+2009 ISOpub
|
||||
{u"zwnj"_qs, u"‌"_qs}, // zero width non-joiner, U+200C NEW RFC 2070
|
||||
{u"zwj"_qs, u"‍"_qs}, // zero width joiner, U+200D NEW RFC 2070
|
||||
{u"lrm"_qs, u"‎"_qs}, // left-to-right mark, U+200E NEW RFC 2070
|
||||
{u"rlm"_qs, u"‏"_qs}, // right-to-left mark, U+200F NEW RFC 2070
|
||||
{u"ndash"_qs, u"–"_qs}, // en dash, U+2013 ISOpub
|
||||
{u"mdash"_qs, u"—"_qs}, // em dash, U+2014 ISOpub
|
||||
{u"lsquo"_qs, u"‘"_qs}, // left single quotation mark, U+2018 ISOnum
|
||||
{u"rsquo"_qs, u"’"_qs}, // right single quotation mark, U+2019 ISOnum
|
||||
{u"sbquo"_qs, u"‚"_qs}, // single low-9 quotation mark, U+201A NEW
|
||||
{u"ldquo"_qs, u"“"_qs}, // left double quotation mark, U+201C ISOnum
|
||||
{u"rdquo"_qs, u"”"_qs}, // right double quotation mark, U+201D ISOnum
|
||||
{u"bdquo"_qs, u"„"_qs}, // double low-9 quotation mark, U+201E NEW
|
||||
{u"dagger"_qs, u"†"_qs}, // dagger, U+2020 ISOpub
|
||||
{u"Dagger"_qs, u"‡"_qs}, // double dagger, U+2021 ISOpub
|
||||
{u"permil"_qs, u"‰"_qs}, // per mille sign, U+2030 ISOtech
|
||||
{u"lsaquo"_qs, u"‹"_qs}, // single left-pointing angle quotation mark, U+2039 ISO proposed
|
||||
{u"ensp"_s, u" "_s}, // en space, U+2002 ISOpub
|
||||
{u"emsp"_s, u" "_s}, // em space, U+2003 ISOpub
|
||||
{u"thinsp"_s, u" "_s}, // thin space, U+2009 ISOpub
|
||||
{u"zwnj"_s, u"‌"_s}, // zero width non-joiner, U+200C NEW RFC 2070
|
||||
{u"zwj"_s, u"‍"_s}, // zero width joiner, U+200D NEW RFC 2070
|
||||
{u"lrm"_s, u"‎"_s}, // left-to-right mark, U+200E NEW RFC 2070
|
||||
{u"rlm"_s, u"‏"_s}, // right-to-left mark, U+200F NEW RFC 2070
|
||||
{u"ndash"_s, u"–"_s}, // en dash, U+2013 ISOpub
|
||||
{u"mdash"_s, u"—"_s}, // em dash, U+2014 ISOpub
|
||||
{u"lsquo"_s, u"‘"_s}, // left single quotation mark, U+2018 ISOnum
|
||||
{u"rsquo"_s, u"’"_s}, // right single quotation mark, U+2019 ISOnum
|
||||
{u"sbquo"_s, u"‚"_s}, // single low-9 quotation mark, U+201A NEW
|
||||
{u"ldquo"_s, u"“"_s}, // left double quotation mark, U+201C ISOnum
|
||||
{u"rdquo"_s, u"”"_s}, // right double quotation mark, U+201D ISOnum
|
||||
{u"bdquo"_s, u"„"_s}, // double low-9 quotation mark, U+201E NEW
|
||||
{u"dagger"_s, u"†"_s}, // dagger, U+2020 ISOpub
|
||||
{u"Dagger"_s, u"‡"_s}, // double dagger, U+2021 ISOpub
|
||||
{u"permil"_s, u"‰"_s}, // per mille sign, U+2030 ISOtech
|
||||
{u"lsaquo"_s, u"‹"_s}, // single left-pointing angle quotation mark, U+2039 ISO proposed
|
||||
// lsaquo is proposed but not yet ISO standardized
|
||||
{u"rsaquo"_qs, u"›"_qs}, // single right-pointing angle quotation mark, U+203A ISO proposed
|
||||
{u"rsaquo"_s, u"›"_s}, // single right-pointing angle quotation mark, U+203A ISO proposed
|
||||
// rsaquo is proposed but not yet ISO standardized
|
||||
|
||||
// Currency Symbols
|
||||
{u"euro"_qs, u"€"_qs}, // euro sign, U+20AC NEW
|
||||
{u"euro"_s, u"€"_s}, // euro sign, U+20AC NEW
|
||||
|
||||
// Latin Extended-B
|
||||
{u"fnof"_qs, u"ƒ"_qs}, // latin small letter f with hook = function = florin, U+0192 ISOtech
|
||||
{u"fnof"_s, u"ƒ"_s}, // latin small letter f with hook = function = florin, U+0192 ISOtech
|
||||
|
||||
// Greek
|
||||
{u"Alpha"_qs, u"Α"_qs}, // greek capital letter alpha, U+0391
|
||||
{u"Beta"_qs, u"Β"_qs}, // greek capital letter beta, U+0392
|
||||
{u"Gamma"_qs, u"Γ"_qs}, // greek capital letter gamma, U+0393 ISOgrk3
|
||||
{u"Delta"_qs, u"Δ"_qs}, // greek capital letter delta, U+0394 ISOgrk3
|
||||
{u"Epsilon"_qs, u"Ε"_qs}, // greek capital letter epsilon, U+0395
|
||||
{u"Zeta"_qs, u"Ζ"_qs}, // greek capital letter zeta, U+0396
|
||||
{u"Eta"_qs, u"Η"_qs}, // greek capital letter eta, U+0397
|
||||
{u"Theta"_qs, u"Θ"_qs}, // greek capital letter theta, U+0398 ISOgrk3
|
||||
{u"Iota"_qs, u"Ι"_qs}, // greek capital letter iota, U+0399
|
||||
{u"Kappa"_qs, u"Κ"_qs}, // greek capital letter kappa, U+039A
|
||||
{u"Lambda"_qs, u"Λ"_qs}, // greek capital letter lamda, U+039B ISOgrk3
|
||||
{u"Mu"_qs, u"Μ"_qs}, // greek capital letter mu, U+039C
|
||||
{u"Nu"_qs, u"Ν"_qs}, // greek capital letter nu, U+039D
|
||||
{u"Xi"_qs, u"Ξ"_qs}, // greek capital letter xi, U+039E ISOgrk3
|
||||
{u"Omicron"_qs, u"Ο"_qs}, // greek capital letter omicron, U+039F
|
||||
{u"Pi"_qs, u"Π"_qs}, // greek capital letter pi, U+03A0 ISOgrk3
|
||||
{u"Rho"_qs, u"Ρ"_qs}, // greek capital letter rho, U+03A1
|
||||
{u"Sigma"_qs, u"Σ"_qs}, // greek capital letter sigma, U+03A3 ISOgrk3
|
||||
{u"Tau"_qs, u"Τ"_qs}, // greek capital letter tau, U+03A4
|
||||
{u"Upsilon"_qs, u"Υ"_qs}, // greek capital letter upsilon, U+03A5 ISOgrk3
|
||||
{u"Phi"_qs, u"Φ"_qs}, // greek capital letter phi, U+03A6 ISOgrk3
|
||||
{u"Chi"_qs, u"Χ"_qs}, // greek capital letter chi, U+03A7
|
||||
{u"Psi"_qs, u"Ψ"_qs}, // greek capital letter psi, U+03A8 ISOgrk3
|
||||
{u"Omega"_qs, u"Ω"_qs}, // greek capital letter omega, U+03A9 ISOgrk3
|
||||
{u"alpha"_qs, u"α"_qs}, // greek small letter alpha, U+03B1 ISOgrk3
|
||||
{u"beta"_qs, u"β"_qs}, // greek small letter beta, U+03B2 ISOgrk3
|
||||
{u"gamma"_qs, u"γ"_qs}, // greek small letter gamma, U+03B3 ISOgrk3
|
||||
{u"delta"_qs, u"δ"_qs}, // greek small letter delta, U+03B4 ISOgrk3
|
||||
{u"epsilon"_qs, u"ε"_qs}, // greek small letter epsilon, U+03B5 ISOgrk3
|
||||
{u"zeta"_qs, u"ζ"_qs}, // greek small letter zeta, U+03B6 ISOgrk3
|
||||
{u"eta"_qs, u"η"_qs}, // greek small letter eta, U+03B7 ISOgrk3
|
||||
{u"theta"_qs, u"θ"_qs}, // greek small letter theta, U+03B8 ISOgrk3
|
||||
{u"iota"_qs, u"ι"_qs}, // greek small letter iota, U+03B9 ISOgrk3
|
||||
{u"kappa"_qs, u"κ"_qs}, // greek small letter kappa, U+03BA ISOgrk3
|
||||
{u"lambda"_qs, u"λ"_qs}, // greek small letter lamda, U+03BB ISOgrk3
|
||||
{u"mu"_qs, u"μ"_qs}, // greek small letter mu, U+03BC ISOgrk3
|
||||
{u"nu"_qs, u"ν"_qs}, // greek small letter nu, U+03BD ISOgrk3
|
||||
{u"xi"_qs, u"ξ"_qs}, // greek small letter xi, U+03BE ISOgrk3
|
||||
{u"omicron"_qs, u"ο"_qs}, // greek small letter omicron, U+03BF NEW
|
||||
{u"pi"_qs, u"π"_qs}, // greek small letter pi, U+03C0 ISOgrk3
|
||||
{u"rho"_qs, u"ρ"_qs}, // greek small letter rho, U+03C1 ISOgrk3
|
||||
{u"sigmaf"_qs, u"ς"_qs}, // greek small letter final sigma, U+03C2 ISOgrk3
|
||||
{u"sigma"_qs, u"σ"_qs}, // greek small letter sigma, U+03C3 ISOgrk3
|
||||
{u"tau"_qs, u"τ"_qs}, // greek small letter tau, U+03C4 ISOgrk3
|
||||
{u"upsilon"_qs, u"υ"_qs}, // greek small letter upsilon, U+03C5 ISOgrk3
|
||||
{u"phi"_qs, u"φ"_qs}, // greek small letter phi, U+03C6 ISOgrk3
|
||||
{u"chi"_qs, u"χ"_qs}, // greek small letter chi, U+03C7 ISOgrk3
|
||||
{u"psi"_qs, u"ψ"_qs}, // greek small letter psi, U+03C8 ISOgrk3
|
||||
{u"omega"_qs, u"ω"_qs}, // greek small letter omega, U+03C9 ISOgrk3
|
||||
{u"thetasym"_qs, u"ϑ"_qs}, // greek theta symbol, U+03D1 NEW
|
||||
{u"upsih"_qs, u"ϒ"_qs}, // greek upsilon with hook symbol, U+03D2 NEW
|
||||
{u"piv"_qs, u"ϖ"_qs}, // greek pi symbol, U+03D6 ISOgrk3
|
||||
{u"Alpha"_s, u"Α"_s}, // greek capital letter alpha, U+0391
|
||||
{u"Beta"_s, u"Β"_s}, // greek capital letter beta, U+0392
|
||||
{u"Gamma"_s, u"Γ"_s}, // greek capital letter gamma, U+0393 ISOgrk3
|
||||
{u"Delta"_s, u"Δ"_s}, // greek capital letter delta, U+0394 ISOgrk3
|
||||
{u"Epsilon"_s, u"Ε"_s}, // greek capital letter epsilon, U+0395
|
||||
{u"Zeta"_s, u"Ζ"_s}, // greek capital letter zeta, U+0396
|
||||
{u"Eta"_s, u"Η"_s}, // greek capital letter eta, U+0397
|
||||
{u"Theta"_s, u"Θ"_s}, // greek capital letter theta, U+0398 ISOgrk3
|
||||
{u"Iota"_s, u"Ι"_s}, // greek capital letter iota, U+0399
|
||||
{u"Kappa"_s, u"Κ"_s}, // greek capital letter kappa, U+039A
|
||||
{u"Lambda"_s, u"Λ"_s}, // greek capital letter lamda, U+039B ISOgrk3
|
||||
{u"Mu"_s, u"Μ"_s}, // greek capital letter mu, U+039C
|
||||
{u"Nu"_s, u"Ν"_s}, // greek capital letter nu, U+039D
|
||||
{u"Xi"_s, u"Ξ"_s}, // greek capital letter xi, U+039E ISOgrk3
|
||||
{u"Omicron"_s, u"Ο"_s}, // greek capital letter omicron, U+039F
|
||||
{u"Pi"_s, u"Π"_s}, // greek capital letter pi, U+03A0 ISOgrk3
|
||||
{u"Rho"_s, u"Ρ"_s}, // greek capital letter rho, U+03A1
|
||||
{u"Sigma"_s, u"Σ"_s}, // greek capital letter sigma, U+03A3 ISOgrk3
|
||||
{u"Tau"_s, u"Τ"_s}, // greek capital letter tau, U+03A4
|
||||
{u"Upsilon"_s, u"Υ"_s}, // greek capital letter upsilon, U+03A5 ISOgrk3
|
||||
{u"Phi"_s, u"Φ"_s}, // greek capital letter phi, U+03A6 ISOgrk3
|
||||
{u"Chi"_s, u"Χ"_s}, // greek capital letter chi, U+03A7
|
||||
{u"Psi"_s, u"Ψ"_s}, // greek capital letter psi, U+03A8 ISOgrk3
|
||||
{u"Omega"_s, u"Ω"_s}, // greek capital letter omega, U+03A9 ISOgrk3
|
||||
{u"alpha"_s, u"α"_s}, // greek small letter alpha, U+03B1 ISOgrk3
|
||||
{u"beta"_s, u"β"_s}, // greek small letter beta, U+03B2 ISOgrk3
|
||||
{u"gamma"_s, u"γ"_s}, // greek small letter gamma, U+03B3 ISOgrk3
|
||||
{u"delta"_s, u"δ"_s}, // greek small letter delta, U+03B4 ISOgrk3
|
||||
{u"epsilon"_s, u"ε"_s}, // greek small letter epsilon, U+03B5 ISOgrk3
|
||||
{u"zeta"_s, u"ζ"_s}, // greek small letter zeta, U+03B6 ISOgrk3
|
||||
{u"eta"_s, u"η"_s}, // greek small letter eta, U+03B7 ISOgrk3
|
||||
{u"theta"_s, u"θ"_s}, // greek small letter theta, U+03B8 ISOgrk3
|
||||
{u"iota"_s, u"ι"_s}, // greek small letter iota, U+03B9 ISOgrk3
|
||||
{u"kappa"_s, u"κ"_s}, // greek small letter kappa, U+03BA ISOgrk3
|
||||
{u"lambda"_s, u"λ"_s}, // greek small letter lamda, U+03BB ISOgrk3
|
||||
{u"mu"_s, u"μ"_s}, // greek small letter mu, U+03BC ISOgrk3
|
||||
{u"nu"_s, u"ν"_s}, // greek small letter nu, U+03BD ISOgrk3
|
||||
{u"xi"_s, u"ξ"_s}, // greek small letter xi, U+03BE ISOgrk3
|
||||
{u"omicron"_s, u"ο"_s}, // greek small letter omicron, U+03BF NEW
|
||||
{u"pi"_s, u"π"_s}, // greek small letter pi, U+03C0 ISOgrk3
|
||||
{u"rho"_s, u"ρ"_s}, // greek small letter rho, U+03C1 ISOgrk3
|
||||
{u"sigmaf"_s, u"ς"_s}, // greek small letter final sigma, U+03C2 ISOgrk3
|
||||
{u"sigma"_s, u"σ"_s}, // greek small letter sigma, U+03C3 ISOgrk3
|
||||
{u"tau"_s, u"τ"_s}, // greek small letter tau, U+03C4 ISOgrk3
|
||||
{u"upsilon"_s, u"υ"_s}, // greek small letter upsilon, U+03C5 ISOgrk3
|
||||
{u"phi"_s, u"φ"_s}, // greek small letter phi, U+03C6 ISOgrk3
|
||||
{u"chi"_s, u"χ"_s}, // greek small letter chi, U+03C7 ISOgrk3
|
||||
{u"psi"_s, u"ψ"_s}, // greek small letter psi, U+03C8 ISOgrk3
|
||||
{u"omega"_s, u"ω"_s}, // greek small letter omega, U+03C9 ISOgrk3
|
||||
{u"thetasym"_s, u"ϑ"_s}, // greek theta symbol, U+03D1 NEW
|
||||
{u"upsih"_s, u"ϒ"_s}, // greek upsilon with hook symbol, U+03D2 NEW
|
||||
{u"piv"_s, u"ϖ"_s}, // greek pi symbol, U+03D6 ISOgrk3
|
||||
|
||||
// General Punctuation
|
||||
{u"bull"_qs, u"•"_qs}, // bullet = black small circle, U+2022 ISOpub
|
||||
{u"bull"_s, u"•"_s}, // bullet = black small circle, U+2022 ISOpub
|
||||
// bullet is NOT the same as bullet operator, U+2219
|
||||
{u"hellip"_qs, u"…"_qs}, // horizontal ellipsis = three dot leader, U+2026 ISOpub
|
||||
{u"prime"_qs, u"′"_qs}, // prime = minutes = feet, U+2032 ISOtech
|
||||
{u"Prime"_qs, u"″"_qs}, // double prime = seconds = inches, U+2033 ISOtech
|
||||
{u"oline"_qs, u"‾"_qs}, // overline = spacing overscore, U+203E NEW
|
||||
{u"frasl"_qs, u"⁄"_qs}, // fraction slash, U+2044 NEW
|
||||
{u"hellip"_s, u"…"_s}, // horizontal ellipsis = three dot leader, U+2026 ISOpub
|
||||
{u"prime"_s, u"′"_s}, // prime = minutes = feet, U+2032 ISOtech
|
||||
{u"Prime"_s, u"″"_s}, // double prime = seconds = inches, U+2033 ISOtech
|
||||
{u"oline"_s, u"‾"_s}, // overline = spacing overscore, U+203E NEW
|
||||
{u"frasl"_s, u"⁄"_s}, // fraction slash, U+2044 NEW
|
||||
|
||||
// Letterlike Symbols
|
||||
{u"weierp"_qs, u"℘"_qs}, // script capital P = power set = Weierstrass p, U+2118 ISOamso
|
||||
{u"image"_qs, u"ℑ"_qs}, // black-letter capital I = imaginary part, U+2111 ISOamso
|
||||
{u"real"_qs, u"ℜ"_qs}, // black-letter capital R = real part symbol, U+211C ISOamso
|
||||
{u"trade"_qs, u"™"_qs}, // trade mark sign, U+2122 ISOnum
|
||||
{u"alefsym"_qs, u"ℵ"_qs}, // alef symbol = first transfinite cardinal, U+2135 NEW
|
||||
{u"weierp"_s, u"℘"_s}, // script capital P = power set = Weierstrass p, U+2118 ISOamso
|
||||
{u"image"_s, u"ℑ"_s}, // black-letter capital I = imaginary part, U+2111 ISOamso
|
||||
{u"real"_s, u"ℜ"_s}, // black-letter capital R = real part symbol, U+211C ISOamso
|
||||
{u"trade"_s, u"™"_s}, // trade mark sign, U+2122 ISOnum
|
||||
{u"alefsym"_s, u"ℵ"_s}, // alef symbol = first transfinite cardinal, U+2135 NEW
|
||||
// alef symbol is NOT the same as hebrew letter alef,
|
||||
// U+05D0 although the same glyph could be used to depict both characters
|
||||
|
||||
// Arrows
|
||||
{u"larr"_qs, u"←"_qs}, // leftwards arrow, U+2190 ISOnum
|
||||
{u"uarr"_qs, u"↑"_qs}, // upwards arrow, U+2191 ISOnum
|
||||
{u"rarr"_qs, u"→"_qs}, // rightwards arrow, U+2192 ISOnum
|
||||
{u"darr"_qs, u"↓"_qs}, // downwards arrow, U+2193 ISOnum
|
||||
{u"harr"_qs, u"↔"_qs}, // left right arrow, U+2194 ISOamsa
|
||||
{u"crarr"_qs, u"↵"_qs}, // downwards arrow with corner leftwards = carriage return, U+21B5 NEW
|
||||
{u"lArr"_qs, u"⇐"_qs}, // leftwards double arrow, U+21D0 ISOtech
|
||||
{u"larr"_s, u"←"_s}, // leftwards arrow, U+2190 ISOnum
|
||||
{u"uarr"_s, u"↑"_s}, // upwards arrow, U+2191 ISOnum
|
||||
{u"rarr"_s, u"→"_s}, // rightwards arrow, U+2192 ISOnum
|
||||
{u"darr"_s, u"↓"_s}, // downwards arrow, U+2193 ISOnum
|
||||
{u"harr"_s, u"↔"_s}, // left right arrow, U+2194 ISOamsa
|
||||
{u"crarr"_s, u"↵"_s}, // downwards arrow with corner leftwards = carriage return, U+21B5 NEW
|
||||
{u"lArr"_s, u"⇐"_s}, // leftwards double arrow, U+21D0 ISOtech
|
||||
// Unicode does not say that lArr is the same as the 'is implied by' arrow
|
||||
// but also does not have any other character for that function. So lArr can
|
||||
// be used for 'is implied by' as ISOtech suggests
|
||||
{u"uArr"_qs, u"⇑"_qs}, // upwards double arrow, U+21D1 ISOamsa
|
||||
{u"rArr"_qs, u"⇒"_qs}, // rightwards double arrow, U+21D2 ISOtech
|
||||
{u"uArr"_s, u"⇑"_s}, // upwards double arrow, U+21D1 ISOamsa
|
||||
{u"rArr"_s, u"⇒"_s}, // rightwards double arrow, U+21D2 ISOtech
|
||||
// Unicode does not say this is the 'implies' character but does not have
|
||||
// another character with this function so rArr can be used for 'implies'
|
||||
// as ISOtech suggests
|
||||
{u"dArr"_qs, u"⇓"_qs}, // downwards double arrow, U+21D3 ISOamsa
|
||||
{u"hArr"_qs, u"⇔"_qs}, // left right double arrow, U+21D4 ISOamsa
|
||||
{u"dArr"_s, u"⇓"_s}, // downwards double arrow, U+21D3 ISOamsa
|
||||
{u"hArr"_s, u"⇔"_s}, // left right double arrow, U+21D4 ISOamsa
|
||||
|
||||
// Mathematical Operators
|
||||
{u"forall"_qs, u"∀"_qs}, // for all, U+2200 ISOtech
|
||||
{u"part"_qs, u"∂"_qs}, // partial differential, U+2202 ISOtech
|
||||
{u"exist"_qs, u"∃"_qs}, // there exists, U+2203 ISOtech
|
||||
{u"empty"_qs, u"∅"_qs}, // empty set = null set, U+2205 ISOamso
|
||||
{u"nabla"_qs, u"∇"_qs}, // nabla = backward difference, U+2207 ISOtech
|
||||
{u"isin"_qs, u"∈"_qs}, // element of, U+2208 ISOtech
|
||||
{u"notin"_qs, u"∉"_qs}, // not an element of, U+2209 ISOtech
|
||||
{u"ni"_qs, u"∋"_qs}, // contains as member, U+220B ISOtech
|
||||
{u"prod"_qs, u"∏"_qs}, // n-ary product = product sign, U+220F ISOamsb
|
||||
{u"forall"_s, u"∀"_s}, // for all, U+2200 ISOtech
|
||||
{u"part"_s, u"∂"_s}, // partial differential, U+2202 ISOtech
|
||||
{u"exist"_s, u"∃"_s}, // there exists, U+2203 ISOtech
|
||||
{u"empty"_s, u"∅"_s}, // empty set = null set, U+2205 ISOamso
|
||||
{u"nabla"_s, u"∇"_s}, // nabla = backward difference, U+2207 ISOtech
|
||||
{u"isin"_s, u"∈"_s}, // element of, U+2208 ISOtech
|
||||
{u"notin"_s, u"∉"_s}, // not an element of, U+2209 ISOtech
|
||||
{u"ni"_s, u"∋"_s}, // contains as member, U+220B ISOtech
|
||||
{u"prod"_s, u"∏"_s}, // n-ary product = product sign, U+220F ISOamsb
|
||||
// prod is NOT the same character as U+03A0 'greek capital letter pi' though
|
||||
// the same glyph might be used for both
|
||||
{u"sum"_qs, u"∑"_qs}, // n-ary summation, U+2211 ISOamsb
|
||||
{u"sum"_s, u"∑"_s}, // n-ary summation, U+2211 ISOamsb
|
||||
// sum is NOT the same character as U+03A3 'greek capital letter sigma'
|
||||
// though the same glyph might be used for both
|
||||
{u"minus"_qs, u"−"_qs}, // minus sign, U+2212 ISOtech
|
||||
{u"lowast"_qs, u"∗"_qs}, // asterisk operator, U+2217 ISOtech
|
||||
{u"radic"_qs, u"√"_qs}, // square root = radical sign, U+221A ISOtech
|
||||
{u"prop"_qs, u"∝"_qs}, // proportional to, U+221D ISOtech
|
||||
{u"infin"_qs, u"∞"_qs}, // infinity, U+221E ISOtech
|
||||
{u"ang"_qs, u"∠"_qs}, // angle, U+2220 ISOamso
|
||||
{u"and"_qs, u"∧"_qs}, // logical and = wedge, U+2227 ISOtech
|
||||
{u"or"_qs, u"∨"_qs}, // logical or = vee, U+2228 ISOtech
|
||||
{u"cap"_qs, u"∩"_qs}, // intersection = cap, U+2229 ISOtech
|
||||
{u"cup"_qs, u"∪"_qs}, // union = cup, U+222A ISOtech
|
||||
{u"int"_qs, u"∫"_qs}, // integral, U+222B ISOtech
|
||||
{u"there4"_qs, u"∴"_qs}, // therefore, U+2234 ISOtech
|
||||
{u"sim"_qs, u"∼"_qs}, // tilde operator = varies with = similar to, U+223C ISOtech
|
||||
{u"minus"_s, u"−"_s}, // minus sign, U+2212 ISOtech
|
||||
{u"lowast"_s, u"∗"_s}, // asterisk operator, U+2217 ISOtech
|
||||
{u"radic"_s, u"√"_s}, // square root = radical sign, U+221A ISOtech
|
||||
{u"prop"_s, u"∝"_s}, // proportional to, U+221D ISOtech
|
||||
{u"infin"_s, u"∞"_s}, // infinity, U+221E ISOtech
|
||||
{u"ang"_s, u"∠"_s}, // angle, U+2220 ISOamso
|
||||
{u"and"_s, u"∧"_s}, // logical and = wedge, U+2227 ISOtech
|
||||
{u"or"_s, u"∨"_s}, // logical or = vee, U+2228 ISOtech
|
||||
{u"cap"_s, u"∩"_s}, // intersection = cap, U+2229 ISOtech
|
||||
{u"cup"_s, u"∪"_s}, // union = cup, U+222A ISOtech
|
||||
{u"int"_s, u"∫"_s}, // integral, U+222B ISOtech
|
||||
{u"there4"_s, u"∴"_s}, // therefore, U+2234 ISOtech
|
||||
{u"sim"_s, u"∼"_s}, // tilde operator = varies with = similar to, U+223C ISOtech
|
||||
// tilde operator is NOT the same character as the tilde, U+007E,
|
||||
// although the same glyph might be used to represent both
|
||||
{u"cong"_qs, u"≅"_qs}, // approximately equal to, U+2245 ISOtech
|
||||
{u"asymp"_qs, u"≈"_qs}, // almost equal to = asymptotic to, U+2248 ISOamsr
|
||||
{u"ne"_qs, u"≠"_qs}, // not equal to, U+2260 ISOtech
|
||||
{u"equiv"_qs, u"≡"_qs}, // identical to, U+2261 ISOtech
|
||||
{u"le"_qs, u"≤"_qs}, // less-than or equal to, U+2264 ISOtech
|
||||
{u"ge"_qs, u"≥"_qs}, // greater-than or equal to, U+2265 ISOtech
|
||||
{u"sub"_qs, u"⊂"_qs}, // subset of, U+2282 ISOtech
|
||||
{u"sup"_qs, u"⊃"_qs}, // superset of, U+2283 ISOtech
|
||||
{u"nsub"_qs, u"⊄"_qs}, // not a subset of, U+2284 ISOamsn
|
||||
{u"sube"_qs, u"⊆"_qs}, // subset of or equal to, U+2286 ISOtech
|
||||
{u"supe"_qs, u"⊇"_qs}, // superset of or equal to, U+2287 ISOtech
|
||||
{u"oplus"_qs, u"⊕"_qs}, // circled plus = direct sum, U+2295 ISOamsb
|
||||
{u"otimes"_qs, u"⊗"_qs}, // circled times = vector product, U+2297 ISOamsb
|
||||
{u"perp"_qs, u"⊥"_qs}, // up tack = orthogonal to = perpendicular, U+22A5 ISOtech
|
||||
{u"sdot"_qs, u"⋅"_qs}, // dot operator, U+22C5 ISOamsb
|
||||
{u"cong"_s, u"≅"_s}, // approximately equal to, U+2245 ISOtech
|
||||
{u"asymp"_s, u"≈"_s}, // almost equal to = asymptotic to, U+2248 ISOamsr
|
||||
{u"ne"_s, u"≠"_s}, // not equal to, U+2260 ISOtech
|
||||
{u"equiv"_s, u"≡"_s}, // identical to, U+2261 ISOtech
|
||||
{u"le"_s, u"≤"_s}, // less-than or equal to, U+2264 ISOtech
|
||||
{u"ge"_s, u"≥"_s}, // greater-than or equal to, U+2265 ISOtech
|
||||
{u"sub"_s, u"⊂"_s}, // subset of, U+2282 ISOtech
|
||||
{u"sup"_s, u"⊃"_s}, // superset of, U+2283 ISOtech
|
||||
{u"nsub"_s, u"⊄"_s}, // not a subset of, U+2284 ISOamsn
|
||||
{u"sube"_s, u"⊆"_s}, // subset of or equal to, U+2286 ISOtech
|
||||
{u"supe"_s, u"⊇"_s}, // superset of or equal to, U+2287 ISOtech
|
||||
{u"oplus"_s, u"⊕"_s}, // circled plus = direct sum, U+2295 ISOamsb
|
||||
{u"otimes"_s, u"⊗"_s}, // circled times = vector product, U+2297 ISOamsb
|
||||
{u"perp"_s, u"⊥"_s}, // up tack = orthogonal to = perpendicular, U+22A5 ISOtech
|
||||
{u"sdot"_s, u"⋅"_s}, // dot operator, U+22C5 ISOamsb
|
||||
// dot operator is NOT the same character as U+00B7 middle dot
|
||||
|
||||
// Miscellaneous Technical
|
||||
{u"lceil"_qs, u"⌈"_qs}, // left ceiling = APL upstile, U+2308 ISOamsc
|
||||
{u"rceil"_qs, u"⌉"_qs}, // right ceiling, U+2309 ISOamsc
|
||||
{u"lfloor"_qs, u"⌊"_qs}, // left floor = APL downstile, U+230A ISOamsc
|
||||
{u"rfloor"_qs, u"⌋"_qs}, // right floor, U+230B ISOamsc
|
||||
{u"lang"_qs, u"〈"_qs}, // left-pointing angle bracket = bra, U+2329 ISOtech
|
||||
{u"lceil"_s, u"⌈"_s}, // left ceiling = APL upstile, U+2308 ISOamsc
|
||||
{u"rceil"_s, u"⌉"_s}, // right ceiling, U+2309 ISOamsc
|
||||
{u"lfloor"_s, u"⌊"_s}, // left floor = APL downstile, U+230A ISOamsc
|
||||
{u"rfloor"_s, u"⌋"_s}, // right floor, U+230B ISOamsc
|
||||
{u"lang"_s, u"〈"_s}, // left-pointing angle bracket = bra, U+2329 ISOtech
|
||||
// lang is NOT the same character as U+003C 'less than sign'
|
||||
// or U+2039 'single left-pointing angle quotation mark'
|
||||
{u"rang"_qs, u"〉"_qs}, // right-pointing angle bracket = ket, U+232A ISOtech
|
||||
{u"rang"_s, u"〉"_s}, // right-pointing angle bracket = ket, U+232A ISOtech
|
||||
// rang is NOT the same character as U+003E 'greater than sign'
|
||||
// or U+203A 'single right-pointing angle quotation mark'
|
||||
|
||||
// Geometric Shapes
|
||||
{u"loz"_qs, u"◊"_qs}, // lozenge, U+25CA ISOpub
|
||||
{u"loz"_s, u"◊"_s}, // lozenge, U+25CA ISOpub
|
||||
|
||||
// Miscellaneous Symbols
|
||||
{u"spades"_qs, u"♠"_qs}, // black spade suit, U+2660 ISOpub
|
||||
{u"clubs"_qs, u"♣"_qs}, // black club suit = shamrock, U+2663 ISOpub
|
||||
{u"hearts"_qs, u"♥"_qs}, // black heart suit = valentine, U+2665 ISOpub
|
||||
{u"diams"_qs, u"♦"_qs} // black diamond suit, U+2666 ISOpub
|
||||
{u"spades"_s, u"♠"_s}, // black spade suit, U+2660 ISOpub
|
||||
{u"clubs"_s, u"♣"_s}, // black club suit = shamrock, U+2663 ISOpub
|
||||
{u"hearts"_s, u"♥"_s}, // black heart suit = valentine, U+2665 ISOpub
|
||||
{u"diams"_s, u"♦"_s} // black diamond suit, U+2666 ISOpub
|
||||
};
|
||||
return HTMLEntities.value(name);
|
||||
}
|
||||
@ -392,7 +392,7 @@ namespace
|
||||
int nmin = 8;
|
||||
int nsec = 9;
|
||||
// Also accept obsolete form "Weekday, DD-Mon-YY HH:MM:SS ±hhmm"
|
||||
QRegularExpression rx {u"^(?:([A-Z][a-z]+),\\s*)?(\\d{1,2})(\\s+|-)([^-\\s]+)(\\s+|-)(\\d{2,4})\\s+(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s+(\\S+)$"_qs};
|
||||
QRegularExpression rx {u"^(?:([A-Z][a-z]+),\\s*)?(\\d{1,2})(\\s+|-)([^-\\s]+)(\\s+|-)(\\d{2,4})\\s+(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s+(\\S+)$"_s};
|
||||
QRegularExpressionMatch rxMatch;
|
||||
QStringList parts;
|
||||
if (str.indexOf(rx, 0, &rxMatch) == 0)
|
||||
@ -407,7 +407,7 @@ namespace
|
||||
else
|
||||
{
|
||||
// Check for the obsolete form "Wdy Mon DD HH:MM:SS YYYY"
|
||||
rx = QRegularExpression {u"^([A-Z][a-z]+)\\s+(\\S+)\\s+(\\d\\d)\\s+(\\d\\d):(\\d\\d):(\\d\\d)\\s+(\\d\\d\\d\\d)$"_qs};
|
||||
rx = QRegularExpression {u"^([A-Z][a-z]+)\\s+(\\S+)\\s+(\\d\\d)\\s+(\\d\\d):(\\d\\d):(\\d\\d)\\s+(\\d\\d\\d\\d)$"_s};
|
||||
if (str.indexOf(rx, 0, &rxMatch) != 0)
|
||||
return QDateTime::currentDateTime();
|
||||
|
||||
@ -466,7 +466,7 @@ namespace
|
||||
bool negOffset = false;
|
||||
if (parts.count() > 10)
|
||||
{
|
||||
rx = QRegularExpression {u"^([+-])(\\d\\d)(\\d\\d)$"_qs};
|
||||
rx = QRegularExpression {u"^([+-])(\\d\\d)(\\d\\d)$"_s};
|
||||
if (parts[10].indexOf(rx, 0, &rxMatch) == 0)
|
||||
{
|
||||
// It's a UTC offset ±hhmm
|
||||
@ -622,10 +622,10 @@ void RSS::Private::Parser::parseRssArticle(QXmlStreamReader &xml)
|
||||
}
|
||||
else if (name == u"enclosure")
|
||||
{
|
||||
if (xml.attributes().value(u"type"_qs) == u"application/x-bittorrent")
|
||||
article[Article::KeyTorrentURL] = xml.attributes().value(u"url"_qs).toString();
|
||||
else if (xml.attributes().value(u"type"_qs).isEmpty())
|
||||
altTorrentUrl = xml.attributes().value(u"url"_qs).toString();
|
||||
if (xml.attributes().value(u"type"_s) == u"application/x-bittorrent")
|
||||
article[Article::KeyTorrentURL] = xml.attributes().value(u"url"_s).toString();
|
||||
else if (xml.attributes().value(u"type"_s).isEmpty())
|
||||
altTorrentUrl = xml.attributes().value(u"url"_s).toString();
|
||||
}
|
||||
else if (name == u"link")
|
||||
{
|
||||
@ -720,7 +720,7 @@ void RSS::Private::Parser::parseAtomArticle(QXmlStreamReader &xml)
|
||||
{
|
||||
const QString link = (xml.attributes().isEmpty()
|
||||
? xml.readElementText().trimmed()
|
||||
: xml.attributes().value(u"href"_qs).toString());
|
||||
: xml.attributes().value(u"href"_s).toString());
|
||||
|
||||
if (link.startsWith(u"magnet:", Qt::CaseInsensitive))
|
||||
{
|
||||
@ -783,7 +783,7 @@ void RSS::Private::Parser::parseAtomArticle(QXmlStreamReader &xml)
|
||||
|
||||
void RSS::Private::Parser::parseAtomChannel(QXmlStreamReader &xml)
|
||||
{
|
||||
m_baseUrl = xml.attributes().value(u"xml:base"_qs).toString();
|
||||
m_baseUrl = xml.attributes().value(u"xml:base"_s).toString();
|
||||
|
||||
while (!xml.atEnd())
|
||||
{
|
||||
|
@ -51,18 +51,18 @@
|
||||
#include "rss_folder.h"
|
||||
#include "rss_item.h"
|
||||
|
||||
const QString CONF_FOLDER_NAME = u"rss"_qs;
|
||||
const QString DATA_FOLDER_NAME = u"rss/articles"_qs;
|
||||
const QString FEEDS_FILE_NAME = u"feeds.json"_qs;
|
||||
const QString CONF_FOLDER_NAME = u"rss"_s;
|
||||
const QString DATA_FOLDER_NAME = u"rss/articles"_s;
|
||||
const QString FEEDS_FILE_NAME = u"feeds.json"_s;
|
||||
|
||||
using namespace RSS;
|
||||
|
||||
QPointer<Session> Session::m_instance = nullptr;
|
||||
|
||||
Session::Session()
|
||||
: m_storeProcessingEnabled(u"RSS/Session/EnableProcessing"_qs)
|
||||
, m_storeRefreshInterval(u"RSS/Session/RefreshInterval"_qs, 30)
|
||||
, m_storeMaxArticlesPerFeed(u"RSS/Session/MaxArticlesPerFeed"_qs, 50)
|
||||
: m_storeProcessingEnabled(u"RSS/Session/EnableProcessing"_s)
|
||||
, m_storeRefreshInterval(u"RSS/Session/RefreshInterval"_s, 30)
|
||||
, m_storeMaxArticlesPerFeed(u"RSS/Session/MaxArticlesPerFeed"_s, 50)
|
||||
, m_workingThread(new QThread)
|
||||
{
|
||||
Q_ASSERT(!m_instance); // only one instance is allowed
|
||||
@ -86,7 +86,7 @@ Session::Session()
|
||||
.arg(fileName.toString(), errorString), Log::WARNING);
|
||||
});
|
||||
|
||||
m_itemsByPath.insert(u""_qs, new Folder); // root folder
|
||||
m_itemsByPath.insert(u""_s, new Folder); // root folder
|
||||
|
||||
m_workingThread->start();
|
||||
load();
|
||||
@ -102,22 +102,22 @@ Session::Session()
|
||||
// (at least on Windows, QSettings is case-insensitive and it can get
|
||||
// confused when asked about settings that differ only in their case)
|
||||
auto *settingsStorage = SettingsStorage::instance();
|
||||
settingsStorage->removeValue(u"Rss/streamList"_qs);
|
||||
settingsStorage->removeValue(u"Rss/streamAlias"_qs);
|
||||
settingsStorage->removeValue(u"Rss/open_folders"_qs);
|
||||
settingsStorage->removeValue(u"Rss/qt5/splitter_h"_qs);
|
||||
settingsStorage->removeValue(u"Rss/qt5/splitterMain"_qs);
|
||||
settingsStorage->removeValue(u"Rss/hosts_cookies"_qs);
|
||||
settingsStorage->removeValue(u"RSS/streamList"_qs);
|
||||
settingsStorage->removeValue(u"RSS/streamAlias"_qs);
|
||||
settingsStorage->removeValue(u"RSS/open_folders"_qs);
|
||||
settingsStorage->removeValue(u"RSS/qt5/splitter_h"_qs);
|
||||
settingsStorage->removeValue(u"RSS/qt5/splitterMain"_qs);
|
||||
settingsStorage->removeValue(u"RSS/hosts_cookies"_qs);
|
||||
settingsStorage->removeValue(u"Rss/Session/EnableProcessing"_qs);
|
||||
settingsStorage->removeValue(u"Rss/Session/RefreshInterval"_qs);
|
||||
settingsStorage->removeValue(u"Rss/Session/MaxArticlesPerFeed"_qs);
|
||||
settingsStorage->removeValue(u"Rss/AutoDownloader/EnableProcessing"_qs);
|
||||
settingsStorage->removeValue(u"Rss/streamList"_s);
|
||||
settingsStorage->removeValue(u"Rss/streamAlias"_s);
|
||||
settingsStorage->removeValue(u"Rss/open_folders"_s);
|
||||
settingsStorage->removeValue(u"Rss/qt5/splitter_h"_s);
|
||||
settingsStorage->removeValue(u"Rss/qt5/splitterMain"_s);
|
||||
settingsStorage->removeValue(u"Rss/hosts_cookies"_s);
|
||||
settingsStorage->removeValue(u"RSS/streamList"_s);
|
||||
settingsStorage->removeValue(u"RSS/streamAlias"_s);
|
||||
settingsStorage->removeValue(u"RSS/open_folders"_s);
|
||||
settingsStorage->removeValue(u"RSS/qt5/splitter_h"_s);
|
||||
settingsStorage->removeValue(u"RSS/qt5/splitterMain"_s);
|
||||
settingsStorage->removeValue(u"RSS/hosts_cookies"_s);
|
||||
settingsStorage->removeValue(u"Rss/Session/EnableProcessing"_s);
|
||||
settingsStorage->removeValue(u"Rss/Session/RefreshInterval"_s);
|
||||
settingsStorage->removeValue(u"Rss/Session/MaxArticlesPerFeed"_s);
|
||||
settingsStorage->removeValue(u"Rss/AutoDownloader/EnableProcessing"_s);
|
||||
}
|
||||
|
||||
Session::~Session()
|
||||
@ -125,7 +125,7 @@ Session::~Session()
|
||||
qDebug() << "Deleting RSS Session...";
|
||||
|
||||
//store();
|
||||
delete m_itemsByPath[u""_qs]; // deleting root folder
|
||||
delete m_itemsByPath[u""_s]; // deleting root folder
|
||||
|
||||
qDebug() << "RSS Session deleted.";
|
||||
}
|
||||
@ -320,7 +320,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
if (!valObj[u"url"].isString())
|
||||
{
|
||||
LogMsg(tr("Couldn't load RSS feed. Feed: \"%1\". Reason: URL is required.")
|
||||
.arg(u"%1\\%2"_qs.arg(folder->path(), key)), Log::WARNING);
|
||||
.arg(u"%1\\%2"_s.arg(folder->path(), key)), Log::WARNING);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
if (uid.isNull())
|
||||
{
|
||||
LogMsg(tr("Couldn't load RSS feed. Feed: \"%1\". Reason: UID is invalid.")
|
||||
.arg(u"%1\\%2"_qs.arg(folder->path(), key)), Log::WARNING);
|
||||
.arg(u"%1\\%2"_s.arg(folder->path(), key)), Log::WARNING);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -359,7 +359,7 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
else
|
||||
{
|
||||
LogMsg(tr("Couldn't load RSS item. Item: \"%1\". Invalid data format.")
|
||||
.arg(u"%1\\%2"_qs.arg(folder->path(), key)), Log::WARNING);
|
||||
.arg(u"%1\\%2"_s.arg(folder->path(), key)), Log::WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
@ -369,8 +369,8 @@ void Session::loadFolder(const QJsonObject &jsonObj, Folder *folder)
|
||||
|
||||
void Session::loadLegacy()
|
||||
{
|
||||
const auto legacyFeedPaths = SettingsStorage::instance()->loadValue<QStringList>(u"Rss/streamList"_qs);
|
||||
const auto feedAliases = SettingsStorage::instance()->loadValue<QStringList>(u"Rss/streamAlias"_qs);
|
||||
const auto legacyFeedPaths = SettingsStorage::instance()->loadValue<QStringList>(u"Rss/streamList"_s);
|
||||
const auto feedAliases = SettingsStorage::instance()->loadValue<QStringList>(u"Rss/streamAlias"_s);
|
||||
if (legacyFeedPaths.size() != feedAliases.size())
|
||||
{
|
||||
LogMsg(tr("Corrupted RSS list, not loading it."), Log::WARNING);
|
||||
@ -498,7 +498,7 @@ AsyncFileStorage *Session::dataFileStorage() const
|
||||
|
||||
Folder *Session::rootFolder() const
|
||||
{
|
||||
return static_cast<Folder *>(m_itemsByPath.value(u""_qs));
|
||||
return static_cast<Folder *>(m_itemsByPath.value(u""_s));
|
||||
}
|
||||
|
||||
QList<Feed *> Session::feeds() const
|
||||
|
@ -47,7 +47,7 @@ SearchDownloadHandler::SearchDownloadHandler(const QString &siteUrl, const QStri
|
||||
const QStringList params
|
||||
{
|
||||
Utils::ForeignApps::PYTHON_ISOLATE_MODE_FLAG,
|
||||
(SearchPluginManager::engineLocation() / Path(u"nova2dl.py"_qs)).toString(),
|
||||
(SearchPluginManager::engineLocation() / Path(u"nova2dl.py"_s)).toString(),
|
||||
siteUrl,
|
||||
url
|
||||
};
|
||||
|
@ -74,7 +74,7 @@ SearchHandler::SearchHandler(const QString &pattern, const QString &category, co
|
||||
const QStringList params
|
||||
{
|
||||
Utils::ForeignApps::PYTHON_ISOLATE_MODE_FLAG,
|
||||
(SearchPluginManager::engineLocation() / Path(u"nova2.py"_qs)).toString(),
|
||||
(SearchPluginManager::engineLocation() / Path(u"nova2.py"_s)).toString(),
|
||||
m_usedPlugins.join(u','),
|
||||
m_category
|
||||
};
|
||||
|
@ -78,7 +78,7 @@ namespace
|
||||
for (const QString &file : files)
|
||||
{
|
||||
const Path path {file};
|
||||
if (path.hasExtension(u".pyc"_qs))
|
||||
if (path.hasExtension(u".pyc"_s))
|
||||
Utils::Fs::removeFile(path);
|
||||
}
|
||||
}
|
||||
@ -88,7 +88,7 @@ namespace
|
||||
QPointer<SearchPluginManager> SearchPluginManager::m_instance = nullptr;
|
||||
|
||||
SearchPluginManager::SearchPluginManager()
|
||||
: m_updateUrl(u"https://searchplugins.qbittorrent.org/nova3/engines/"_qs)
|
||||
: m_updateUrl(u"https://searchplugins.qbittorrent.org/nova3/engines/"_s)
|
||||
{
|
||||
Q_ASSERT(!m_instance); // only one instance is allowed
|
||||
m_instance = this;
|
||||
@ -204,7 +204,7 @@ void SearchPluginManager::enablePlugin(const QString &name, const bool enabled)
|
||||
// Updates shipped plugin
|
||||
void SearchPluginManager::updatePlugin(const QString &name)
|
||||
{
|
||||
installPlugin(u"%1%2.py"_qs.arg(m_updateUrl, name));
|
||||
installPlugin(u"%1%2.py"_s.arg(m_updateUrl, name));
|
||||
}
|
||||
|
||||
// Install or update plugin from file or url
|
||||
@ -354,15 +354,15 @@ QString SearchPluginManager::categoryFullName(const QString &categoryName)
|
||||
{
|
||||
const QHash<QString, QString> categoryTable
|
||||
{
|
||||
{u"all"_qs, tr("All categories")},
|
||||
{u"movies"_qs, tr("Movies")},
|
||||
{u"tv"_qs, tr("TV shows")},
|
||||
{u"music"_qs, tr("Music")},
|
||||
{u"games"_qs, tr("Games")},
|
||||
{u"anime"_qs, tr("Anime")},
|
||||
{u"software"_qs, tr("Software")},
|
||||
{u"pictures"_qs, tr("Pictures")},
|
||||
{u"books"_qs, tr("Books")}
|
||||
{u"all"_s, tr("All categories")},
|
||||
{u"movies"_s, tr("Movies")},
|
||||
{u"tv"_s, tr("TV shows")},
|
||||
{u"music"_s, tr("Music")},
|
||||
{u"games"_s, tr("Games")},
|
||||
{u"anime"_s, tr("Anime")},
|
||||
{u"software"_s, tr("Software")},
|
||||
{u"pictures"_s, tr("Pictures")},
|
||||
{u"books"_s, tr("Books")}
|
||||
};
|
||||
return categoryTable.value(categoryName);
|
||||
}
|
||||
@ -374,7 +374,7 @@ QString SearchPluginManager::pluginFullName(const QString &pluginName) const
|
||||
|
||||
Path SearchPluginManager::pluginsLocation()
|
||||
{
|
||||
return (engineLocation() / Path(u"engines"_qs));
|
||||
return (engineLocation() / Path(u"engines"_s));
|
||||
}
|
||||
|
||||
Path SearchPluginManager::engineLocation()
|
||||
@ -382,7 +382,7 @@ Path SearchPluginManager::engineLocation()
|
||||
static Path location;
|
||||
if (location.isEmpty())
|
||||
{
|
||||
location = specialFolderLocation(SpecialFolder::Data) / Path(u"nova3"_qs);
|
||||
location = specialFolderLocation(SpecialFolder::Data) / Path(u"nova3"_s);
|
||||
Utils::Fs::mkpath(location);
|
||||
}
|
||||
|
||||
@ -403,24 +403,24 @@ void SearchPluginManager::applyProxySettings()
|
||||
case Net::ProxyType::HTTP:
|
||||
if (proxyConfig.authEnabled)
|
||||
{
|
||||
proxyStrHTTP = u"http://%1:%2@%3:%4"_qs.arg(proxyConfig.username
|
||||
proxyStrHTTP = u"http://%1:%2@%3:%4"_s.arg(proxyConfig.username
|
||||
, proxyConfig.password, proxyConfig.ip, QString::number(proxyConfig.port));
|
||||
}
|
||||
else
|
||||
{
|
||||
proxyStrHTTP = u"http://%1:%2"_qs.arg(proxyConfig.ip, QString::number(proxyConfig.port));
|
||||
proxyStrHTTP = u"http://%1:%2"_s.arg(proxyConfig.ip, QString::number(proxyConfig.port));
|
||||
}
|
||||
break;
|
||||
|
||||
case Net::ProxyType::SOCKS5:
|
||||
if (proxyConfig.authEnabled)
|
||||
{
|
||||
proxyStrSOCK = u"%1:%2@%3:%4"_qs.arg(proxyConfig.username
|
||||
proxyStrSOCK = u"%1:%2@%3:%4"_s.arg(proxyConfig.username
|
||||
, proxyConfig.password, proxyConfig.ip, QString::number(proxyConfig.port));
|
||||
}
|
||||
else
|
||||
{
|
||||
proxyStrSOCK = u"%1:%2"_qs.arg(proxyConfig.ip, QString::number(proxyConfig.port));
|
||||
proxyStrSOCK = u"%1:%2"_s.arg(proxyConfig.ip, QString::number(proxyConfig.port));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -459,7 +459,7 @@ void SearchPluginManager::pluginDownloadFinished(const Net::DownloadResult &resu
|
||||
{
|
||||
const QString url = result.url;
|
||||
QString pluginName = url.mid(url.lastIndexOf(u'/') + 1);
|
||||
pluginName.replace(u".py"_qs, u""_qs, Qt::CaseInsensitive);
|
||||
pluginName.replace(u".py"_s, u""_s, Qt::CaseInsensitive);
|
||||
|
||||
if (pluginInfo(pluginName))
|
||||
emit pluginUpdateFailed(pluginName, tr("Failed to download the plugin file. %1").arg(result.errorString));
|
||||
@ -474,20 +474,20 @@ void SearchPluginManager::updateNova()
|
||||
// create nova directory if necessary
|
||||
const Path enginePath = engineLocation();
|
||||
|
||||
QFile packageFile {(enginePath / Path(u"__init__.py"_qs)).data()};
|
||||
QFile packageFile {(enginePath / Path(u"__init__.py"_s)).data()};
|
||||
packageFile.open(QIODevice::WriteOnly);
|
||||
packageFile.close();
|
||||
|
||||
Utils::Fs::mkdir(enginePath / Path(u"engines"_qs));
|
||||
Utils::Fs::mkdir(enginePath / Path(u"engines"_s));
|
||||
|
||||
QFile packageFile2 {(enginePath / Path(u"engines/__init__.py"_qs)).data()};
|
||||
QFile packageFile2 {(enginePath / Path(u"engines/__init__.py"_s)).data()};
|
||||
packageFile2.open(QIODevice::WriteOnly);
|
||||
packageFile2.close();
|
||||
|
||||
// Copy search plugin files (if necessary)
|
||||
const auto updateFile = [&enginePath](const Path &filename, const bool compareVersion)
|
||||
{
|
||||
const Path filePathBundled = Path(u":/searchengine/nova3"_qs) / filename;
|
||||
const Path filePathBundled = Path(u":/searchengine/nova3"_s) / filename;
|
||||
const Path filePathDisk = enginePath / filename;
|
||||
|
||||
if (compareVersion && (getPluginVersion(filePathBundled) <= getPluginVersion(filePathDisk)))
|
||||
@ -497,11 +497,11 @@ void SearchPluginManager::updateNova()
|
||||
Utils::Fs::copyFile(filePathBundled, filePathDisk);
|
||||
};
|
||||
|
||||
updateFile(Path(u"helpers.py"_qs), true);
|
||||
updateFile(Path(u"nova2.py"_qs), true);
|
||||
updateFile(Path(u"nova2dl.py"_qs), true);
|
||||
updateFile(Path(u"novaprinter.py"_qs), true);
|
||||
updateFile(Path(u"socks.py"_qs), false);
|
||||
updateFile(Path(u"helpers.py"_s), true);
|
||||
updateFile(Path(u"nova2.py"_s), true);
|
||||
updateFile(Path(u"nova2dl.py"_s), true);
|
||||
updateFile(Path(u"novaprinter.py"_s), true);
|
||||
updateFile(Path(u"socks.py"_s), false);
|
||||
}
|
||||
|
||||
void SearchPluginManager::update()
|
||||
@ -512,8 +512,8 @@ void SearchPluginManager::update()
|
||||
const QStringList params
|
||||
{
|
||||
Utils::ForeignApps::PYTHON_ISOLATE_MODE_FLAG,
|
||||
(engineLocation() / Path(u"/nova2.py"_qs)).toString(),
|
||||
u"--capabilities"_qs
|
||||
(engineLocation() / Path(u"/nova2.py"_s)).toString(),
|
||||
u"--capabilities"_s
|
||||
};
|
||||
nova.start(Utils::ForeignApps::pythonInfo().executableName, params, QIODevice::ReadOnly);
|
||||
nova.waitForFinished();
|
||||
@ -544,10 +544,10 @@ void SearchPluginManager::update()
|
||||
auto plugin = std::make_unique<PluginInfo>();
|
||||
plugin->name = pluginName;
|
||||
plugin->version = getPluginVersion(pluginPath(pluginName));
|
||||
plugin->fullName = engineElem.elementsByTagName(u"name"_qs).at(0).toElement().text();
|
||||
plugin->url = engineElem.elementsByTagName(u"url"_qs).at(0).toElement().text();
|
||||
plugin->fullName = engineElem.elementsByTagName(u"name"_s).at(0).toElement().text();
|
||||
plugin->url = engineElem.elementsByTagName(u"url"_s).at(0).toElement().text();
|
||||
|
||||
const QStringList categories = engineElem.elementsByTagName(u"categories"_qs).at(0).toElement().text().split(u' ');
|
||||
const QStringList categories = engineElem.elementsByTagName(u"categories"_s).at(0).toElement().text().split(u' ');
|
||||
for (QString cat : categories)
|
||||
{
|
||||
cat = cat.trimmed();
|
||||
|
@ -46,7 +46,7 @@ using namespace std::chrono_literals;
|
||||
SettingsStorage *SettingsStorage::m_instance = nullptr;
|
||||
|
||||
SettingsStorage::SettingsStorage()
|
||||
: m_nativeSettingsName {u"qBittorrent"_qs}
|
||||
: m_nativeSettingsName {u"qBittorrent"_s}
|
||||
{
|
||||
readNativeSettings();
|
||||
|
||||
|
@ -35,7 +35,7 @@ namespace
|
||||
{
|
||||
SettingValue<TorrentFileGuard::AutoDeleteMode> autoDeleteModeSetting()
|
||||
{
|
||||
return SettingValue<TorrentFileGuard::AutoDeleteMode> {u"Core/AutoDeleteAddedTorrentFile"_qs};
|
||||
return SettingValue<TorrentFileGuard::AutoDeleteMode> {u"Core/AutoDeleteAddedTorrentFile"_s};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,10 +63,10 @@ using namespace std::chrono_literals;
|
||||
|
||||
const std::chrono::seconds WATCH_INTERVAL {10};
|
||||
const int MAX_FAILED_RETRIES = 5;
|
||||
const QString CONF_FILE_NAME = u"watched_folders.json"_qs;
|
||||
const QString CONF_FILE_NAME = u"watched_folders.json"_s;
|
||||
|
||||
const QString OPTION_ADDTORRENTPARAMS = u"add_torrent_params"_qs;
|
||||
const QString OPTION_RECURSIVE = u"recursive"_qs;
|
||||
const QString OPTION_ADDTORRENTPARAMS = u"add_torrent_params"_s;
|
||||
const QString OPTION_RECURSIVE = u"recursive"_s;
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -227,7 +227,7 @@ void TorrentFilesWatcher::load()
|
||||
|
||||
void TorrentFilesWatcher::loadLegacy()
|
||||
{
|
||||
const auto dirs = SettingsStorage::instance()->loadValue<QVariantHash>(u"Preferences/Downloads/ScanDirsV2"_qs);
|
||||
const auto dirs = SettingsStorage::instance()->loadValue<QVariantHash>(u"Preferences/Downloads/ScanDirsV2"_s);
|
||||
|
||||
for (auto it = dirs.cbegin(); it != dirs.cend(); ++it)
|
||||
{
|
||||
@ -259,7 +259,7 @@ void TorrentFilesWatcher::loadLegacy()
|
||||
}
|
||||
|
||||
store();
|
||||
SettingsStorage::instance()->removeValue(u"Preferences/Downloads/ScanDirsV2"_qs);
|
||||
SettingsStorage::instance()->removeValue(u"Preferences/Downloads/ScanDirsV2"_s);
|
||||
}
|
||||
|
||||
void TorrentFilesWatcher::store() const
|
||||
@ -406,7 +406,7 @@ void TorrentFilesWatcher::Worker::processWatchedFolder(const Path &path)
|
||||
void TorrentFilesWatcher::Worker::processFolder(const Path &path, const Path &watchedFolderPath
|
||||
, const TorrentFilesWatcher::WatchedFolderOptions &options)
|
||||
{
|
||||
QDirIterator dirIter {path.data(), {u"*.torrent"_qs, u"*.magnet"_qs}, QDir::Files};
|
||||
QDirIterator dirIter {path.data(), {u"*.torrent"_s, u"*.magnet"_s}, QDir::Files};
|
||||
while (dirIter.hasNext())
|
||||
{
|
||||
const Path filePath {dirIter.next()};
|
||||
@ -426,7 +426,7 @@ void TorrentFilesWatcher::Worker::processFolder(const Path &path, const Path &wa
|
||||
}
|
||||
}
|
||||
|
||||
if (filePath.hasExtension(u".magnet"_qs))
|
||||
if (filePath.hasExtension(u".magnet"_s))
|
||||
{
|
||||
const int fileMaxSize = 100 * 1024 * 1024;
|
||||
|
||||
|
@ -34,66 +34,66 @@
|
||||
// we put all problematic UTF-8 chars/strings in this file.
|
||||
// See issue #3059 for more details (https://github.com/qbittorrent/qBittorrent/issues/3059).
|
||||
|
||||
inline const QString C_COPYRIGHT = u"©"_qs;
|
||||
inline const QString C_INEQUALITY = u"≠"_qs;
|
||||
inline const QString C_INFINITY = u"∞"_qs;
|
||||
inline const QString C_NON_BREAKING_SPACE = u" "_qs;
|
||||
inline const QString C_THIN_SPACE = u" "_qs;
|
||||
inline const QString C_UTP = u"μTP"_qs;
|
||||
inline const QString C_COPYRIGHT = u"©"_s;
|
||||
inline const QString C_INEQUALITY = u"≠"_s;
|
||||
inline const QString C_INFINITY = u"∞"_s;
|
||||
inline const QString C_NON_BREAKING_SPACE = u" "_s;
|
||||
inline const QString C_THIN_SPACE = u" "_s;
|
||||
inline const QString C_UTP = u"μTP"_s;
|
||||
|
||||
inline const QString C_LOCALE_ARABIC = u"عربي"_qs;
|
||||
inline const QString C_LOCALE_ARMENIAN = u"Հայերեն"_qs;
|
||||
inline const QString C_LOCALE_AZERBAIJANI = u"Azərbaycan dili"_qs;
|
||||
inline const QString C_LOCALE_BASQUE = u"Euskara"_qs;
|
||||
inline const QString C_LOCALE_BULGARIAN = u"Български"_qs;
|
||||
inline const QString C_LOCALE_BYELORUSSIAN = u"Беларуская"_qs;
|
||||
inline const QString C_LOCALE_CATALAN = u"Català"_qs;
|
||||
inline const QString C_LOCALE_CHINESE_SIMPLIFIED = u"简体中文"_qs;
|
||||
inline const QString C_LOCALE_CHINESE_TRADITIONAL_HK = u"香港正體字"_qs;
|
||||
inline const QString C_LOCALE_CHINESE_TRADITIONAL_TW = u"正體中文"_qs;
|
||||
inline const QString C_LOCALE_CROATIAN = u"Hrvatski"_qs;
|
||||
inline const QString C_LOCALE_CZECH = u"Čeština"_qs;
|
||||
inline const QString C_LOCALE_DANISH = u"Dansk"_qs;
|
||||
inline const QString C_LOCALE_DUTCH = u"Nederlands"_qs;
|
||||
inline const QString C_LOCALE_ENGLISH = u"English"_qs;
|
||||
inline const QString C_LOCALE_ENGLISH_AUSTRALIA = u"English (Australia)"_qs;
|
||||
inline const QString C_LOCALE_ENGLISH_UNITEDKINGDOM = u"English (United Kingdom)"_qs;
|
||||
inline const QString C_LOCALE_ESPERANTO = u"Esperanto"_qs;
|
||||
inline const QString C_LOCALE_ESTONIAN = u"Eesti, eesti keel"_qs;
|
||||
inline const QString C_LOCALE_FINNISH = u"Suomi"_qs;
|
||||
inline const QString C_LOCALE_FRENCH = u"Français"_qs;
|
||||
inline const QString C_LOCALE_GALICIAN = u"Galego"_qs;
|
||||
inline const QString C_LOCALE_GEORGIAN = u"ქართული"_qs;
|
||||
inline const QString C_LOCALE_GERMAN = u"Deutsch"_qs;
|
||||
inline const QString C_LOCALE_GREEK = u"Ελληνικά"_qs;
|
||||
inline const QString C_LOCALE_HEBREW = u"עברית"_qs;
|
||||
inline const QString C_LOCALE_HINDI = u"हिन्दी, हिंदी"_qs;
|
||||
inline const QString C_LOCALE_HUNGARIAN = u"Magyar"_qs;
|
||||
inline const QString C_LOCALE_ICELANDIC = u"Íslenska"_qs;
|
||||
inline const QString C_LOCALE_INDONESIAN = u"Bahasa Indonesia"_qs;
|
||||
inline const QString C_LOCALE_ITALIAN = u"Italiano"_qs;
|
||||
inline const QString C_LOCALE_JAPANESE = u"日本語"_qs;
|
||||
inline const QString C_LOCALE_KOREAN = u"한국어"_qs;
|
||||
inline const QString C_LOCALE_LATGALIAN = u"Latgalīšu volūda"_qs;
|
||||
inline const QString C_LOCALE_LATVIAN = u"Latviešu valoda"_qs;
|
||||
inline const QString C_LOCALE_LITHUANIAN = u"Lietuvių"_qs;
|
||||
inline const QString C_LOCALE_MALAY = u"بهاس ملايو"_qs;
|
||||
inline const QString C_LOCALE_MONGOLIAN = u"Монгол хэл"_qs;
|
||||
inline const QString C_LOCALE_NORWEGIAN = u"Norsk"_qs;
|
||||
inline const QString C_LOCALE_OCCITAN = u"lenga d'òc"_qs;
|
||||
inline const QString C_LOCALE_PERSIAN = u"فارسی"_qs;
|
||||
inline const QString C_LOCALE_POLISH = u"Polski"_qs;
|
||||
inline const QString C_LOCALE_PORTUGUESE = u"Português"_qs;
|
||||
inline const QString C_LOCALE_PORTUGUESE_BRAZIL = u"Português brasileiro"_qs;
|
||||
inline const QString C_LOCALE_ROMANIAN = u"Română"_qs;
|
||||
inline const QString C_LOCALE_RUSSIAN = u"Русский"_qs;
|
||||
inline const QString C_LOCALE_SERBIAN = u"Српски"_qs;
|
||||
inline const QString C_LOCALE_SLOVAK = u"Slovenčina"_qs;
|
||||
inline const QString C_LOCALE_SLOVENIAN = u"Slovenščina"_qs;
|
||||
inline const QString C_LOCALE_SPANISH = u"Español"_qs;
|
||||
inline const QString C_LOCALE_SWEDISH = u"Svenska"_qs;
|
||||
inline const QString C_LOCALE_THAI = u"ไทย"_qs;
|
||||
inline const QString C_LOCALE_TURKISH = u"Türkçe"_qs;
|
||||
inline const QString C_LOCALE_UKRAINIAN = u"Українська"_qs;
|
||||
inline const QString C_LOCALE_UZBEK = u"أۇزبېك"_qs;
|
||||
inline const QString C_LOCALE_VIETNAMESE = u"Tiếng Việt"_qs;
|
||||
inline const QString C_LOCALE_ARABIC = u"عربي"_s;
|
||||
inline const QString C_LOCALE_ARMENIAN = u"Հայերեն"_s;
|
||||
inline const QString C_LOCALE_AZERBAIJANI = u"Azərbaycan dili"_s;
|
||||
inline const QString C_LOCALE_BASQUE = u"Euskara"_s;
|
||||
inline const QString C_LOCALE_BULGARIAN = u"Български"_s;
|
||||
inline const QString C_LOCALE_BYELORUSSIAN = u"Беларуская"_s;
|
||||
inline const QString C_LOCALE_CATALAN = u"Català"_s;
|
||||
inline const QString C_LOCALE_CHINESE_SIMPLIFIED = u"简体中文"_s;
|
||||
inline const QString C_LOCALE_CHINESE_TRADITIONAL_HK = u"香港正體字"_s;
|
||||
inline const QString C_LOCALE_CHINESE_TRADITIONAL_TW = u"正體中文"_s;
|
||||
inline const QString C_LOCALE_CROATIAN = u"Hrvatski"_s;
|
||||
inline const QString C_LOCALE_CZECH = u"Čeština"_s;
|
||||
inline const QString C_LOCALE_DANISH = u"Dansk"_s;
|
||||
inline const QString C_LOCALE_DUTCH = u"Nederlands"_s;
|
||||
inline const QString C_LOCALE_ENGLISH = u"English"_s;
|
||||
inline const QString C_LOCALE_ENGLISH_AUSTRALIA = u"English (Australia)"_s;
|
||||
inline const QString C_LOCALE_ENGLISH_UNITEDKINGDOM = u"English (United Kingdom)"_s;
|
||||
inline const QString C_LOCALE_ESPERANTO = u"Esperanto"_s;
|
||||
inline const QString C_LOCALE_ESTONIAN = u"Eesti, eesti keel"_s;
|
||||
inline const QString C_LOCALE_FINNISH = u"Suomi"_s;
|
||||
inline const QString C_LOCALE_FRENCH = u"Français"_s;
|
||||
inline const QString C_LOCALE_GALICIAN = u"Galego"_s;
|
||||
inline const QString C_LOCALE_GEORGIAN = u"ქართული"_s;
|
||||
inline const QString C_LOCALE_GERMAN = u"Deutsch"_s;
|
||||
inline const QString C_LOCALE_GREEK = u"Ελληνικά"_s;
|
||||
inline const QString C_LOCALE_HEBREW = u"עברית"_s;
|
||||
inline const QString C_LOCALE_HINDI = u"हिन्दी, हिंदी"_s;
|
||||
inline const QString C_LOCALE_HUNGARIAN = u"Magyar"_s;
|
||||
inline const QString C_LOCALE_ICELANDIC = u"Íslenska"_s;
|
||||
inline const QString C_LOCALE_INDONESIAN = u"Bahasa Indonesia"_s;
|
||||
inline const QString C_LOCALE_ITALIAN = u"Italiano"_s;
|
||||
inline const QString C_LOCALE_JAPANESE = u"日本語"_s;
|
||||
inline const QString C_LOCALE_KOREAN = u"한국어"_s;
|
||||
inline const QString C_LOCALE_LATGALIAN = u"Latgalīšu volūda"_s;
|
||||
inline const QString C_LOCALE_LATVIAN = u"Latviešu valoda"_s;
|
||||
inline const QString C_LOCALE_LITHUANIAN = u"Lietuvių"_s;
|
||||
inline const QString C_LOCALE_MALAY = u"بهاس ملايو"_s;
|
||||
inline const QString C_LOCALE_MONGOLIAN = u"Монгол хэл"_s;
|
||||
inline const QString C_LOCALE_NORWEGIAN = u"Norsk"_s;
|
||||
inline const QString C_LOCALE_OCCITAN = u"lenga d'òc"_s;
|
||||
inline const QString C_LOCALE_PERSIAN = u"فارسی"_s;
|
||||
inline const QString C_LOCALE_POLISH = u"Polski"_s;
|
||||
inline const QString C_LOCALE_PORTUGUESE = u"Português"_s;
|
||||
inline const QString C_LOCALE_PORTUGUESE_BRAZIL = u"Português brasileiro"_s;
|
||||
inline const QString C_LOCALE_ROMANIAN = u"Română"_s;
|
||||
inline const QString C_LOCALE_RUSSIAN = u"Русский"_s;
|
||||
inline const QString C_LOCALE_SERBIAN = u"Српски"_s;
|
||||
inline const QString C_LOCALE_SLOVAK = u"Slovenčina"_s;
|
||||
inline const QString C_LOCALE_SLOVENIAN = u"Slovenščina"_s;
|
||||
inline const QString C_LOCALE_SPANISH = u"Español"_s;
|
||||
inline const QString C_LOCALE_SWEDISH = u"Svenska"_s;
|
||||
inline const QString C_LOCALE_THAI = u"ไทย"_s;
|
||||
inline const QString C_LOCALE_TURKISH = u"Türkçe"_s;
|
||||
inline const QString C_LOCALE_UKRAINIAN = u"Українська"_s;
|
||||
inline const QString C_LOCALE_UZBEK = u"أۇزبېك"_s;
|
||||
inline const QString C_LOCALE_VIETNAMESE = u"Tiếng Việt"_s;
|
||||
|
@ -53,7 +53,7 @@ namespace
|
||||
bool testPythonInstallation(const QString &exeName, PythonInfo &info)
|
||||
{
|
||||
QProcess proc;
|
||||
proc.start(exeName, {u"--version"_qs}, QIODevice::ReadOnly);
|
||||
proc.start(exeName, {u"--version"_s}, QIODevice::ReadOnly);
|
||||
if (proc.waitForFinished() && (proc.exitCode() == QProcess::NormalExit))
|
||||
{
|
||||
QByteArray procOutput = proc.readAllStandardOutput();
|
||||
@ -71,7 +71,7 @@ namespace
|
||||
// User reports: `python --version` -> "Python 3.6.6+"
|
||||
// So trim off unrelated characters
|
||||
const auto versionStr = QString::fromLocal8Bit(outputSplit[1]);
|
||||
const int idx = versionStr.indexOf(QRegularExpression(u"[^\\.\\d]"_qs));
|
||||
const int idx = versionStr.indexOf(QRegularExpression(u"[^\\.\\d]"_s));
|
||||
const auto version = PythonInfo::Version::fromString(versionStr.left(idx));
|
||||
if (!version.isValid())
|
||||
return false;
|
||||
@ -186,15 +186,15 @@ namespace
|
||||
{
|
||||
const QDir baseDir {path};
|
||||
|
||||
if (baseDir.exists(u"python3.exe"_qs))
|
||||
if (baseDir.exists(u"python3.exe"_s))
|
||||
{
|
||||
found = true;
|
||||
path = baseDir.filePath(u"python3.exe"_qs);
|
||||
path = baseDir.filePath(u"python3.exe"_s);
|
||||
}
|
||||
else if (baseDir.exists(u"python.exe"_qs))
|
||||
else if (baseDir.exists(u"python.exe"_s))
|
||||
{
|
||||
found = true;
|
||||
path = baseDir.filePath(u"python.exe"_qs);
|
||||
path = baseDir.filePath(u"python.exe"_s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -224,7 +224,7 @@ namespace
|
||||
return path;
|
||||
|
||||
// Fallback: Detect python from default locations
|
||||
const QFileInfoList dirs = QDir(u"C:/"_qs).entryInfoList({u"Python*"_qs}, QDir::Dirs, (QDir::Name | QDir::Reversed));
|
||||
const QFileInfoList dirs = QDir(u"C:/"_s).entryInfoList({u"Python*"_s}, QDir::Dirs, (QDir::Name | QDir::Reversed));
|
||||
for (const QFileInfo &info : dirs)
|
||||
{
|
||||
const QString py3Path {info.absolutePath() + u"/python3.exe"};
|
||||
@ -256,10 +256,10 @@ PythonInfo Utils::ForeignApps::pythonInfo()
|
||||
static PythonInfo pyInfo;
|
||||
if (!pyInfo.isValid())
|
||||
{
|
||||
if (testPythonInstallation(u"python3"_qs, pyInfo))
|
||||
if (testPythonInstallation(u"python3"_s, pyInfo))
|
||||
return pyInfo;
|
||||
|
||||
if (testPythonInstallation(u"python"_qs, pyInfo))
|
||||
if (testPythonInstallation(u"python"_s, pyInfo))
|
||||
return pyInfo;
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
namespace Utils::ForeignApps
|
||||
{
|
||||
inline const QString PYTHON_ISOLATE_MODE_FLAG = u"-I"_qs;
|
||||
inline const QString PYTHON_ISOLATE_MODE_FLAG = u"-I"_s;
|
||||
|
||||
struct PythonInfo
|
||||
{
|
||||
|
@ -81,12 +81,12 @@ bool Utils::Fs::smartRemoveEmptyFolderTree(const Path &path)
|
||||
const QStringList deleteFilesList =
|
||||
{
|
||||
// Windows
|
||||
u"Thumbs.db"_qs,
|
||||
u"desktop.ini"_qs,
|
||||
u"Thumbs.db"_s,
|
||||
u"desktop.ini"_s,
|
||||
// Linux
|
||||
u".directory"_qs,
|
||||
u".directory"_s,
|
||||
// Mac OS
|
||||
u".DS_Store"_qs
|
||||
u".DS_Store"_s
|
||||
};
|
||||
|
||||
// travel from the deepest folder and remove anything unwanted on the way out.
|
||||
@ -191,7 +191,7 @@ bool Utils::Fs::sameFiles(const Path &path1, const Path &path2)
|
||||
|
||||
QString Utils::Fs::toValidFileName(const QString &name, const QString &pad)
|
||||
{
|
||||
const QRegularExpression regex {u"[\\\\/:?\"*<>|]+"_qs};
|
||||
const QRegularExpression regex {u"[\\\\/:?\"*<>|]+"_s};
|
||||
|
||||
QString validName = name.trimmed();
|
||||
validName.replace(regex, pad);
|
||||
@ -201,7 +201,7 @@ QString Utils::Fs::toValidFileName(const QString &name, const QString &pad)
|
||||
|
||||
Path Utils::Fs::toValidPath(const QString &name, const QString &pad)
|
||||
{
|
||||
const QRegularExpression regex {u"[:?\"*<>|]+"_qs};
|
||||
const QRegularExpression regex {u"[:?\"*<>|]+"_s};
|
||||
|
||||
QString validPathStr = name;
|
||||
validPathStr.replace(regex, pad);
|
||||
@ -216,7 +216,7 @@ qint64 Utils::Fs::freeDiskSpaceOnPath(const Path &path)
|
||||
|
||||
Path Utils::Fs::tempPath()
|
||||
{
|
||||
static const Path path = Path(QDir::tempPath()) / Path(u".qBittorrent"_qs);
|
||||
static const Path path = Path(QDir::tempPath()) / Path(u".qBittorrent"_s);
|
||||
mkdir(path);
|
||||
return path;
|
||||
}
|
||||
|
@ -53,8 +53,8 @@ namespace Utils::Fs
|
||||
QDateTime lastModified(const Path &path);
|
||||
bool sameFiles(const Path &path1, const Path &path2);
|
||||
|
||||
QString toValidFileName(const QString &name, const QString &pad = u" "_qs);
|
||||
Path toValidPath(const QString &name, const QString &pad = u" "_qs);
|
||||
QString toValidFileName(const QString &name, const QString &pad = u" "_s);
|
||||
Path toValidPath(const QString &name, const QString &pad = u" "_s);
|
||||
Path toCanonicalPath(const Path &path);
|
||||
|
||||
bool copyFile(const Path &from, const Path &to);
|
||||
|
@ -193,59 +193,59 @@ void Utils::Misc::shutdownComputer(const ShutdownDialogAction &action)
|
||||
if (action != ShutdownDialogAction::Shutdown)
|
||||
{
|
||||
// Some recent systems use systemd's logind
|
||||
QDBusInterface login1Iface(u"org.freedesktop.login1"_qs, u"/org/freedesktop/login1"_qs,
|
||||
u"org.freedesktop.login1.Manager"_qs, QDBusConnection::systemBus());
|
||||
QDBusInterface login1Iface(u"org.freedesktop.login1"_s, u"/org/freedesktop/login1"_s,
|
||||
u"org.freedesktop.login1.Manager"_s, QDBusConnection::systemBus());
|
||||
if (login1Iface.isValid())
|
||||
{
|
||||
if (action == ShutdownDialogAction::Suspend)
|
||||
login1Iface.call(u"Suspend"_qs, false);
|
||||
login1Iface.call(u"Suspend"_s, false);
|
||||
else
|
||||
login1Iface.call(u"Hibernate"_qs, false);
|
||||
login1Iface.call(u"Hibernate"_s, false);
|
||||
return;
|
||||
}
|
||||
// Else, other recent systems use UPower
|
||||
QDBusInterface upowerIface(u"org.freedesktop.UPower"_qs, u"/org/freedesktop/UPower"_qs,
|
||||
u"org.freedesktop.UPower"_qs, QDBusConnection::systemBus());
|
||||
QDBusInterface upowerIface(u"org.freedesktop.UPower"_s, u"/org/freedesktop/UPower"_s,
|
||||
u"org.freedesktop.UPower"_s, QDBusConnection::systemBus());
|
||||
if (upowerIface.isValid())
|
||||
{
|
||||
if (action == ShutdownDialogAction::Suspend)
|
||||
upowerIface.call(u"Suspend"_qs);
|
||||
upowerIface.call(u"Suspend"_s);
|
||||
else
|
||||
upowerIface.call(u"Hibernate"_qs);
|
||||
upowerIface.call(u"Hibernate"_s);
|
||||
return;
|
||||
}
|
||||
// HAL (older systems)
|
||||
QDBusInterface halIface(u"org.freedesktop.Hal"_qs, u"/org/freedesktop/Hal/devices/computer"_qs,
|
||||
u"org.freedesktop.Hal.Device.SystemPowerManagement"_qs,
|
||||
QDBusInterface halIface(u"org.freedesktop.Hal"_s, u"/org/freedesktop/Hal/devices/computer"_s,
|
||||
u"org.freedesktop.Hal.Device.SystemPowerManagement"_s,
|
||||
QDBusConnection::systemBus());
|
||||
if (action == ShutdownDialogAction::Suspend)
|
||||
halIface.call(u"Suspend"_qs, 5);
|
||||
halIface.call(u"Suspend"_s, 5);
|
||||
else
|
||||
halIface.call(u"Hibernate"_qs);
|
||||
halIface.call(u"Hibernate"_s);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Some recent systems use systemd's logind
|
||||
QDBusInterface login1Iface(u"org.freedesktop.login1"_qs, u"/org/freedesktop/login1"_qs,
|
||||
u"org.freedesktop.login1.Manager"_qs, QDBusConnection::systemBus());
|
||||
QDBusInterface login1Iface(u"org.freedesktop.login1"_s, u"/org/freedesktop/login1"_s,
|
||||
u"org.freedesktop.login1.Manager"_s, QDBusConnection::systemBus());
|
||||
if (login1Iface.isValid())
|
||||
{
|
||||
login1Iface.call(u"PowerOff"_qs, false);
|
||||
login1Iface.call(u"PowerOff"_s, false);
|
||||
return;
|
||||
}
|
||||
// Else, other recent systems use ConsoleKit
|
||||
QDBusInterface consolekitIface(u"org.freedesktop.ConsoleKit"_qs, u"/org/freedesktop/ConsoleKit/Manager"_qs,
|
||||
u"org.freedesktop.ConsoleKit.Manager"_qs, QDBusConnection::systemBus());
|
||||
QDBusInterface consolekitIface(u"org.freedesktop.ConsoleKit"_s, u"/org/freedesktop/ConsoleKit/Manager"_s,
|
||||
u"org.freedesktop.ConsoleKit.Manager"_s, QDBusConnection::systemBus());
|
||||
if (consolekitIface.isValid())
|
||||
{
|
||||
consolekitIface.call(u"Stop"_qs);
|
||||
consolekitIface.call(u"Stop"_s);
|
||||
return;
|
||||
}
|
||||
// HAL (older systems)
|
||||
QDBusInterface halIface(u"org.freedesktop.Hal"_qs, u"/org/freedesktop/Hal/devices/computer"_qs,
|
||||
u"org.freedesktop.Hal.Device.SystemPowerManagement"_qs,
|
||||
QDBusInterface halIface(u"org.freedesktop.Hal"_s, u"/org/freedesktop/Hal/devices/computer"_s,
|
||||
u"org.freedesktop.Hal.Device.SystemPowerManagement"_s,
|
||||
QDBusConnection::systemBus());
|
||||
halIface.call(u"Shutdown"_qs);
|
||||
halIface.call(u"Shutdown"_s);
|
||||
}
|
||||
|
||||
#else
|
||||
@ -308,48 +308,48 @@ bool Utils::Misc::isPreviewable(const Path &filePath)
|
||||
|
||||
const QSet<QString> multimediaExtensions =
|
||||
{
|
||||
u".3GP"_qs,
|
||||
u".AAC"_qs,
|
||||
u".AC3"_qs,
|
||||
u".AIF"_qs,
|
||||
u".AIFC"_qs,
|
||||
u".AIFF"_qs,
|
||||
u".ASF"_qs,
|
||||
u".AU"_qs,
|
||||
u".AVI"_qs,
|
||||
u".FLAC"_qs,
|
||||
u".FLV"_qs,
|
||||
u".M3U"_qs,
|
||||
u".M4A"_qs,
|
||||
u".M4P"_qs,
|
||||
u".M4V"_qs,
|
||||
u".MID"_qs,
|
||||
u".MKV"_qs,
|
||||
u".MOV"_qs,
|
||||
u".MP2"_qs,
|
||||
u".MP3"_qs,
|
||||
u".MP4"_qs,
|
||||
u".MPC"_qs,
|
||||
u".MPE"_qs,
|
||||
u".MPEG"_qs,
|
||||
u".MPG"_qs,
|
||||
u".MPP"_qs,
|
||||
u".OGG"_qs,
|
||||
u".OGM"_qs,
|
||||
u".OGV"_qs,
|
||||
u".QT"_qs,
|
||||
u".RA"_qs,
|
||||
u".RAM"_qs,
|
||||
u".RM"_qs,
|
||||
u".RMV"_qs,
|
||||
u".RMVB"_qs,
|
||||
u".SWA"_qs,
|
||||
u".SWF"_qs,
|
||||
u".TS"_qs,
|
||||
u".VOB"_qs,
|
||||
u".WAV"_qs,
|
||||
u".WMA"_qs,
|
||||
u".WMV"_qs
|
||||
u".3GP"_s,
|
||||
u".AAC"_s,
|
||||
u".AC3"_s,
|
||||
u".AIF"_s,
|
||||
u".AIFC"_s,
|
||||
u".AIFF"_s,
|
||||
u".ASF"_s,
|
||||
u".AU"_s,
|
||||
u".AVI"_s,
|
||||
u".FLAC"_s,
|
||||
u".FLV"_s,
|
||||
u".M3U"_s,
|
||||
u".M4A"_s,
|
||||
u".M4P"_s,
|
||||
u".M4V"_s,
|
||||
u".MID"_s,
|
||||
u".MKV"_s,
|
||||
u".MOV"_s,
|
||||
u".MP2"_s,
|
||||
u".MP3"_s,
|
||||
u".MP4"_s,
|
||||
u".MPC"_s,
|
||||
u".MPE"_s,
|
||||
u".MPEG"_s,
|
||||
u".MPG"_s,
|
||||
u".MPP"_s,
|
||||
u".OGG"_s,
|
||||
u".OGM"_s,
|
||||
u".OGV"_s,
|
||||
u".QT"_s,
|
||||
u".RA"_s,
|
||||
u".RAM"_s,
|
||||
u".RM"_s,
|
||||
u".RMV"_s,
|
||||
u".RMVB"_s,
|
||||
u".SWA"_s,
|
||||
u".SWF"_s,
|
||||
u".TS"_s,
|
||||
u".VOB"_s,
|
||||
u".WAV"_s,
|
||||
u".WMA"_s,
|
||||
u".WMV"_s
|
||||
};
|
||||
return multimediaExtensions.contains(filePath.extension().toUpper());
|
||||
}
|
||||
@ -362,7 +362,7 @@ QString Utils::Misc::userFriendlyDuration(const qlonglong seconds, const qlonglo
|
||||
return C_INFINITY;
|
||||
|
||||
if (seconds == 0)
|
||||
return u"0"_qs;
|
||||
return u"0"_s;
|
||||
|
||||
if (seconds < 60)
|
||||
return QCoreApplication::translate("misc", "< 1m", "< 1 minute");
|
||||
@ -392,7 +392,7 @@ QString Utils::Misc::userFriendlyDuration(const qlonglong seconds, const qlonglo
|
||||
|
||||
QString Utils::Misc::getUserIDString()
|
||||
{
|
||||
QString uid = u"0"_qs;
|
||||
QString uid = u"0"_s;
|
||||
#ifdef Q_OS_WIN
|
||||
const int UNLEN = 256;
|
||||
WCHAR buffer[UNLEN + 1] = {0};
|
||||
@ -540,15 +540,15 @@ QString Utils::Misc::parseHtmlLinks(const QString &rawText)
|
||||
u"[a-zA-Z]{2,}" // one ab (2 char or longer) --> us
|
||||
u"([a-zA-Z0-9\\?%=&/_\\.:#;-]*)" // everything to 1st non-URI char, maybe nothing in case of del.icio.us/path
|
||||
u")"
|
||||
u")"_qs
|
||||
u")"_s
|
||||
);
|
||||
|
||||
// Capture links
|
||||
result.replace(reURL, u"\\1<a href=\"\\2\">\\2</a>"_qs);
|
||||
result.replace(reURL, u"\\1<a href=\"\\2\">\\2</a>"_s);
|
||||
|
||||
// Capture links without scheme
|
||||
const QRegularExpression reNoScheme(u"<a\\s+href=\"(?!https?)([a-zA-Z0-9\\?%=&/_\\.-:#]+)\\s*\">"_qs);
|
||||
result.replace(reNoScheme, u"<a href=\"http://\\1\">"_qs);
|
||||
const QRegularExpression reNoScheme(u"<a\\s+href=\"(?!https?)([a-zA-Z0-9\\?%=&/_\\.-:#]+)\\s*\">"_s);
|
||||
result.replace(reNoScheme, u"<a href=\"http://\\1\">"_s);
|
||||
|
||||
// to preserve plain text formatting
|
||||
result = u"<p style=\"white-space: pre-wrap;\">" + result + u"</p>";
|
||||
@ -559,7 +559,7 @@ QString Utils::Misc::osName()
|
||||
{
|
||||
// static initialization for usage in signal handler
|
||||
static const QString name =
|
||||
u"%1 %2 %3"_qs
|
||||
u"%1 %2 %3"_s
|
||||
.arg(QSysInfo::prettyProductName()
|
||||
, QSysInfo::kernelVersion()
|
||||
, QSysInfo::currentCpuArchitecture());
|
||||
@ -569,7 +569,7 @@ QString Utils::Misc::osName()
|
||||
QString Utils::Misc::boostVersionString()
|
||||
{
|
||||
// static initialization for usage in signal handler
|
||||
static const QString ver = u"%1.%2.%3"_qs
|
||||
static const QString ver = u"%1.%2.%3"_s
|
||||
.arg(QString::number(BOOST_VERSION / 100000)
|
||||
, QString::number((BOOST_VERSION / 100) % 1000)
|
||||
, QString::number(BOOST_VERSION % 100));
|
||||
|
@ -60,7 +60,7 @@ namespace Utils
|
||||
{
|
||||
return (addr == QHostAddress::LocalHost)
|
||||
|| (addr == QHostAddress::LocalHostIPv6)
|
||||
|| (addr == QHostAddress(u"::ffff:127.0.0.1"_qs));
|
||||
|| (addr == QHostAddress(u"::ffff:127.0.0.1"_s));
|
||||
}
|
||||
|
||||
bool isIPInSubnets(const QHostAddress &addr, const QVector<Subnet> &subnets)
|
||||
|
@ -56,7 +56,7 @@ namespace
|
||||
using result_type = uint32_t;
|
||||
|
||||
RandomLayer()
|
||||
: m_rtlGenRandom {Utils::Misc::loadWinAPI<PRTLGENRANDOM>(u"Advapi32.dll"_qs, "SystemFunction036")}
|
||||
: m_rtlGenRandom {Utils::Misc::loadWinAPI<PRTLGENRANDOM>(u"Advapi32.dll"_s, "SystemFunction036")}
|
||||
{
|
||||
if (!m_rtlGenRandom)
|
||||
qFatal("Failed to load RtlGenRandom()");
|
||||
|
@ -44,7 +44,7 @@ namespace Utils::String
|
||||
QString wildcardToRegexPattern(const QString &pattern);
|
||||
|
||||
template <typename T>
|
||||
T unquote(const T &str, const QString "es = u"\""_qs)
|
||||
T unquote(const T &str, const QString "es = u"\""_s)
|
||||
{
|
||||
if (str.length() < 2) return str;
|
||||
|
||||
|
@ -43,14 +43,14 @@
|
||||
AboutDialog::AboutDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::AboutDialog)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
// Title
|
||||
m_ui->labelName->setText(QStringLiteral("<b><h2>qBittorrent " QBT_VERSION " (%1-bit)</h2></b>").arg(QT_POINTER_SIZE * 8));
|
||||
|
||||
m_ui->logo->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"qbittorrent-tray"_qs, 32));
|
||||
m_ui->logo->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"qbittorrent-tray"_s, 32));
|
||||
|
||||
// About
|
||||
const QString aboutText =
|
||||
@ -62,33 +62,33 @@ AboutDialog::AboutDialog(QWidget *parent)
|
||||
u"<tr><td>%4</td><td><a href=\"https://forum.qbittorrent.org\">https://forum.qbittorrent.org</a></td></tr>"
|
||||
u"<tr><td>%5</td><td><a href=\"https://bugs.qbittorrent.org\">https://bugs.qbittorrent.org</a></td></tr>"
|
||||
u"</table>"
|
||||
u"</p>"_qs
|
||||
u"</p>"_s
|
||||
.arg(tr("An advanced BitTorrent client programmed in C++, based on Qt toolkit and libtorrent-rasterbar.")
|
||||
.replace(u"C++"_qs, u"C\u2060+\u2060+"_qs) // make C++ non-breaking
|
||||
.replace(u"C++"_s, u"C\u2060+\u2060+"_s) // make C++ non-breaking
|
||||
, tr("Copyright %1 2006-2022 The qBittorrent project").arg(C_COPYRIGHT)
|
||||
, tr("Home Page:")
|
||||
, tr("Forum:")
|
||||
, tr("Bug Tracker:"));
|
||||
m_ui->labelAbout->setText(aboutText);
|
||||
|
||||
m_ui->labelMascot->setPixmap(Utils::Gui::scaledPixmap(Path(u":/icons/mascot.png"_qs), this));
|
||||
m_ui->labelMascot->setPixmap(Utils::Gui::scaledPixmap(Path(u":/icons/mascot.png"_s), this));
|
||||
|
||||
// Thanks
|
||||
if (const auto readResult = Utils::IO::readFile(Path(u":/thanks.html"_qs), -1, QIODevice::Text)
|
||||
if (const auto readResult = Utils::IO::readFile(Path(u":/thanks.html"_s), -1, QIODevice::Text)
|
||||
; readResult)
|
||||
{
|
||||
m_ui->textBrowserThanks->setHtml(QString::fromUtf8(readResult.value()));
|
||||
}
|
||||
|
||||
// Translation
|
||||
if (const auto readResult = Utils::IO::readFile(Path(u":/translators.html"_qs), -1, QIODevice::Text)
|
||||
if (const auto readResult = Utils::IO::readFile(Path(u":/translators.html"_s), -1, QIODevice::Text)
|
||||
; readResult)
|
||||
{
|
||||
m_ui->textBrowserTranslation->setHtml(QString::fromUtf8(readResult.value()));
|
||||
}
|
||||
|
||||
// License
|
||||
if (const auto readResult = Utils::IO::readFile(Path(u":/gpl.html"_qs), -1, QIODevice::Text)
|
||||
if (const auto readResult = Utils::IO::readFile(Path(u":/gpl.html"_s), -1, QIODevice::Text)
|
||||
; readResult)
|
||||
{
|
||||
m_ui->textBrowserLicense->setHtml(QString::fromUtf8(readResult.value()));
|
||||
@ -103,7 +103,7 @@ AboutDialog::AboutDialog(QWidget *parent)
|
||||
|
||||
const QString DBIPText = u"<html><head/><body><p>"
|
||||
u"%1 (<a href=\"https://db-ip.com/\">https://db-ip.com/</a>)"
|
||||
u"</p></body></html>"_qs
|
||||
u"</p></body></html>"_s
|
||||
.arg(tr("The free IP to Country Lite database by DB-IP is used for resolving the countries of peers. "
|
||||
"The database is licensed under the Creative Commons Attribution 4.0 International License"));
|
||||
m_ui->labelDBIP->setText(DBIPText);
|
||||
|
@ -67,11 +67,11 @@
|
||||
namespace
|
||||
{
|
||||
#define SETTINGS_KEY(name) u"AddNewTorrentDialog/" name
|
||||
const QString KEY_ENABLED = SETTINGS_KEY(u"Enabled"_qs);
|
||||
const QString KEY_TOPLEVEL = SETTINGS_KEY(u"TopLevel"_qs);
|
||||
const QString KEY_SAVEPATHHISTORY = SETTINGS_KEY(u"SavePathHistory"_qs);
|
||||
const QString KEY_DOWNLOADPATHHISTORY = SETTINGS_KEY(u"DownloadPathHistory"_qs);
|
||||
const QString KEY_SAVEPATHHISTORYLENGTH = SETTINGS_KEY(u"SavePathHistoryLength"_qs);
|
||||
const QString KEY_ENABLED = SETTINGS_KEY(u"Enabled"_s);
|
||||
const QString KEY_TOPLEVEL = SETTINGS_KEY(u"TopLevel"_s);
|
||||
const QString KEY_SAVEPATHHISTORY = SETTINGS_KEY(u"SavePathHistory"_s);
|
||||
const QString KEY_DOWNLOADPATHHISTORY = SETTINGS_KEY(u"DownloadPathHistory"_s);
|
||||
const QString KEY_SAVEPATHHISTORYLENGTH = SETTINGS_KEY(u"SavePathHistoryLength"_s);
|
||||
|
||||
// just a shortcut
|
||||
inline SettingsStorage *settings()
|
||||
@ -286,15 +286,15 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
|
||||
, m_ui(new Ui::AddNewTorrentDialog)
|
||||
, m_filterLine(new LineEdit(this))
|
||||
, m_torrentParams(inParams)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"DialogSize"_qs))
|
||||
, m_storeDefaultCategory(SETTINGS_KEY(u"DefaultCategory"_qs))
|
||||
, m_storeRememberLastSavePath(SETTINGS_KEY(u"RememberLastSavePath"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"DialogSize"_s))
|
||||
, m_storeDefaultCategory(SETTINGS_KEY(u"DefaultCategory"_s))
|
||||
, m_storeRememberLastSavePath(SETTINGS_KEY(u"RememberLastSavePath"_s))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
, m_storeTreeHeaderState(u"GUI/Qt6/" SETTINGS_KEY(u"TreeHeaderState"_qs))
|
||||
, m_storeSplitterState(u"GUI/Qt6/" SETTINGS_KEY(u"SplitterState"_qs))
|
||||
, m_storeTreeHeaderState(u"GUI/Qt6/" SETTINGS_KEY(u"TreeHeaderState"_s))
|
||||
, m_storeSplitterState(u"GUI/Qt6/" SETTINGS_KEY(u"SplitterState"_s))
|
||||
#else
|
||||
, m_storeTreeHeaderState(SETTINGS_KEY(u"TreeHeaderState"_qs))
|
||||
, m_storeSplitterState(SETTINGS_KEY(u"SplitterState"_qs))
|
||||
, m_storeTreeHeaderState(SETTINGS_KEY(u"TreeHeaderState"_s))
|
||||
, m_storeSplitterState(SETTINGS_KEY(u"SplitterState"_s))
|
||||
#endif
|
||||
{
|
||||
// TODO: set dialog file properties using m_torrentParams.filePriorities
|
||||
@ -365,7 +365,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
|
||||
m_ui->categoryComboBox->addItem(m_torrentParams.category);
|
||||
if (!defaultCategory.isEmpty())
|
||||
m_ui->categoryComboBox->addItem(defaultCategory);
|
||||
m_ui->categoryComboBox->addItem(u""_qs);
|
||||
m_ui->categoryComboBox->addItem(u""_s);
|
||||
|
||||
for (const QString &category : asConst(categories))
|
||||
{
|
||||
@ -373,7 +373,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
|
||||
m_ui->categoryComboBox->addItem(category);
|
||||
}
|
||||
|
||||
m_ui->tagsLineEdit->setText(m_torrentParams.tags.join(u", "_qs));
|
||||
m_ui->tagsLineEdit->setText(m_torrentParams.tags.join(u", "_s));
|
||||
connect(m_ui->tagsEditButton, &QAbstractButton::clicked, this, [this]
|
||||
{
|
||||
auto *dlg = new TorrentTagsDialog(m_torrentParams.tags, this);
|
||||
@ -381,7 +381,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
|
||||
connect(dlg, &TorrentTagsDialog::accepted, this, [this, dlg]
|
||||
{
|
||||
m_torrentParams.tags = dlg->tags();
|
||||
m_ui->tagsLineEdit->setText(m_torrentParams.tags.join(u", "_qs));
|
||||
m_ui->tagsLineEdit->setText(m_torrentParams.tags.join(u", "_s));
|
||||
});
|
||||
dlg->open();
|
||||
});
|
||||
|
@ -112,7 +112,7 @@ AddTorrentParamsWidget::AddTorrentParamsWidget(BitTorrent::AddTorrentParams addT
|
||||
connect(dlg, &TorrentTagsDialog::accepted, this, [this, dlg]
|
||||
{
|
||||
m_addTorrentParams.tags = dlg->tags();
|
||||
m_ui->tagsLineEdit->setText(m_addTorrentParams.tags.join(u", "_qs));
|
||||
m_ui->tagsLineEdit->setText(m_addTorrentParams.tags.join(u", "_s));
|
||||
});
|
||||
dlg->open();
|
||||
});
|
||||
@ -163,7 +163,7 @@ void AddTorrentParamsWidget::populate()
|
||||
std::sort(categories.begin(), categories.end(), Utils::Compare::NaturalLessThan<Qt::CaseInsensitive>());
|
||||
if (!m_addTorrentParams.category.isEmpty())
|
||||
m_ui->categoryComboBox->addItem(m_addTorrentParams.category);
|
||||
m_ui->categoryComboBox->addItem(u""_qs);
|
||||
m_ui->categoryComboBox->addItem(u""_s);
|
||||
for (const QString &category : asConst(categories))
|
||||
{
|
||||
if (category != m_addTorrentParams.category)
|
||||
@ -230,7 +230,7 @@ void AddTorrentParamsWidget::populate()
|
||||
m_addTorrentParams.stopCondition = data.value<BitTorrent::Torrent::StopCondition>();
|
||||
});
|
||||
|
||||
m_ui->tagsLineEdit->setText(m_addTorrentParams.tags.join(u", "_qs));
|
||||
m_ui->tagsLineEdit->setText(m_addTorrentParams.tags.join(u", "_s));
|
||||
|
||||
m_ui->startTorrentComboBox->disconnect(this);
|
||||
m_ui->startTorrentComboBox->setCurrentIndex(m_addTorrentParams.addPaused
|
||||
|
@ -48,7 +48,7 @@ namespace
|
||||
{
|
||||
QString makeLink(const QStringView url, const QStringView linkLabel)
|
||||
{
|
||||
return u"<a href=\"%1\">%2</a>"_qs.arg(url, linkLabel);
|
||||
return u"<a href=\"%1\">%2</a>"_s.arg(url, linkLabel);
|
||||
}
|
||||
|
||||
enum AdvSettingsCols
|
||||
@ -424,7 +424,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
, tr("Open documentation"))
|
||||
, this);
|
||||
labelQbtLink->setOpenExternalLinks(true);
|
||||
addRow(QBITTORRENT_HEADER, u"<b>%1</b>"_qs.arg(tr("qBittorrent Section")), labelQbtLink);
|
||||
addRow(QBITTORRENT_HEADER, u"<b>%1</b>"_s.arg(tr("qBittorrent Section")), labelQbtLink);
|
||||
static_cast<QLabel *>(cellWidget(QBITTORRENT_HEADER, PROPERTY))->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
|
||||
|
||||
auto *labelLibtorrentLink = new QLabel(
|
||||
@ -432,7 +432,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
, tr("Open documentation"))
|
||||
, this);
|
||||
labelLibtorrentLink->setOpenExternalLinks(true);
|
||||
addRow(LIBTORRENT_HEADER, u"<b>%1</b>"_qs.arg(tr("libtorrent Section")), labelLibtorrentLink);
|
||||
addRow(LIBTORRENT_HEADER, u"<b>%1</b>"_s.arg(tr("libtorrent Section")), labelLibtorrentLink);
|
||||
static_cast<QLabel *>(cellWidget(LIBTORRENT_HEADER, PROPERTY))->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
|
||||
|
||||
m_comboBoxResumeDataStorage.addItem(tr("Fastresume files"), QVariant::fromValue(BitTorrent::ResumeDataStorageType::Legacy));
|
||||
@ -580,7 +580,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
, &m_spinBoxSendBufferLowWatermark);
|
||||
m_spinBoxSendBufferWatermarkFactor.setMinimum(1);
|
||||
m_spinBoxSendBufferWatermarkFactor.setMaximum(std::numeric_limits<int>::max());
|
||||
m_spinBoxSendBufferWatermarkFactor.setSuffix(u" %"_qs);
|
||||
m_spinBoxSendBufferWatermarkFactor.setSuffix(u" %"_s);
|
||||
m_spinBoxSendBufferWatermarkFactor.setValue(session->sendBufferWatermarkFactor());
|
||||
addRow(SEND_BUF_WATERMARK_FACTOR, (tr("Send buffer watermark factor") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#send_buffer_watermark_factor", u"(?)"))
|
||||
, &m_spinBoxSendBufferWatermarkFactor);
|
||||
@ -818,12 +818,12 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
m_spinBoxPeerTurnover.setMinimum(0);
|
||||
m_spinBoxPeerTurnover.setMaximum(100);
|
||||
m_spinBoxPeerTurnover.setValue(session->peerTurnover());
|
||||
m_spinBoxPeerTurnover.setSuffix(u" %"_qs);
|
||||
m_spinBoxPeerTurnover.setSuffix(u" %"_s);
|
||||
addRow(PEER_TURNOVER, (tr("Peer turnover disconnect percentage") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#peer_turnover", u"(?)"))
|
||||
, &m_spinBoxPeerTurnover);
|
||||
m_spinBoxPeerTurnoverCutoff.setMinimum(0);
|
||||
m_spinBoxPeerTurnoverCutoff.setMaximum(100);
|
||||
m_spinBoxPeerTurnoverCutoff.setSuffix(u" %"_qs);
|
||||
m_spinBoxPeerTurnoverCutoff.setSuffix(u" %"_s);
|
||||
m_spinBoxPeerTurnoverCutoff.setValue(session->peerTurnoverCutoff());
|
||||
addRow(PEER_TURNOVER_CUTOFF, (tr("Peer turnover threshold percentage") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#peer_turnover", u"(?)"))
|
||||
, &m_spinBoxPeerTurnoverCutoff);
|
||||
|
@ -43,7 +43,7 @@
|
||||
BanListOptionsDialog::BanListOptionsDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::BanListOptionsDialog)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
, m_model(new QStringListModel(BitTorrent::Session::instance()->bannedIPs(), this))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
@ -43,18 +43,18 @@ CookiesDialog::CookiesDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::CookiesDialog)
|
||||
, m_cookiesModel(new CookiesModel(Net::DownloadManager::instance()->allCookies(), this))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
, m_storeViewState("GUI/Qt6/" SETTINGS_KEY(u"ViewState"_qs))
|
||||
, m_storeViewState("GUI/Qt6/" SETTINGS_KEY(u"ViewState"_s))
|
||||
#else
|
||||
, m_storeViewState(SETTINGS_KEY(u"CookiesViewState"_qs))
|
||||
, m_storeViewState(SETTINGS_KEY(u"CookiesViewState"_s))
|
||||
#endif
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
setWindowIcon(UIThemeManager::instance()->getIcon(u"browser-cookies"_qs));
|
||||
m_ui->buttonAdd->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_qs));
|
||||
m_ui->buttonDelete->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_qs));
|
||||
setWindowIcon(UIThemeManager::instance()->getIcon(u"browser-cookies"_s));
|
||||
m_ui->buttonAdd->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_s));
|
||||
m_ui->buttonDelete->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_s));
|
||||
m_ui->buttonAdd->setIconSize(Utils::Gui::mediumIconSize());
|
||||
m_ui->buttonDelete->setIconSize(Utils::Gui::mediumIconSize());
|
||||
|
||||
|
@ -48,9 +48,9 @@ DeletionConfirmationDialog::DeletionConfirmationDialog(QWidget *parent, const in
|
||||
|
||||
// Icons
|
||||
const QSize iconSize = Utils::Gui::largeIconSize();
|
||||
m_ui->labelWarning->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_qs).pixmap(iconSize));
|
||||
m_ui->labelWarning->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_s).pixmap(iconSize));
|
||||
m_ui->labelWarning->setFixedWidth(iconSize.width());
|
||||
m_ui->rememberBtn->setIcon(UIThemeManager::instance()->getIcon(u"object-locked"_qs));
|
||||
m_ui->rememberBtn->setIcon(UIThemeManager::instance()->getIcon(u"object-locked"_s));
|
||||
m_ui->rememberBtn->setIconSize(Utils::Gui::mediumIconSize());
|
||||
|
||||
m_ui->checkPermDelete->setChecked(defaultDeleteFiles || Preferences::instance()->deleteTorrentFilesAsDefault());
|
||||
|
@ -70,13 +70,13 @@ namespace
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#define SETTINGS_KEY(name) u"GUI/" name
|
||||
#define NOTIFICATIONS_SETTINGS_KEY(name) (SETTINGS_KEY(u"Notifications/"_qs) name)
|
||||
#define NOTIFICATIONS_SETTINGS_KEY(name) (SETTINGS_KEY(u"Notifications/"_s) name)
|
||||
|
||||
DesktopIntegration::DesktopIntegration(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_storeNotificationEnabled {NOTIFICATIONS_SETTINGS_KEY(u"Enabled"_qs), true}
|
||||
, m_storeNotificationEnabled {NOTIFICATIONS_SETTINGS_KEY(u"Enabled"_s), true}
|
||||
#ifdef QBT_USES_DBUS
|
||||
, m_storeNotificationTimeOut {NOTIFICATIONS_SETTINGS_KEY(u"Timeout"_qs), -1}
|
||||
, m_storeNotificationTimeOut {NOTIFICATIONS_SETTINGS_KEY(u"Timeout"_s), -1}
|
||||
#endif
|
||||
{
|
||||
#ifdef Q_OS_MACOS
|
||||
@ -290,13 +290,13 @@ QIcon DesktopIntegration::getSystrayIcon() const
|
||||
{
|
||||
default:
|
||||
case TrayIcon::Style::Normal:
|
||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray"_qs);
|
||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray"_s);
|
||||
|
||||
case TrayIcon::Style::MonoDark:
|
||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray-dark"_qs);
|
||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray-dark"_s);
|
||||
|
||||
case TrayIcon::Style::MonoLight:
|
||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_qs);
|
||||
return UIThemeManager::instance()->getIcon(u"qbittorrent-tray-light"_s);
|
||||
}
|
||||
}
|
||||
#endif // Q_OS_MACOS
|
||||
|
@ -51,17 +51,17 @@ namespace
|
||||
return (Net::DownloadManager::hasSupportedScheme(str)
|
||||
|| str.startsWith(u"magnet:", Qt::CaseInsensitive)
|
||||
#ifdef QBT_USES_LIBTORRENT2
|
||||
|| ((str.size() == 64) && !str.contains(QRegularExpression(u"[^0-9A-Fa-f]"_qs))) // v2 hex-encoded SHA-256 info-hash
|
||||
|| ((str.size() == 64) && !str.contains(QRegularExpression(u"[^0-9A-Fa-f]"_s))) // v2 hex-encoded SHA-256 info-hash
|
||||
#endif
|
||||
|| ((str.size() == 40) && !str.contains(QRegularExpression(u"[^0-9A-Fa-f]"_qs))) // v1 hex-encoded SHA-1 info-hash
|
||||
|| ((str.size() == 32) && !str.contains(QRegularExpression(u"[^2-7A-Za-z]"_qs)))); // v1 Base32 encoded SHA-1 info-hash
|
||||
|| ((str.size() == 40) && !str.contains(QRegularExpression(u"[^0-9A-Fa-f]"_s))) // v1 hex-encoded SHA-1 info-hash
|
||||
|| ((str.size() == 32) && !str.contains(QRegularExpression(u"[^2-7A-Za-z]"_s)))); // v1 Base32 encoded SHA-1 info-hash
|
||||
}
|
||||
}
|
||||
|
||||
DownloadFromURLDialog::DownloadFromURLDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::DownloadFromURLDialog)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
|
@ -69,8 +69,8 @@ ExecutionLogWidget::ExecutionLogWidget(const Log::MsgTypes types, QWidget *paren
|
||||
m_ui->tabBan->layout()->addWidget(peerView);
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
m_ui->tabConsole->setTabIcon(0, UIThemeManager::instance()->getIcon(u"help-contents"_qs, u"view-calendar-journal"_qs));
|
||||
m_ui->tabConsole->setTabIcon(1, UIThemeManager::instance()->getIcon(u"ip-blocked"_qs, u"view-filter"_qs));
|
||||
m_ui->tabConsole->setTabIcon(0, UIThemeManager::instance()->getIcon(u"help-contents"_s, u"view-calendar-journal"_s));
|
||||
m_ui->tabConsole->setTabIcon(1, UIThemeManager::instance()->getIcon(u"ip-blocked"_s, u"view-filter"_s));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -92,11 +92,11 @@ void ExecutionLogWidget::displayContextMenu(const LogListView *view, const BaseL
|
||||
// only show copy action if any of the row is selected
|
||||
if (view->currentIndex().isValid())
|
||||
{
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_s), tr("Copy")
|
||||
, view, &LogListView::copySelection);
|
||||
}
|
||||
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_qs), tr("Clear")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s), tr("Clear")
|
||||
, model, &BaseLogModel::reset);
|
||||
|
||||
menu->popup(QCursor::pos());
|
||||
|
@ -43,7 +43,7 @@
|
||||
IPSubnetWhitelistOptionsDialog::IPSubnetWhitelistOptionsDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::IPSubnetWhitelistOptionsDialog)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
LineEdit::LineEdit(QWidget *parent)
|
||||
: QLineEdit(parent)
|
||||
{
|
||||
auto *action = new QAction(UIThemeManager::instance()->getIcon(u"edit-find"_qs), QString());
|
||||
auto *action = new QAction(UIThemeManager::instance()->getIcon(u"edit-find"_s), QString());
|
||||
addAction(action, QLineEdit::LeadingPosition);
|
||||
|
||||
setClearButtonEnabled(true);
|
||||
|
@ -47,7 +47,7 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
const QString SEPARATOR = u" - "_qs;
|
||||
const QString SEPARATOR = u" - "_s;
|
||||
|
||||
int horizontalAdvance(const QFontMetrics &fontMetrics, const QString &text)
|
||||
{
|
||||
|
@ -42,32 +42,32 @@ namespace
|
||||
|
||||
QColor getTimestampColor()
|
||||
{
|
||||
return UIThemeManager::instance()->getColor(u"Log.TimeStamp"_qs);
|
||||
return UIThemeManager::instance()->getColor(u"Log.TimeStamp"_s);
|
||||
}
|
||||
|
||||
QColor getLogNormalColor()
|
||||
{
|
||||
return UIThemeManager::instance()->getColor(u"Log.Normal"_qs);
|
||||
return UIThemeManager::instance()->getColor(u"Log.Normal"_s);
|
||||
}
|
||||
|
||||
QColor getLogInfoColor()
|
||||
{
|
||||
return UIThemeManager::instance()->getColor(u"Log.Info"_qs);
|
||||
return UIThemeManager::instance()->getColor(u"Log.Info"_s);
|
||||
}
|
||||
|
||||
QColor getLogWarningColor()
|
||||
{
|
||||
return UIThemeManager::instance()->getColor(u"Log.Warning"_qs);
|
||||
return UIThemeManager::instance()->getColor(u"Log.Warning"_s);
|
||||
}
|
||||
|
||||
QColor getLogCriticalColor()
|
||||
{
|
||||
return UIThemeManager::instance()->getColor(u"Log.Critical"_qs);
|
||||
return UIThemeManager::instance()->getColor(u"Log.Critical"_s);
|
||||
}
|
||||
|
||||
QColor getPeerBannedColor()
|
||||
{
|
||||
return UIThemeManager::instance()->getColor(u"Log.BannedPeer"_qs);
|
||||
return UIThemeManager::instance()->getColor(u"Log.BannedPeer"_s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ using namespace std::chrono_literals;
|
||||
namespace
|
||||
{
|
||||
#define SETTINGS_KEY(name) u"GUI/" name
|
||||
#define EXECUTIONLOG_SETTINGS_KEY(name) (SETTINGS_KEY(u"Log/"_qs) name)
|
||||
#define EXECUTIONLOG_SETTINGS_KEY(name) (SETTINGS_KEY(u"Log/"_s) name)
|
||||
|
||||
const std::chrono::seconds PREVENT_SUSPEND_INTERVAL {60};
|
||||
|
||||
@ -128,9 +128,9 @@ namespace
|
||||
MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
|
||||
: GUIApplicationComponent(app)
|
||||
, m_ui(new Ui::MainWindow)
|
||||
, m_storeExecutionLogEnabled(EXECUTIONLOG_SETTINGS_KEY(u"Enabled"_qs))
|
||||
, m_storeDownloadTrackerFavicon(SETTINGS_KEY(u"DownloadTrackerFavicon"_qs))
|
||||
, m_storeExecutionLogTypes(EXECUTIONLOG_SETTINGS_KEY(u"Types"_qs), Log::MsgType::ALL)
|
||||
, m_storeExecutionLogEnabled(EXECUTIONLOG_SETTINGS_KEY(u"Enabled"_s))
|
||||
, m_storeDownloadTrackerFavicon(SETTINGS_KEY(u"DownloadTrackerFavicon"_s))
|
||||
, m_storeExecutionLogTypes(EXECUTIONLOG_SETTINGS_KEY(u"Types"_s), Log::MsgType::ALL)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@ -140,7 +140,7 @@ MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
|
||||
m_displaySpeedInTitle = pref->speedInTitleBar();
|
||||
// Setting icons
|
||||
#ifndef Q_OS_MACOS
|
||||
setWindowIcon(UIThemeManager::instance()->getIcon(u"qbittorrent"_qs));
|
||||
setWindowIcon(UIThemeManager::instance()->getIcon(u"qbittorrent"_s));
|
||||
#endif // Q_OS_MACOS
|
||||
|
||||
#if (defined(Q_OS_UNIX))
|
||||
@ -149,30 +149,30 @@ MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
|
||||
|
||||
addToolbarContextMenu();
|
||||
|
||||
m_ui->actionOpen->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_qs));
|
||||
m_ui->actionDownloadFromURL->setIcon(UIThemeManager::instance()->getIcon(u"insert-link"_qs));
|
||||
m_ui->actionSetGlobalSpeedLimits->setIcon(UIThemeManager::instance()->getIcon(u"speedometer"_qs));
|
||||
m_ui->actionCreateTorrent->setIcon(UIThemeManager::instance()->getIcon(u"torrent-creator"_qs, u"document-edit"_qs));
|
||||
m_ui->actionAbout->setIcon(UIThemeManager::instance()->getIcon(u"help-about"_qs));
|
||||
m_ui->actionStatistics->setIcon(UIThemeManager::instance()->getIcon(u"view-statistics"_qs));
|
||||
m_ui->actionTopQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-top"_qs));
|
||||
m_ui->actionIncreaseQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-up"_qs));
|
||||
m_ui->actionDecreaseQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-down"_qs));
|
||||
m_ui->actionBottomQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-bottom"_qs));
|
||||
m_ui->actionDelete->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_qs));
|
||||
m_ui->actionDocumentation->setIcon(UIThemeManager::instance()->getIcon(u"help-contents"_qs));
|
||||
m_ui->actionDonateMoney->setIcon(UIThemeManager::instance()->getIcon(u"wallet-open"_qs));
|
||||
m_ui->actionExit->setIcon(UIThemeManager::instance()->getIcon(u"application-exit"_qs));
|
||||
m_ui->actionLock->setIcon(UIThemeManager::instance()->getIcon(u"object-locked"_qs));
|
||||
m_ui->actionOptions->setIcon(UIThemeManager::instance()->getIcon(u"configure"_qs, u"preferences-system"_qs));
|
||||
m_ui->actionPause->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_qs, u"media-playback-pause"_qs));
|
||||
m_ui->actionPauseAll->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_qs, u"media-playback-pause"_qs));
|
||||
m_ui->actionStart->setIcon(UIThemeManager::instance()->getIcon(u"torrent-start"_qs, u"media-playback-start"_qs));
|
||||
m_ui->actionStartAll->setIcon(UIThemeManager::instance()->getIcon(u"torrent-start"_qs, u"media-playback-start"_qs));
|
||||
m_ui->menuAutoShutdownOnDownloadsCompletion->setIcon(UIThemeManager::instance()->getIcon(u"task-complete"_qs, u"application-exit"_qs));
|
||||
m_ui->actionManageCookies->setIcon(UIThemeManager::instance()->getIcon(u"browser-cookies"_qs, u"preferences-web-browser-cookies"_qs));
|
||||
m_ui->menuLog->setIcon(UIThemeManager::instance()->getIcon(u"help-contents"_qs));
|
||||
m_ui->actionCheckForUpdates->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_qs));
|
||||
m_ui->actionOpen->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_s));
|
||||
m_ui->actionDownloadFromURL->setIcon(UIThemeManager::instance()->getIcon(u"insert-link"_s));
|
||||
m_ui->actionSetGlobalSpeedLimits->setIcon(UIThemeManager::instance()->getIcon(u"speedometer"_s));
|
||||
m_ui->actionCreateTorrent->setIcon(UIThemeManager::instance()->getIcon(u"torrent-creator"_s, u"document-edit"_s));
|
||||
m_ui->actionAbout->setIcon(UIThemeManager::instance()->getIcon(u"help-about"_s));
|
||||
m_ui->actionStatistics->setIcon(UIThemeManager::instance()->getIcon(u"view-statistics"_s));
|
||||
m_ui->actionTopQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-top"_s));
|
||||
m_ui->actionIncreaseQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-up"_s));
|
||||
m_ui->actionDecreaseQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-down"_s));
|
||||
m_ui->actionBottomQueuePos->setIcon(UIThemeManager::instance()->getIcon(u"go-bottom"_s));
|
||||
m_ui->actionDelete->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_s));
|
||||
m_ui->actionDocumentation->setIcon(UIThemeManager::instance()->getIcon(u"help-contents"_s));
|
||||
m_ui->actionDonateMoney->setIcon(UIThemeManager::instance()->getIcon(u"wallet-open"_s));
|
||||
m_ui->actionExit->setIcon(UIThemeManager::instance()->getIcon(u"application-exit"_s));
|
||||
m_ui->actionLock->setIcon(UIThemeManager::instance()->getIcon(u"object-locked"_s));
|
||||
m_ui->actionOptions->setIcon(UIThemeManager::instance()->getIcon(u"configure"_s, u"preferences-system"_s));
|
||||
m_ui->actionPause->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s));
|
||||
m_ui->actionPauseAll->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s));
|
||||
m_ui->actionStart->setIcon(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s));
|
||||
m_ui->actionStartAll->setIcon(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s));
|
||||
m_ui->menuAutoShutdownOnDownloadsCompletion->setIcon(UIThemeManager::instance()->getIcon(u"task-complete"_s, u"application-exit"_s));
|
||||
m_ui->actionManageCookies->setIcon(UIThemeManager::instance()->getIcon(u"browser-cookies"_s, u"preferences-web-browser-cookies"_s));
|
||||
m_ui->menuLog->setIcon(UIThemeManager::instance()->getIcon(u"help-contents"_s));
|
||||
m_ui->actionCheckForUpdates->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_s));
|
||||
|
||||
auto *lockMenu = new QMenu(this);
|
||||
lockMenu->addAction(tr("&Set Password"), this, &MainWindow::defineUILockPassword);
|
||||
@ -231,7 +231,7 @@ MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
|
||||
m_splitter->setCollapsible(0, false);
|
||||
m_tabs->addTab(m_splitter,
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"folder-remote"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"folder-remote"_s),
|
||||
#endif
|
||||
tr("Transfers"));
|
||||
// Filter types
|
||||
@ -678,7 +678,7 @@ void MainWindow::displayRSSTab(bool enable)
|
||||
m_tabs->addTab(m_rssWidget, tr("RSS (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount()));
|
||||
#else
|
||||
const int indexTab = m_tabs->addTab(m_rssWidget, tr("RSS (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount()));
|
||||
m_tabs->setTabIcon(indexTab, UIThemeManager::instance()->getIcon(u"application-rss"_qs));
|
||||
m_tabs->setTabIcon(indexTab, UIThemeManager::instance()->getIcon(u"application-rss"_s));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -716,7 +716,7 @@ void MainWindow::displaySearchTab(bool enable)
|
||||
m_searchWidget = new SearchWidget(app(), this);
|
||||
m_tabs->insertTab(1, m_searchWidget,
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"edit-find"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"edit-find"_s),
|
||||
#endif
|
||||
tr("Search"));
|
||||
}
|
||||
@ -740,7 +740,7 @@ void MainWindow::updateNbTorrents()
|
||||
|
||||
void MainWindow::on_actionDocumentation_triggered() const
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl(u"https://doc.qbittorrent.org"_qs));
|
||||
QDesktopServices::openUrl(QUrl(u"https://doc.qbittorrent.org"_s));
|
||||
}
|
||||
|
||||
void MainWindow::tabChanged(int newTab)
|
||||
@ -1338,7 +1338,7 @@ void MainWindow::dragEnterEvent(QDragEnterEvent *event)
|
||||
for (const QString &mime : asConst(event->mimeData()->formats()))
|
||||
qDebug("mimeData: %s", mime.toLocal8Bit().data());
|
||||
|
||||
if (event->mimeData()->hasFormat(u"text/plain"_qs) || event->mimeData()->hasFormat(u"text/uri-list"_qs))
|
||||
if (event->mimeData()->hasFormat(u"text/plain"_s) || event->mimeData()->hasFormat(u"text/uri-list"_s))
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
||||
@ -1537,7 +1537,7 @@ void MainWindow::reloadSessionStats()
|
||||
MacUtils::setBadgeLabelText({});
|
||||
}
|
||||
#else
|
||||
const auto toolTip = u"%1\n%2"_qs.arg(
|
||||
const auto toolTip = u"%1\n%2"_s.arg(
|
||||
tr("DL speed: %1", "e.g: Download speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadDownloadRate, true))
|
||||
, tr("UP speed: %1", "e.g: Upload speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadUploadRate, true)));
|
||||
app()->desktopIntegration()->setToolTip(toolTip); // tray icon
|
||||
@ -1775,7 +1775,7 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i
|
||||
{
|
||||
const QString msg {tr("A new version is available.") + u"<br/>"
|
||||
+ tr("Do you want to download %1?").arg(newVersion) + u"<br/><br/>"
|
||||
+ u"<a href=\"https://www.qbittorrent.org/news.php\">%1</a>"_qs.arg(tr("Open changelog..."))};
|
||||
+ u"<a href=\"https://www.qbittorrent.org/news.php\">%1</a>"_s.arg(tr("Open changelog..."))};
|
||||
auto *msgBox = new QMessageBox {QMessageBox::Question, tr("qBittorrent Update Available"), msg
|
||||
, (QMessageBox::Yes | QMessageBox::No), this};
|
||||
msgBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
@ -1796,7 +1796,7 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i
|
||||
{
|
||||
if (invokedByUser)
|
||||
{
|
||||
auto *msgBox = new QMessageBox {QMessageBox::Information, u"qBittorrent"_qs
|
||||
auto *msgBox = new QMessageBox {QMessageBox::Information, u"qBittorrent"_s
|
||||
, tr("No updates available.\nYou are already using the latest version.")
|
||||
, QMessageBox::Ok, this};
|
||||
msgBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
@ -1820,7 +1820,7 @@ void MainWindow::toggleAlternativeSpeeds()
|
||||
|
||||
void MainWindow::on_actionDonateMoney_triggered()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl(u"https://www.qbittorrent.org/donate"_qs));
|
||||
QDesktopServices::openUrl(QUrl(u"https://www.qbittorrent.org/donate"_s));
|
||||
}
|
||||
|
||||
void MainWindow::showConnectionSettings()
|
||||
@ -1844,7 +1844,7 @@ void MainWindow::on_actionExecutionLogs_triggered(bool checked)
|
||||
m_tabs->addTab(m_executionLog, tr("Execution Log"));
|
||||
#else
|
||||
const int indexTab = m_tabs->addTab(m_executionLog, tr("Execution Log"));
|
||||
m_tabs->setTabIcon(indexTab, UIThemeManager::instance()->getIcon(u"help-contents"_qs));
|
||||
m_tabs->setTabIcon(indexTab, UIThemeManager::instance()->getIcon(u"help-contents"_s));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -1970,12 +1970,12 @@ void MainWindow::installPython()
|
||||
// Download python
|
||||
#ifdef QBT_APP_64BIT
|
||||
const auto installerURL = ::IsWindows8OrGreater()
|
||||
? u"https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe"_qs
|
||||
: u"https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe"_qs;
|
||||
? u"https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe"_s
|
||||
: u"https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe"_s;
|
||||
#else
|
||||
const auto installerURL = ::IsWindows8OrGreater()
|
||||
? u"https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe"_qs
|
||||
: u"https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe"_qs;
|
||||
? u"https://www.python.org/ftp/python/3.10.11/python-3.10.11.exe"_s
|
||||
: u"https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe"_s;
|
||||
#endif
|
||||
Net::DownloadManager::instance()->download(
|
||||
Net::DownloadRequest(installerURL).saveToFile(true)
|
||||
@ -2001,7 +2001,7 @@ void MainWindow::pythonDownloadFinished(const Net::DownloadResult &result)
|
||||
|
||||
const Path exePath = result.filePath + u".exe";
|
||||
Utils::Fs::renameFile(result.filePath, exePath);
|
||||
installer.start(exePath.toString(), {u"/passive"_qs});
|
||||
installer.start(exePath.toString(), {u"/passive"_s});
|
||||
|
||||
// Wait for setup to complete
|
||||
installer.waitForFinished(10 * 60 * 1000);
|
||||
|
@ -42,17 +42,17 @@ DBusNotificationsInterface::DBusNotificationsInterface(const QString &service
|
||||
|
||||
QDBusPendingReply<QStringList> DBusNotificationsInterface::getCapabilities()
|
||||
{
|
||||
return asyncCall(u"GetCapabilities"_qs);
|
||||
return asyncCall(u"GetCapabilities"_s);
|
||||
}
|
||||
|
||||
QDBusPendingReply<QString, QString, QString, QString> DBusNotificationsInterface::getServerInformation()
|
||||
{
|
||||
return asyncCall(u"GetServerInformation"_qs);
|
||||
return asyncCall(u"GetServerInformation"_s);
|
||||
}
|
||||
|
||||
QDBusReply<QString> DBusNotificationsInterface::getServerInformation(QString &vendor, QString &version, QString &specVersion)
|
||||
{
|
||||
const QDBusMessage reply = call(QDBus::Block, u"GetServerInformation"_qs);
|
||||
const QDBusMessage reply = call(QDBus::Block, u"GetServerInformation"_s);
|
||||
if ((reply.type() == QDBusMessage::ReplyMessage) && (reply.arguments().count() == 4))
|
||||
{
|
||||
vendor = qdbus_cast<QString>(reply.arguments().at(1));
|
||||
@ -67,10 +67,10 @@ QDBusPendingReply<uint> DBusNotificationsInterface::notify(const QString &appNam
|
||||
, const uint id, const QString &icon, const QString &summary, const QString &body
|
||||
, const QStringList &actions, const QVariantMap &hints, const int timeout)
|
||||
{
|
||||
return asyncCall(u"Notify"_qs, appName, id, icon, summary, body, actions, hints, timeout);
|
||||
return asyncCall(u"Notify"_s, appName, id, icon, summary, body, actions, hints, timeout);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> DBusNotificationsInterface::closeNotification(const uint id)
|
||||
{
|
||||
return asyncCall(u"CloseNotification"_qs, id);
|
||||
return asyncCall(u"CloseNotification"_s, id);
|
||||
}
|
||||
|
@ -38,8 +38,8 @@
|
||||
|
||||
DBusNotifier::DBusNotifier(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_notificationsInterface {new DBusNotificationsInterface(u"org.freedesktop.Notifications"_qs
|
||||
, u"/org/freedesktop/Notifications"_qs, QDBusConnection::sessionBus(), this)}
|
||||
, m_notificationsInterface {new DBusNotificationsInterface(u"org.freedesktop.Notifications"_s
|
||||
, u"/org/freedesktop/Notifications"_s, QDBusConnection::sessionBus(), this)}
|
||||
{
|
||||
// Testing for 'DBusNotificationsInterface::isValid()' isn't helpful here.
|
||||
// If the notification daemon is configured to run 'as needed'
|
||||
@ -58,10 +58,10 @@ DBusNotifier::DBusNotifier(QObject *parent)
|
||||
void DBusNotifier::showMessage(const QString &title, const QString &message, const int timeout)
|
||||
{
|
||||
// Assign "default" action to notification to make it clickable
|
||||
const QStringList actions {u"default"_qs, {}};
|
||||
const QVariantMap hints {{u"desktop-entry"_qs, u"org.qbittorrent.qBittorrent"_qs}};
|
||||
const QDBusPendingReply<uint> reply = m_notificationsInterface->notify(u"qBittorrent"_qs, 0
|
||||
, u"qbittorrent"_qs, title, message, actions, hints, timeout);
|
||||
const QStringList actions {u"default"_s, {}};
|
||||
const QVariantMap hints {{u"desktop-entry"_s, u"org.qbittorrent.qBittorrent"_s}};
|
||||
const QDBusPendingReply<uint> reply = m_notificationsInterface->notify(u"qBittorrent"_s, 0
|
||||
, u"qbittorrent"_s, title, message, actions, hints, timeout);
|
||||
auto *watcher = new QDBusPendingCallWatcher(reply, this);
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *self)
|
||||
{
|
||||
|
@ -86,7 +86,7 @@ namespace
|
||||
const QDate date {2018, 11, 5}; // Monday
|
||||
QStringList ret;
|
||||
for (int i = 0; i < 7; ++i)
|
||||
ret.append(locale.toString(date.addDays(i), u"dddd"_qs));
|
||||
ret.append(locale.toString(date.addDays(i), u"dddd"_s));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -113,9 +113,9 @@ OptionsDialog::OptionsDialog(IGUIApplication *app, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, GUIApplicationComponent(app)
|
||||
, m_ui {new Ui::OptionsDialog}
|
||||
, m_storeDialogSize {SETTINGS_KEY(u"Size"_qs)}
|
||||
, m_storeHSplitterSize {SETTINGS_KEY(u"HorizontalSplitterSizes"_qs)}
|
||||
, m_storeLastViewedPage {SETTINGS_KEY(u"LastViewedPage"_qs)}
|
||||
, m_storeDialogSize {SETTINGS_KEY(u"Size"_s)}
|
||||
, m_storeHSplitterSize {SETTINGS_KEY(u"HorizontalSplitterSizes"_s)}
|
||||
, m_storeLastViewedPage {SETTINGS_KEY(u"LastViewedPage"_s)}
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
m_applyButton = m_ui->buttonBox->button(QDialogButtonBox::Apply);
|
||||
@ -128,18 +128,18 @@ OptionsDialog::OptionsDialog(IGUIApplication *app, QWidget *parent)
|
||||
m_ui->hsplitter->setCollapsible(1, false);
|
||||
|
||||
// Main icons
|
||||
m_ui->tabSelection->item(TAB_UI)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-desktop"_qs));
|
||||
m_ui->tabSelection->item(TAB_BITTORRENT)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-bittorrent"_qs, u"preferences-system-network"_qs));
|
||||
m_ui->tabSelection->item(TAB_CONNECTION)->setIcon(UIThemeManager::instance()->getIcon(u"network-connect"_qs, u"network-wired"_qs));
|
||||
m_ui->tabSelection->item(TAB_DOWNLOADS)->setIcon(UIThemeManager::instance()->getIcon(u"download"_qs, u"folder-download"_qs));
|
||||
m_ui->tabSelection->item(TAB_SPEED)->setIcon(UIThemeManager::instance()->getIcon(u"speedometer"_qs, u"chronometer"_qs));
|
||||
m_ui->tabSelection->item(TAB_RSS)->setIcon(UIThemeManager::instance()->getIcon(u"application-rss"_qs, u"application-rss+xml"_qs));
|
||||
m_ui->tabSelection->item(TAB_UI)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-desktop"_s));
|
||||
m_ui->tabSelection->item(TAB_BITTORRENT)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-bittorrent"_s, u"preferences-system-network"_s));
|
||||
m_ui->tabSelection->item(TAB_CONNECTION)->setIcon(UIThemeManager::instance()->getIcon(u"network-connect"_s, u"network-wired"_s));
|
||||
m_ui->tabSelection->item(TAB_DOWNLOADS)->setIcon(UIThemeManager::instance()->getIcon(u"download"_s, u"folder-download"_s));
|
||||
m_ui->tabSelection->item(TAB_SPEED)->setIcon(UIThemeManager::instance()->getIcon(u"speedometer"_s, u"chronometer"_s));
|
||||
m_ui->tabSelection->item(TAB_RSS)->setIcon(UIThemeManager::instance()->getIcon(u"application-rss"_s, u"application-rss+xml"_s));
|
||||
#ifdef DISABLE_WEBUI
|
||||
m_ui->tabSelection->item(TAB_WEBUI)->setHidden(true);
|
||||
#else
|
||||
m_ui->tabSelection->item(TAB_WEBUI)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-webui"_qs, u"network-server"_qs));
|
||||
m_ui->tabSelection->item(TAB_WEBUI)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-webui"_s, u"network-server"_s));
|
||||
#endif
|
||||
m_ui->tabSelection->item(TAB_ADVANCED)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-advanced"_qs, u"preferences-other"_qs));
|
||||
m_ui->tabSelection->item(TAB_ADVANCED)->setIcon(UIThemeManager::instance()->getIcon(u"preferences-advanced"_s, u"preferences-other"_s));
|
||||
|
||||
// set uniform size for all icons
|
||||
int maxHeight = -1;
|
||||
@ -401,7 +401,7 @@ void OptionsDialog::saveBehaviorTabOptions() const
|
||||
if (pref->getLocale() != locale)
|
||||
{
|
||||
auto *translator = new QTranslator;
|
||||
if (translator->load(u":/lang/qbittorrent_"_qs + locale))
|
||||
if (translator->load(u":/lang/qbittorrent_"_s + locale))
|
||||
qDebug("%s locale recognized, using translation.", qUtf8Printable(locale));
|
||||
else
|
||||
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(locale));
|
||||
@ -589,7 +589,7 @@ void OptionsDialog::loadDownloadsTabOptions()
|
||||
#else
|
||||
m_ui->autoRunConsole->hide();
|
||||
#endif
|
||||
const auto autoRunStr = u"%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n %11\n %12\n %13\n%14"_qs
|
||||
const auto autoRunStr = u"%1\n %2\n %3\n %4\n %5\n %6\n %7\n %8\n %9\n %10\n %11\n %12\n %13\n%14"_s
|
||||
.arg(tr("Supported parameters (case sensitive):")
|
||||
, tr("%N: Torrent name")
|
||||
, tr("%L: Category")
|
||||
@ -823,7 +823,7 @@ void OptionsDialog::loadConnectionTabOptions()
|
||||
m_ui->textFilterPath->setFileNameFilter(tr("All supported filters") + u" (*.dat *.p2p *.p2b);;.dat (*.dat);;.p2p (*.p2p);;.p2b (*.p2b)");
|
||||
m_ui->textFilterPath->setSelectedPath(session->IPFilterFile());
|
||||
|
||||
m_ui->IpFilterRefreshBtn->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_qs));
|
||||
m_ui->IpFilterRefreshBtn->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_s));
|
||||
m_ui->IpFilterRefreshBtn->setEnabled(m_ui->checkIPFilter->isChecked());
|
||||
m_ui->checkIpFilterTrackers->setChecked(session->isTrackerFilteringEnabled());
|
||||
|
||||
@ -914,11 +914,11 @@ void OptionsDialog::loadSpeedTabOptions()
|
||||
const auto *pref = Preferences::instance();
|
||||
const auto *session = BitTorrent::Session::instance();
|
||||
|
||||
m_ui->labelGlobalRate->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"slow_off"_qs, Utils::Gui::mediumIconSize(this).height()));
|
||||
m_ui->labelGlobalRate->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"slow_off"_s, Utils::Gui::mediumIconSize(this).height()));
|
||||
m_ui->spinUploadLimit->setValue(session->globalUploadSpeedLimit() / 1024);
|
||||
m_ui->spinDownloadLimit->setValue(session->globalDownloadSpeedLimit() / 1024);
|
||||
|
||||
m_ui->labelAltRate->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"slow"_qs, Utils::Gui::mediumIconSize(this).height()));
|
||||
m_ui->labelAltRate->setPixmap(UIThemeManager::instance()->getScaledPixmap(u"slow"_s, Utils::Gui::mediumIconSize(this).height()));
|
||||
m_ui->spinUploadLimitAlt->setValue(session->altGlobalUploadSpeedLimit() / 1024);
|
||||
m_ui->spinDownloadLimitAlt->setValue(session->altGlobalDownloadSpeedLimit() / 1024);
|
||||
|
||||
@ -1284,11 +1284,11 @@ void OptionsDialog::saveWebUITabOptions() const
|
||||
void OptionsDialog::initializeLanguageCombo()
|
||||
{
|
||||
// List language files
|
||||
const QDir langDir(u":/lang"_qs);
|
||||
const QStringList langFiles = langDir.entryList(QStringList(u"qbittorrent_*.qm"_qs), QDir::Files);
|
||||
const QDir langDir(u":/lang"_s);
|
||||
const QStringList langFiles = langDir.entryList(QStringList(u"qbittorrent_*.qm"_s), QDir::Files);
|
||||
for (const QString &langFile : langFiles)
|
||||
{
|
||||
const QString localeStr = langFile.section(u"_"_qs, 1, -1).section(u"."_qs, 0, 0); // remove "qbittorrent_" and ".qm"
|
||||
const QString localeStr = langFile.section(u"_"_s, 1, -1).section(u"."_s, 0, 0); // remove "qbittorrent_" and ".qm"
|
||||
m_ui->comboI18n->addItem(/*QIcon(":/icons/flags/"+country+".svg"), */ Utils::Misc::languageToLocalizedString(localeStr), localeStr);
|
||||
qDebug() << "Supported locale:" << localeStr;
|
||||
}
|
||||
@ -1613,19 +1613,19 @@ void OptionsDialog::setLocale(const QString &localeStr)
|
||||
QString name;
|
||||
if (localeStr.startsWith(u"eo", Qt::CaseInsensitive))
|
||||
{
|
||||
name = u"eo"_qs;
|
||||
name = u"eo"_s;
|
||||
}
|
||||
else if (localeStr.startsWith(u"ltg", Qt::CaseInsensitive))
|
||||
{
|
||||
name = u"ltg"_qs;
|
||||
name = u"ltg"_s;
|
||||
}
|
||||
else
|
||||
{
|
||||
QLocale locale(localeStr);
|
||||
if (locale.language() == QLocale::Uzbek)
|
||||
name = u"uz@Latn"_qs;
|
||||
name = u"uz@Latn"_s;
|
||||
else if (locale.language() == QLocale::Azerbaijani)
|
||||
name = u"az@latin"_qs;
|
||||
name = u"az@latin"_s;
|
||||
else
|
||||
name = locale.name();
|
||||
}
|
||||
@ -1644,7 +1644,7 @@ void OptionsDialog::setLocale(const QString &localeStr)
|
||||
if (index < 0)
|
||||
{
|
||||
// Unrecognized, use US English
|
||||
index = m_ui->comboI18n->findData(u"en"_qs, Qt::UserRole);
|
||||
index = m_ui->comboI18n->findData(u"en"_s, Qt::UserRole);
|
||||
Q_ASSERT(index >= 0);
|
||||
}
|
||||
m_ui->comboI18n->setCurrentIndex(index);
|
||||
@ -1757,7 +1757,7 @@ void OptionsDialog::webUIHttpsCertChanged(const Path &path)
|
||||
|
||||
m_ui->textWebUIHttpsCert->setSelectedPath(path);
|
||||
m_ui->lblSslCertStatus->setPixmap(UIThemeManager::instance()->getScaledPixmap(
|
||||
(isCertValid ? u"security-high"_qs : u"security-low"_qs), 24));
|
||||
(isCertValid ? u"security-high"_s : u"security-low"_s), 24));
|
||||
}
|
||||
|
||||
void OptionsDialog::webUIHttpsKeyChanged(const Path &path)
|
||||
@ -1767,7 +1767,7 @@ void OptionsDialog::webUIHttpsKeyChanged(const Path &path)
|
||||
|
||||
m_ui->textWebUIHttpsKey->setSelectedPath(path);
|
||||
m_ui->lblSslKeyStatus->setPixmap(UIThemeManager::instance()->getScaledPixmap(
|
||||
(isKeyValid ? u"security-high"_qs : u"security-low"_qs), 24));
|
||||
(isKeyValid ? u"security-high"_s : u"security-low"_s), 24));
|
||||
}
|
||||
|
||||
bool OptionsDialog::isWebUiEnabled() const
|
||||
|
@ -62,15 +62,15 @@ void PowerManagementInhibitor::requestIdle()
|
||||
|
||||
QDBusMessage call = m_useGSM
|
||||
? QDBusMessage::createMethodCall(
|
||||
u"org.gnome.SessionManager"_qs,
|
||||
u"/org/gnome/SessionManager"_qs,
|
||||
u"org.gnome.SessionManager"_qs,
|
||||
u"Uninhibit"_qs)
|
||||
u"org.gnome.SessionManager"_s,
|
||||
u"/org/gnome/SessionManager"_s,
|
||||
u"org.gnome.SessionManager"_s,
|
||||
u"Uninhibit"_s)
|
||||
: QDBusMessage::createMethodCall(
|
||||
u"org.freedesktop.PowerManagement"_qs,
|
||||
u"/org/freedesktop/PowerManagement/Inhibit"_qs,
|
||||
u"org.freedesktop.PowerManagement.Inhibit"_qs,
|
||||
u"UnInhibit"_qs);
|
||||
u"org.freedesktop.PowerManagement"_s,
|
||||
u"/org/freedesktop/PowerManagement/Inhibit"_s,
|
||||
u"org.freedesktop.PowerManagement.Inhibit"_s,
|
||||
u"UnInhibit"_s);
|
||||
call.setArguments({m_cookie});
|
||||
|
||||
QDBusPendingCall pcall = QDBusConnection::sessionBus().asyncCall(call, 1000);
|
||||
@ -90,20 +90,20 @@ void PowerManagementInhibitor::requestBusy()
|
||||
|
||||
QDBusMessage call = m_useGSM
|
||||
? QDBusMessage::createMethodCall(
|
||||
u"org.gnome.SessionManager"_qs,
|
||||
u"/org/gnome/SessionManager"_qs,
|
||||
u"org.gnome.SessionManager"_qs,
|
||||
u"Inhibit"_qs)
|
||||
u"org.gnome.SessionManager"_s,
|
||||
u"/org/gnome/SessionManager"_s,
|
||||
u"org.gnome.SessionManager"_s,
|
||||
u"Inhibit"_s)
|
||||
: QDBusMessage::createMethodCall(
|
||||
u"org.freedesktop.PowerManagement"_qs,
|
||||
u"/org/freedesktop/PowerManagement/Inhibit"_qs,
|
||||
u"org.freedesktop.PowerManagement.Inhibit"_qs,
|
||||
u"Inhibit"_qs);
|
||||
u"org.freedesktop.PowerManagement"_s,
|
||||
u"/org/freedesktop/PowerManagement/Inhibit"_s,
|
||||
u"org.freedesktop.PowerManagement.Inhibit"_s,
|
||||
u"Inhibit"_s);
|
||||
|
||||
QList<QVariant> args = {u"qBittorrent"_qs};
|
||||
QList<QVariant> args = {u"qBittorrent"_s};
|
||||
if (m_useGSM)
|
||||
args << 0u;
|
||||
args << u"Active torrents are presented"_qs;
|
||||
args << u"Active torrents are presented"_s;
|
||||
if (m_useGSM)
|
||||
args << 8u;
|
||||
call.setArguments(args);
|
||||
|
@ -57,7 +57,7 @@ void PreviewListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
|
||||
{
|
||||
const qreal progress = (index.data().toReal() * 100);
|
||||
const QString text = (progress >= 100)
|
||||
? u"100%"_qs
|
||||
? u"100%"_s
|
||||
: (Utils::String::fromDouble(progress, 1) + u'%');
|
||||
|
||||
m_progressBarPainter.paint(painter, option, text, static_cast<int>(progress));
|
||||
|
@ -51,11 +51,11 @@ PreviewSelectDialog::PreviewSelectDialog(QWidget *parent, const BitTorrent::Torr
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::PreviewSelectDialog)
|
||||
, m_torrent(torrent)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
, m_storeTreeHeaderState(u"GUI/Qt6/" SETTINGS_KEY(u"HeaderState"_qs))
|
||||
, m_storeTreeHeaderState(u"GUI/Qt6/" SETTINGS_KEY(u"HeaderState"_s))
|
||||
#else
|
||||
, m_storeTreeHeaderState(SETTINGS_KEY(u"HeaderState"_qs))
|
||||
, m_storeTreeHeaderState(SETTINGS_KEY(u"HeaderState"_s))
|
||||
#endif
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
@ -65,7 +65,7 @@ namespace
|
||||
if (newVersion == currentVersion)
|
||||
{
|
||||
const bool isDevVersion = QStringLiteral(QBT_VERSION_STATUS).contains(
|
||||
QRegularExpression(u"(alpha|beta|rc)"_qs));
|
||||
QRegularExpression(u"(alpha|beta|rc)"_s));
|
||||
if (isDevVersion)
|
||||
return true;
|
||||
}
|
||||
@ -75,7 +75,7 @@ namespace
|
||||
|
||||
void ProgramUpdater::checkForUpdates() const
|
||||
{
|
||||
const auto RSS_URL = u"https://www.fosshub.com/feed/5b8793a7f9ee5a5c3e97a3b2.xml"_qs;
|
||||
const auto RSS_URL = u"https://www.fosshub.com/feed/5b8793a7f9ee5a5c3e97a3b2.xml"_s;
|
||||
// Don't change this User-Agent. In case our updater goes haywire,
|
||||
// the filehost can identify it and contact us.
|
||||
Net::DownloadManager::instance()->download(
|
||||
@ -108,11 +108,11 @@ void ProgramUpdater::rssDownloadFinished(const Net::DownloadResult &result)
|
||||
};
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
const QString OS_TYPE = u"Mac OS X"_qs;
|
||||
const QString OS_TYPE = u"Mac OS X"_s;
|
||||
#elif defined(Q_OS_WIN)
|
||||
const QString OS_TYPE = (::IsWindows7OrGreater() && QSysInfo::currentCpuArchitecture().endsWith(u"64"))
|
||||
? u"Windows x64"_qs
|
||||
: u"Windows"_qs;
|
||||
? u"Windows x64"_s
|
||||
: u"Windows"_s;
|
||||
#endif
|
||||
|
||||
bool inItem = false;
|
||||
|
@ -42,7 +42,7 @@
|
||||
ProgressBarPainter::ProgressBarPainter()
|
||||
{
|
||||
#if (defined(Q_OS_WIN) || defined(Q_OS_MACOS))
|
||||
auto *fusionStyle = new QProxyStyle {u"fusion"_qs};
|
||||
auto *fusionStyle = new QProxyStyle {u"fusion"_s};
|
||||
fusionStyle->setParent(&m_dummyProgressBar);
|
||||
m_dummyProgressBar.setStyle(fusionStyle);
|
||||
#endif
|
||||
|
@ -190,7 +190,7 @@ void DownloadedPiecesBar::clear()
|
||||
QString DownloadedPiecesBar::simpleToolTipText() const
|
||||
{
|
||||
const QString borderColor = colorBoxBorderColor().name();
|
||||
const QString rowHTML = u"<tr><td width=20 bgcolor='%1' style='border: 1px solid \"%2\";'></td><td>%3</td></tr>"_qs;
|
||||
const QString rowHTML = u"<tr><td width=20 bgcolor='%1' style='border: 1px solid \"%2\";'></td><td>%3</td></tr>"_s;
|
||||
return u"<table cellspacing=4>"
|
||||
+ rowHTML.arg(backgroundColor().name(), borderColor, tr("Missing pieces"))
|
||||
+ rowHTML.arg(m_dlPieceColor.name(), borderColor, tr("Partial pieces"))
|
||||
|
@ -298,7 +298,7 @@ void PeerListWidget::showPeerListMenu()
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
menu->setToolTipsVisible(true);
|
||||
|
||||
QAction *addNewPeer = menu->addAction(UIThemeManager::instance()->getIcon(u"peers-add"_qs), tr("Add peers...")
|
||||
QAction *addNewPeer = menu->addAction(UIThemeManager::instance()->getIcon(u"peers-add"_s), tr("Add peers...")
|
||||
, this, [this, torrent]()
|
||||
{
|
||||
const QVector<BitTorrent::PeerAddress> peersList = PeersAdditionDialog::askForPeers(this);
|
||||
@ -311,10 +311,10 @@ void PeerListWidget::showPeerListMenu()
|
||||
else if (peerCount > 0)
|
||||
QMessageBox::information(this, tr("Adding peers"), tr("Peers are added to this torrent."));
|
||||
});
|
||||
QAction *copyPeers = menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy IP:port")
|
||||
QAction *copyPeers = menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_s), tr("Copy IP:port")
|
||||
, this, &PeerListWidget::copySelectedPeers);
|
||||
menu->addSeparator();
|
||||
QAction *banPeers = menu->addAction(UIThemeManager::instance()->getIcon(u"peers-remove"_qs), tr("Ban peer permanently")
|
||||
QAction *banPeers = menu->addAction(UIThemeManager::instance()->getIcon(u"peers-remove"_s), tr("Ban peer permanently")
|
||||
, this, &PeerListWidget::banSelectedPeers);
|
||||
|
||||
// disable actions
|
||||
|
@ -170,7 +170,7 @@ void PieceAvailabilityBar::clear()
|
||||
QString PieceAvailabilityBar::simpleToolTipText() const
|
||||
{
|
||||
const QString borderColor = colorBoxBorderColor().name();
|
||||
const QString rowHTML = u"<tr><td width=20 bgcolor='%1' style='border: 1px solid \"%2\";'></td><td>%3</td></tr>"_qs;
|
||||
const QString rowHTML = u"<tr><td width=20 bgcolor='%1' style='border: 1px solid \"%2\";'></td><td>%3</td></tr>"_s;
|
||||
return u"<table cellspacing=4>"
|
||||
+ rowHTML.arg(backgroundColor().name(), borderColor, tr("Unavailable pieces"))
|
||||
+ rowHTML.arg(pieceColor().name(), borderColor, tr("Available pieces"))
|
||||
|
@ -111,9 +111,9 @@ PropertiesWidget::PropertiesWidget(QWidget *parent)
|
||||
|
||||
// Tracker list
|
||||
m_trackerList = new TrackerListWidget(this);
|
||||
m_ui->trackerUpButton->setIcon(UIThemeManager::instance()->getIcon(u"go-up"_qs));
|
||||
m_ui->trackerUpButton->setIcon(UIThemeManager::instance()->getIcon(u"go-up"_s));
|
||||
m_ui->trackerUpButton->setIconSize(Utils::Gui::smallIconSize());
|
||||
m_ui->trackerDownButton->setIcon(UIThemeManager::instance()->getIcon(u"go-down"_qs));
|
||||
m_ui->trackerDownButton->setIcon(UIThemeManager::instance()->getIcon(u"go-down"_s));
|
||||
m_ui->trackerDownButton->setIconSize(Utils::Gui::smallIconSize());
|
||||
connect(m_ui->trackerUpButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionUp);
|
||||
connect(m_ui->trackerDownButton, &QPushButton::clicked, m_trackerList, &TrackerListWidget::moveSelectionDown);
|
||||
@ -512,16 +512,16 @@ void PropertiesWidget::displayWebSeedListMenu()
|
||||
QMenu *menu = new QMenu(this);
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_qs), tr("New Web seed"), this, &PropertiesWidget::askWebSeed);
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_s), tr("New Web seed"), this, &PropertiesWidget::askWebSeed);
|
||||
|
||||
if (!rows.isEmpty())
|
||||
{
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_qs, u"list-remove"_qs), tr("Remove Web seed")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s, u"list-remove"_s), tr("Remove Web seed")
|
||||
, this, &PropertiesWidget::deleteSelectedUrlSeeds);
|
||||
menu->addSeparator();
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy Web seed URL")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_s), tr("Copy Web seed URL")
|
||||
, this, &PropertiesWidget::copySelectedWebSeedsToClipboard);
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_qs), tr("Edit Web seed URL")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_s), tr("Edit Web seed URL")
|
||||
, this, &PropertiesWidget::editWebSeed);
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ void PropertiesWidget::configure()
|
||||
delete m_speedWidget;
|
||||
}
|
||||
|
||||
const auto displayText = u"<center><b>%1</b><p>%2</p></center>"_qs
|
||||
const auto displayText = u"<center><b>%1</b><p>%2</p></center>"_s
|
||||
.arg(tr("Speed graphs are disabled"), tr("You can enable it in Advanced Options"));
|
||||
auto *label = new QLabel(displayText, this);
|
||||
label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
@ -571,12 +571,12 @@ void PropertiesWidget::askWebSeed()
|
||||
// Ask user for a new url seed
|
||||
const QString urlSeed = AutoExpandableDialog::getText(this, tr("New URL seed", "New HTTP source"),
|
||||
tr("New URL seed:"), QLineEdit::Normal,
|
||||
u"http://www."_qs, &ok);
|
||||
u"http://www."_s, &ok);
|
||||
if (!ok) return;
|
||||
qDebug("Adding %s web seed", qUtf8Printable(urlSeed));
|
||||
if (!m_ui->listWebSeeds->findItems(urlSeed, Qt::MatchFixedString).empty())
|
||||
{
|
||||
QMessageBox::warning(this, u"qBittorrent"_qs, tr("This URL seed is already in the list."), QMessageBox::Ok);
|
||||
QMessageBox::warning(this, u"qBittorrent"_s, tr("This URL seed is already in the list."), QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
if (m_torrent)
|
||||
@ -628,7 +628,7 @@ void PropertiesWidget::editWebSeed()
|
||||
|
||||
if (!m_ui->listWebSeeds->findItems(newSeed, Qt::MatchFixedString).empty())
|
||||
{
|
||||
QMessageBox::warning(this, u"qBittorrent"_qs,
|
||||
QMessageBox::warning(this, u"qBittorrent"_s,
|
||||
tr("This URL seed is already in the list."),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
|
@ -45,7 +45,7 @@ PropTabBar::PropTabBar(QWidget *parent)
|
||||
// General tab
|
||||
QPushButton *mainInfosButton = new QPushButton(
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"help-about"_qs, u"document-properties"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"help-about"_s, u"document-properties"_s),
|
||||
#endif
|
||||
tr("General"), parent);
|
||||
mainInfosButton->setShortcut(Qt::ALT + Qt::Key_G);
|
||||
@ -54,7 +54,7 @@ PropTabBar::PropTabBar(QWidget *parent)
|
||||
// Trackers tab
|
||||
QPushButton *trackersButton = new QPushButton(
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"trackers"_qs, u"network-server"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"trackers"_s, u"network-server"_s),
|
||||
#endif
|
||||
tr("Trackers"), parent);
|
||||
trackersButton->setShortcut(Qt::ALT + Qt::Key_C);
|
||||
@ -63,7 +63,7 @@ PropTabBar::PropTabBar(QWidget *parent)
|
||||
// Peers tab
|
||||
QPushButton *peersButton = new QPushButton(
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"peers"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"peers"_s),
|
||||
#endif
|
||||
tr("Peers"), parent);
|
||||
peersButton->setShortcut(Qt::ALT + Qt::Key_R);
|
||||
@ -72,7 +72,7 @@ PropTabBar::PropTabBar(QWidget *parent)
|
||||
// URL seeds tab
|
||||
QPushButton *URLSeedsButton = new QPushButton(
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"network-server"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"network-server"_s),
|
||||
#endif
|
||||
tr("HTTP Sources"), parent);
|
||||
URLSeedsButton->setShortcut(Qt::ALT + Qt::Key_B);
|
||||
@ -81,7 +81,7 @@ PropTabBar::PropTabBar(QWidget *parent)
|
||||
// Files tab
|
||||
QPushButton *filesButton = new QPushButton(
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"directory"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"directory"_s),
|
||||
#endif
|
||||
tr("Content"), parent);
|
||||
filesButton->setShortcut(Qt::ALT + Qt::Key_Z);
|
||||
@ -92,7 +92,7 @@ PropTabBar::PropTabBar(QWidget *parent)
|
||||
// Speed tab
|
||||
QPushButton *speedButton = new QPushButton(
|
||||
#ifndef Q_OS_MACOS
|
||||
UIThemeManager::instance()->getIcon(u"chart-line"_qs),
|
||||
UIThemeManager::instance()->getIcon(u"chart-line"_s),
|
||||
#endif
|
||||
tr("Speed"), parent);
|
||||
speedButton->setShortcut(Qt::ALT + Qt::Key_D);
|
||||
|
@ -93,13 +93,13 @@ TrackerListWidget::TrackerListWidget(PropertiesWidget *properties)
|
||||
connect(header(), &QHeaderView::sortIndicatorChanged, this, &TrackerListWidget::saveSettings);
|
||||
|
||||
// Set DHT, PeX, LSD items
|
||||
m_DHTItem = new QTreeWidgetItem({ u""_qs, u"** [DHT] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
|
||||
m_DHTItem = new QTreeWidgetItem({ u""_s, u"** [DHT] **"_s, u""_s, u"0"_s, u""_s, u""_s, u"0"_s });
|
||||
insertTopLevelItem(0, m_DHTItem);
|
||||
setRowColor(0, QColorConstants::Svg::grey);
|
||||
m_PEXItem = new QTreeWidgetItem({ u""_qs, u"** [PeX] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
|
||||
m_PEXItem = new QTreeWidgetItem({ u""_s, u"** [PeX] **"_s, u""_s, u"0"_s, u""_s, u""_s, u"0"_s });
|
||||
insertTopLevelItem(1, m_PEXItem);
|
||||
setRowColor(1, QColorConstants::Svg::grey);
|
||||
m_LSDItem = new QTreeWidgetItem({ u""_qs, u"** [LSD] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
|
||||
m_LSDItem = new QTreeWidgetItem({ u""_s, u"** [LSD] **"_s, u""_s, u"0"_s, u""_s, u""_s, u"0"_s });
|
||||
insertTopLevelItem(2, m_LSDItem);
|
||||
setRowColor(2, QColorConstants::Svg::grey);
|
||||
|
||||
@ -573,25 +573,25 @@ void TrackerListWidget::showTrackerListMenu()
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
// Add actions
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_qs), tr("Add trackers...")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_s), tr("Add trackers...")
|
||||
, this, &TrackerListWidget::openAddTrackersDialog);
|
||||
|
||||
if (!getSelectedTrackerItems().isEmpty())
|
||||
{
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_qs),tr("Edit tracker URL...")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_s),tr("Edit tracker URL...")
|
||||
, this, &TrackerListWidget::editSelectedTracker);
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_qs, u"list-remove"_qs), tr("Remove tracker")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s, u"list-remove"_s), tr("Remove tracker")
|
||||
, this, &TrackerListWidget::deleteSelectedTrackers);
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy tracker URL")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_s), tr("Copy tracker URL")
|
||||
, this, &TrackerListWidget::copyTrackerUrl);
|
||||
}
|
||||
|
||||
if (!torrent->isPaused())
|
||||
{
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"reannounce"_qs, u"view-refresh"_qs), tr("Force reannounce to selected trackers")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"reannounce"_s, u"view-refresh"_s), tr("Force reannounce to selected trackers")
|
||||
, this, &TrackerListWidget::reannounceSelected);
|
||||
menu->addSeparator();
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"reannounce"_qs, u"view-refresh"_qs), tr("Force reannounce to all trackers")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"reannounce"_s, u"view-refresh"_s), tr("Force reannounce to all trackers")
|
||||
, this, [this]()
|
||||
{
|
||||
BitTorrent::Torrent *h = m_properties->getCurrentTorrent();
|
||||
|
@ -48,12 +48,12 @@ TrackersAdditionDialog::TrackersAdditionDialog(QWidget *parent, BitTorrent::Torr
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::TrackersAdditionDialog)
|
||||
, m_torrent(torrent)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeTrackersListURL(SETTINGS_KEY(u"TrackersListURL"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
, m_storeTrackersListURL(SETTINGS_KEY(u"TrackersListURL"_s))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->downloadButton->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_qs, u"download"_qs));
|
||||
m_ui->downloadButton->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_s, u"download"_s));
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Add"));
|
||||
|
||||
connect(m_ui->downloadButton, &QAbstractButton::clicked, this, &TrackersAdditionDialog::onDownloadButtonClicked);
|
||||
@ -108,7 +108,7 @@ void TrackersAdditionDialog::onTorrentListDownloadFinished(const Net::DownloadRe
|
||||
// Add fetched trackers to the list
|
||||
const QString existingText = m_ui->textEditTrackersList->toPlainText();
|
||||
if (!existingText.isEmpty() && !existingText.endsWith(u'\n'))
|
||||
m_ui->textEditTrackersList->insertPlainText(u"\n"_qs);
|
||||
m_ui->textEditTrackersList->insertPlainText(u"\n"_s);
|
||||
|
||||
// append the data as-is
|
||||
const auto trackers = QString::fromUtf8(result.data).trimmed();
|
||||
|
@ -102,9 +102,9 @@ void ArticleListWidget::handleArticleRead(RSS::Article *rssArticle)
|
||||
auto *item = mapRSSArticle(rssArticle);
|
||||
if (!item) return;
|
||||
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor(u"RSS.ReadArticle"_qs)};
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor(u"RSS.ReadArticle"_s)};
|
||||
item->setData(Qt::ForegroundRole, foregroundBrush);
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"loading"_qs, u"sphere"_qs));
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"loading"_s, u"sphere"_s));
|
||||
|
||||
checkInvariant();
|
||||
}
|
||||
@ -129,15 +129,15 @@ QListWidgetItem *ArticleListWidget::createItem(RSS::Article *article) const
|
||||
item->setData(Qt::UserRole, QVariant::fromValue(article));
|
||||
if (article->isRead())
|
||||
{
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor(u"RSS.ReadArticle"_qs)};
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor(u"RSS.ReadArticle"_s)};
|
||||
item->setData(Qt::ForegroundRole, foregroundBrush);
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"loading"_qs, u"sphere"_qs));
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"loading"_s, u"sphere"_s));
|
||||
}
|
||||
else
|
||||
{
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor(u"RSS.UnreadArticle"_qs)};
|
||||
const QBrush foregroundBrush {UIThemeManager::instance()->getColor(u"RSS.UnreadArticle"_s)};
|
||||
item->setData(Qt::ForegroundRole, foregroundBrush);
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"loading"_qs, u"sphere"_qs));
|
||||
item->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"loading"_s, u"sphere"_s));
|
||||
}
|
||||
|
||||
return item;
|
||||
|
@ -57,22 +57,22 @@
|
||||
#include "gui/utils.h"
|
||||
#include "ui_automatedrssdownloader.h"
|
||||
|
||||
const QString EXT_JSON = u".json"_qs;
|
||||
const QString EXT_LEGACY = u".rssrules"_qs;
|
||||
const QString EXT_JSON = u".json"_s;
|
||||
const QString EXT_LEGACY = u".rssrules"_s;
|
||||
|
||||
AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_formatFilterJSON {u"%1 (*%2)"_qs.arg(tr("Rules"), EXT_JSON)}
|
||||
, m_formatFilterLegacy {u"%1 (*%2)"_qs.arg(tr("Rules (legacy)"), EXT_LEGACY)}
|
||||
, m_formatFilterJSON {u"%1 (*%2)"_s.arg(tr("Rules"), EXT_JSON)}
|
||||
, m_formatFilterLegacy {u"%1 (*%2)"_s.arg(tr("Rules (legacy)"), EXT_LEGACY)}
|
||||
, m_ui {new Ui::AutomatedRssDownloader}
|
||||
, m_addTorrentParamsWidget {new AddTorrentParamsWidget}
|
||||
, m_storeDialogSize {u"RssFeedDownloader/geometrySize"_qs}
|
||||
, m_storeDialogSize {u"RssFeedDownloader/geometrySize"_s}
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
, m_storeMainSplitterState {u"GUI/Qt6/RSSFeedDownloader/HSplitterSizes"_qs}
|
||||
, m_storeRuleDefSplitterState {u"GUI/Qt6/RSSFeedDownloader/RuleDefSplitterState"_qs}
|
||||
, m_storeMainSplitterState {u"GUI/Qt6/RSSFeedDownloader/HSplitterSizes"_s}
|
||||
, m_storeRuleDefSplitterState {u"GUI/Qt6/RSSFeedDownloader/RuleDefSplitterState"_s}
|
||||
#else
|
||||
, m_storeMainSplitterState {u"RssFeedDownloader/qt5/hsplitterSizes"_qs}
|
||||
, m_storeRuleDefSplitterState {u"RssFeedDownloader/qt5/RuleDefSplitterState"_qs}
|
||||
, m_storeMainSplitterState {u"RssFeedDownloader/qt5/hsplitterSizes"_s}
|
||||
, m_storeRuleDefSplitterState {u"RssFeedDownloader/qt5/RuleDefSplitterState"_s}
|
||||
#endif
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
@ -88,9 +88,9 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
|
||||
connect(m_ui->renameRuleBtn, &QPushButton::clicked, this, &AutomatedRssDownloader::onRenameRuleBtnClicked);
|
||||
|
||||
// Icons
|
||||
m_ui->renameRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"edit-rename"_qs));
|
||||
m_ui->removeRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"edit-clear"_qs, u"list-remove"_qs));
|
||||
m_ui->addRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_qs));
|
||||
m_ui->renameRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"edit-rename"_s));
|
||||
m_ui->removeRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"edit-clear"_s, u"list-remove"_s));
|
||||
m_ui->addRuleBtn->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_s));
|
||||
|
||||
// Ui Settings
|
||||
m_ui->ruleList->setSortingEnabled(true);
|
||||
@ -104,7 +104,7 @@ AutomatedRssDownloader::AutomatedRssDownloader(QWidget *parent)
|
||||
connect(m_ui->checkRegex, &QAbstractButton::toggled, this, &AutomatedRssDownloader::updateFieldsToolTips);
|
||||
connect(m_ui->ruleList, &QWidget::customContextMenuRequested, this, &AutomatedRssDownloader::displayRulesListMenu);
|
||||
|
||||
m_episodeRegex = new QRegularExpression(u"^(^\\d{1,4}x(\\d{1,4}(-(\\d{1,4})?)?;){1,}){1,1}"_qs
|
||||
m_episodeRegex = new QRegularExpression(u"^(^\\d{1,4}x(\\d{1,4}(-(\\d{1,4})?)?;){1,}){1,1}"_s
|
||||
, QRegularExpression::CaseInsensitiveOption);
|
||||
const QString tip = u"<p>" + tr("Matches articles based on episode filter.") + u"</p><p><b>" + tr("Example: ")
|
||||
+ u"1x2;8-15;5;30-;</b>" + tr(" will match 2, 5, 8 through 15, 30 and onward episodes of season one", "example X will match") + u"</p>"
|
||||
@ -421,7 +421,7 @@ void AutomatedRssDownloader::onExportBtnClicked()
|
||||
QString selectedFilter {m_formatFilterJSON};
|
||||
Path path {QFileDialog::getSaveFileName(
|
||||
this, tr("Export RSS rules"), QDir::homePath()
|
||||
, u"%1;;%2"_qs.arg(m_formatFilterJSON, m_formatFilterLegacy), &selectedFilter)};
|
||||
, u"%1;;%2"_s.arg(m_formatFilterJSON, m_formatFilterLegacy), &selectedFilter)};
|
||||
|
||||
if (path.isEmpty()) return;
|
||||
|
||||
@ -457,7 +457,7 @@ void AutomatedRssDownloader::onImportBtnClicked()
|
||||
QString selectedFilter {m_formatFilterJSON};
|
||||
const Path path {QFileDialog::getOpenFileName(
|
||||
this, tr("Import RSS rules"), QDir::homePath()
|
||||
, u"%1;;%2"_qs.arg(m_formatFilterJSON, m_formatFilterLegacy), &selectedFilter)};
|
||||
, u"%1;;%2"_s.arg(m_formatFilterJSON, m_formatFilterLegacy), &selectedFilter)};
|
||||
|
||||
const int fileMaxSize = 10 * 1024 * 1024;
|
||||
const auto readResult = Utils::IO::readFile(path, fileMaxSize);
|
||||
@ -494,7 +494,7 @@ void AutomatedRssDownloader::displayRulesListMenu()
|
||||
QMenu *menu = new QMenu(this);
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_qs), tr("Add new rule...")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"list-add"_s), tr("Add new rule...")
|
||||
, this, &AutomatedRssDownloader::onAddRuleBtnClicked);
|
||||
|
||||
const QList<QListWidgetItem *> selection = m_ui->ruleList->selectedItems();
|
||||
@ -503,20 +503,20 @@ void AutomatedRssDownloader::displayRulesListMenu()
|
||||
{
|
||||
if (selection.count() == 1)
|
||||
{
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_qs, u"list-remove"_qs), tr("Delete rule")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s, u"list-remove"_s), tr("Delete rule")
|
||||
, this, &AutomatedRssDownloader::onRemoveRuleBtnClicked);
|
||||
menu->addSeparator();
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_qs), tr("Rename rule...")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-rename"_s), tr("Rename rule...")
|
||||
, this, &AutomatedRssDownloader::renameSelectedRule);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_qs, u"list-remove"_qs), tr("Delete selected rules")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s, u"list-remove"_s), tr("Delete selected rules")
|
||||
, this, &AutomatedRssDownloader::onRemoveRuleBtnClicked);
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_qs), tr("Clear downloaded episodes...")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s), tr("Clear downloaded episodes...")
|
||||
, this, &AutomatedRssDownloader::clearSelectedRuleDownloadedEpisodeList);
|
||||
}
|
||||
|
||||
@ -646,7 +646,7 @@ void AutomatedRssDownloader::addFeedArticlesToTree(RSS::Feed *feed, const QStrin
|
||||
QFont f = treeFeedItem->font(0);
|
||||
f.setBold(true);
|
||||
treeFeedItem->setFont(0, f);
|
||||
treeFeedItem->setData(0, Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"directory"_qs));
|
||||
treeFeedItem->setData(0, Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"directory"_s));
|
||||
treeFeedItem->setData(0, Qt::UserRole, feed->url());
|
||||
m_ui->matchingArticlesTree->addTopLevelItem(treeFeedItem);
|
||||
}
|
||||
@ -694,7 +694,7 @@ void AutomatedRssDownloader::updateFieldsToolTips(bool regex)
|
||||
tip += tr("An expression with an empty %1 clause (e.g. %2)",
|
||||
"We talk about regex/wildcards in the RSS filters section here."
|
||||
" So a valid sentence would be: An expression with an empty | clause (e.g. expr|)"
|
||||
).arg(u"<tt>|</tt>"_qs, u"<tt>expr|</tt>"_qs);
|
||||
).arg(u"<tt>|</tt>"_s, u"<tt>expr|</tt>"_s);
|
||||
m_ui->lineContains->setToolTip(tip + tr(" will match all articles.") + u"</p>");
|
||||
m_ui->lineNotContains->setToolTip(tip + tr(" will exclude all articles.") + u"</p>");
|
||||
}
|
||||
@ -740,8 +740,8 @@ void AutomatedRssDownloader::updateMustLineValidity()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->lineContains->setStyleSheet(u"QLineEdit { color: #ff0000; }"_qs);
|
||||
m_ui->labelMustStat->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_qs, u"task-attention"_qs).pixmap(16, 16));
|
||||
m_ui->lineContains->setStyleSheet(u"QLineEdit { color: #ff0000; }"_s);
|
||||
m_ui->labelMustStat->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_s, u"task-attention"_s).pixmap(16, 16));
|
||||
m_ui->labelMustStat->setToolTip(error);
|
||||
}
|
||||
}
|
||||
@ -787,8 +787,8 @@ void AutomatedRssDownloader::updateMustNotLineValidity()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->lineNotContains->setStyleSheet(u"QLineEdit { color: #ff0000; }"_qs);
|
||||
m_ui->labelMustNotStat->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_qs, u"task-attention"_qs).pixmap(16, 16));
|
||||
m_ui->lineNotContains->setStyleSheet(u"QLineEdit { color: #ff0000; }"_s);
|
||||
m_ui->labelMustNotStat->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_s, u"task-attention"_s).pixmap(16, 16));
|
||||
m_ui->labelMustNotStat->setToolTip(error);
|
||||
}
|
||||
}
|
||||
@ -805,8 +805,8 @@ void AutomatedRssDownloader::updateEpisodeFilterValidity()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ui->lineEFilter->setStyleSheet(u"QLineEdit { color: #ff0000; }"_qs);
|
||||
m_ui->labelEpFilterStat->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_qs, u"task-attention"_qs).pixmap(16, 16));
|
||||
m_ui->lineEFilter->setStyleSheet(u"QLineEdit { color: #ff0000; }"_s);
|
||||
m_ui->labelEpFilterStat->setPixmap(UIThemeManager::instance()->getIcon(u"dialog-warning"_s, u"task-attention"_s).pixmap(16, 16));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,11 +79,11 @@ namespace
|
||||
QIcon rssFeedIcon(const RSS::Feed *feed)
|
||||
{
|
||||
if (feed->isLoading())
|
||||
return UIThemeManager::instance()->getIcon(u"loading"_qs);
|
||||
return UIThemeManager::instance()->getIcon(u"loading"_s);
|
||||
if (feed->hasError())
|
||||
return UIThemeManager::instance()->getIcon(u"task-reject"_qs, u"unavailable"_qs);
|
||||
return UIThemeManager::instance()->getIcon(u"task-reject"_s, u"unavailable"_s);
|
||||
|
||||
return loadIcon(feed->iconPath(), u"application-rss"_qs);
|
||||
return loadIcon(feed->iconPath(), u"application-rss"_s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ FeedListWidget::FeedListWidget(QWidget *parent)
|
||||
m_unreadStickyItem->setData(0, Qt::UserRole, QVariant::fromValue(
|
||||
reinterpret_cast<intptr_t>(RSS::Session::instance()->rootFolder())));
|
||||
m_unreadStickyItem->setText(0, tr("Unread (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount()));
|
||||
m_unreadStickyItem->setData(0, Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"mail-inbox"_qs));
|
||||
m_unreadStickyItem->setData(0, Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"mail-inbox"_s));
|
||||
m_unreadStickyItem->setData(0, StickyItemTagRole, true);
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ void FeedListWidget::handleItemUnreadCountChanged(RSS::Item *rssItem)
|
||||
{
|
||||
QTreeWidgetItem *item = mapRSSItem(rssItem);
|
||||
Q_ASSERT(item);
|
||||
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_qs.arg(rssItem->name(), QString::number(rssItem->unreadCount())));
|
||||
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_s.arg(rssItem->name(), QString::number(rssItem->unreadCount())));
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ void FeedListWidget::handleItemPathChanged(RSS::Item *rssItem)
|
||||
QTreeWidgetItem *item = mapRSSItem(rssItem);
|
||||
Q_ASSERT(item);
|
||||
|
||||
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_qs.arg(rssItem->name(), QString::number(rssItem->unreadCount())));
|
||||
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_s.arg(rssItem->name(), QString::number(rssItem->unreadCount())));
|
||||
|
||||
RSS::Item *parentRssItem = RSS::Session::instance()->itemByPath(RSS::Item::parentPath(rssItem->path()));
|
||||
QTreeWidgetItem *parentItem = mapRSSItem(parentRssItem);
|
||||
@ -273,7 +273,7 @@ void FeedListWidget::dropEvent(QDropEvent *event)
|
||||
QTreeWidgetItem *FeedListWidget::createItem(RSS::Item *rssItem, QTreeWidgetItem *parentItem)
|
||||
{
|
||||
auto *item = new FeedListItem;
|
||||
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_qs.arg(rssItem->name(), QString::number(rssItem->unreadCount())));
|
||||
item->setData(0, Qt::DisplayRole, u"%1 (%2)"_s.arg(rssItem->name(), QString::number(rssItem->unreadCount())));
|
||||
item->setData(0, Qt::UserRole, QVariant::fromValue(reinterpret_cast<intptr_t>(rssItem)));
|
||||
m_rssToTreeItemMapping[rssItem] = item;
|
||||
|
||||
@ -281,7 +281,7 @@ QTreeWidgetItem *FeedListWidget::createItem(RSS::Item *rssItem, QTreeWidgetItem
|
||||
if (auto *feed = qobject_cast<RSS::Feed *>(rssItem))
|
||||
icon = rssFeedIcon(feed);
|
||||
else
|
||||
icon = UIThemeManager::instance()->getIcon(u"directory"_qs);
|
||||
icon = UIThemeManager::instance()->getIcon(u"directory"_s);
|
||||
item->setData(0, Qt::DecorationRole, icon);
|
||||
|
||||
connect(rssItem, &RSS::Item::unreadCountChanged, this, &FeedListWidget::handleItemUnreadCountChanged);
|
||||
|
@ -46,7 +46,7 @@ HtmlBrowser::HtmlBrowser(QWidget *parent)
|
||||
{
|
||||
m_netManager = new QNetworkAccessManager(this);
|
||||
m_diskCache = new QNetworkDiskCache(this);
|
||||
m_diskCache->setCacheDirectory((specialFolderLocation(SpecialFolder::Cache) / Path(u"rss"_qs)).data());
|
||||
m_diskCache->setCacheDirectory((specialFolderLocation(SpecialFolder::Cache) / Path(u"rss"_s)).data());
|
||||
m_diskCache->setMaximumCacheSize(50 * 1024 * 1024);
|
||||
qDebug() << "HtmlBrowser cache path:" << m_diskCache->cacheDirectory() << " max size:" << m_diskCache->maximumCacheSize() / 1024 / 1024 << "MB";
|
||||
m_netManager->setCache(m_diskCache);
|
||||
@ -60,7 +60,7 @@ QVariant HtmlBrowser::loadResource(int type, const QUrl &name)
|
||||
{
|
||||
QUrl url(name);
|
||||
if (url.scheme().isEmpty())
|
||||
url.setScheme(u"http"_qs);
|
||||
url.setScheme(u"http"_s);
|
||||
|
||||
QIODevice *dev = m_diskCache->data(url);
|
||||
if (dev)
|
||||
@ -104,7 +104,7 @@ void HtmlBrowser::resourceLoaded(QNetworkReply *reply)
|
||||
metaData.setUrl(reply->request().url());
|
||||
metaData.setSaveToDisk(true);
|
||||
atts[QNetworkRequest::HttpStatusCodeAttribute] = 200;
|
||||
atts[QNetworkRequest::HttpReasonPhraseAttribute] = u"Ok"_qs;
|
||||
atts[QNetworkRequest::HttpReasonPhraseAttribute] = u"Ok"_s;
|
||||
metaData.setAttributes(atts);
|
||||
metaData.setLastModified(QDateTime::currentDateTime());
|
||||
metaData.setExpirationDate(QDateTime::currentDateTime().addDays(1));
|
||||
|
@ -62,22 +62,22 @@ RSSWidget::RSSWidget(QWidget *parent)
|
||||
m_ui->setupUi(this);
|
||||
|
||||
// Icons
|
||||
m_ui->actionCopyFeedURL->setIcon(UIThemeManager::instance()->getIcon(u"edit-copy"_qs));
|
||||
m_ui->actionDelete->setIcon(UIThemeManager::instance()->getIcon(u"edit-clear"_qs));
|
||||
m_ui->actionDownloadTorrent->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_qs, u"download"_qs));
|
||||
m_ui->actionEditFeedURL->setIcon(UIThemeManager::instance()->getIcon(u"edit-rename"_qs));
|
||||
m_ui->actionMarkItemsRead->setIcon(UIThemeManager::instance()->getIcon(u"task-complete"_qs, u"mail-mark-read"_qs));
|
||||
m_ui->actionNewFolder->setIcon(UIThemeManager::instance()->getIcon(u"folder-new"_qs));
|
||||
m_ui->actionNewSubscription->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_qs));
|
||||
m_ui->actionOpenNewsURL->setIcon(UIThemeManager::instance()->getIcon(u"application-url"_qs));
|
||||
m_ui->actionRename->setIcon(UIThemeManager::instance()->getIcon(u"edit-rename"_qs));
|
||||
m_ui->actionUpdate->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_qs));
|
||||
m_ui->actionUpdateAllFeeds->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_qs));
|
||||
m_ui->actionCopyFeedURL->setIcon(UIThemeManager::instance()->getIcon(u"edit-copy"_s));
|
||||
m_ui->actionDelete->setIcon(UIThemeManager::instance()->getIcon(u"edit-clear"_s));
|
||||
m_ui->actionDownloadTorrent->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_s, u"download"_s));
|
||||
m_ui->actionEditFeedURL->setIcon(UIThemeManager::instance()->getIcon(u"edit-rename"_s));
|
||||
m_ui->actionMarkItemsRead->setIcon(UIThemeManager::instance()->getIcon(u"task-complete"_s, u"mail-mark-read"_s));
|
||||
m_ui->actionNewFolder->setIcon(UIThemeManager::instance()->getIcon(u"folder-new"_s));
|
||||
m_ui->actionNewSubscription->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_s));
|
||||
m_ui->actionOpenNewsURL->setIcon(UIThemeManager::instance()->getIcon(u"application-url"_s));
|
||||
m_ui->actionRename->setIcon(UIThemeManager::instance()->getIcon(u"edit-rename"_s));
|
||||
m_ui->actionUpdate->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_s));
|
||||
m_ui->actionUpdateAllFeeds->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_s));
|
||||
#ifndef Q_OS_MACOS
|
||||
m_ui->newFeedButton->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_qs));
|
||||
m_ui->markReadButton->setIcon(UIThemeManager::instance()->getIcon(u"task-complete"_qs, u"mail-mark-read"_qs));
|
||||
m_ui->updateAllButton->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_qs));
|
||||
m_ui->rssDownloaderBtn->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_qs, u"download"_qs));
|
||||
m_ui->newFeedButton->setIcon(UIThemeManager::instance()->getIcon(u"list-add"_s));
|
||||
m_ui->markReadButton->setIcon(UIThemeManager::instance()->getIcon(u"task-complete"_s, u"mail-mark-read"_s));
|
||||
m_ui->updateAllButton->setIcon(UIThemeManager::instance()->getIcon(u"view-refresh"_s));
|
||||
m_ui->rssDownloaderBtn->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_s, u"download"_s));
|
||||
#endif
|
||||
|
||||
m_articleListWidget = new ArticleListWidget(m_ui->splitterMain);
|
||||
@ -254,7 +254,7 @@ void RSSWidget::askNewFolder()
|
||||
const QString newFolderPath = RSS::Item::joinPath(rssDestFolder->path(), newName);
|
||||
const nonstd::expected<void, QString> result = RSS::Session::instance()->addFolder(newFolderPath);
|
||||
if (!result)
|
||||
QMessageBox::warning(this, u"qBittorrent"_qs, result.error(), QMessageBox::Ok);
|
||||
QMessageBox::warning(this, u"qBittorrent"_s, result.error(), QMessageBox::Ok);
|
||||
|
||||
// Expand destination folder to display new feed
|
||||
if (destItem && (destItem != m_feedListWidget->stickyUnreadItem()))
|
||||
@ -268,7 +268,7 @@ void RSSWidget::on_newFeedButton_clicked()
|
||||
{
|
||||
// Ask for feed URL
|
||||
const QString clipText = qApp->clipboard()->text();
|
||||
const QString defaultURL = Net::DownloadManager::hasSupportedScheme(clipText) ? clipText : u"http://"_qs;
|
||||
const QString defaultURL = Net::DownloadManager::hasSupportedScheme(clipText) ? clipText : u"http://"_s;
|
||||
|
||||
bool ok = false;
|
||||
QString newURL = AutoExpandableDialog::getText(
|
||||
@ -296,7 +296,7 @@ void RSSWidget::on_newFeedButton_clicked()
|
||||
const QString newFeedPath = RSS::Item::joinPath(rssDestFolder->path(), newURL);
|
||||
const nonstd::expected<void, QString> result = RSS::Session::instance()->addFeed(newURL, newFeedPath);
|
||||
if (!result)
|
||||
QMessageBox::warning(this, u"qBittorrent"_qs, result.error(), QMessageBox::Ok);
|
||||
QMessageBox::warning(this, u"qBittorrent"_s, result.error(), QMessageBox::Ok);
|
||||
|
||||
// Expand destination folder to display new feed
|
||||
if (destItem && (destItem != m_feedListWidget->stickyUnreadItem()))
|
||||
@ -445,7 +445,7 @@ void RSSWidget::editSelectedRSSFeedURL()
|
||||
|
||||
const nonstd::expected<void, QString> result = RSS::Session::instance()->setFeedURL(rssFeed, newURL);
|
||||
if (!result)
|
||||
QMessageBox::warning(this, u"qBittorrent"_qs, result.error(), QMessageBox::Ok);
|
||||
QMessageBox::warning(this, u"qBittorrent"_s, result.error(), QMessageBox::Ok);
|
||||
}
|
||||
|
||||
void RSSWidget::refreshSelectedItems()
|
||||
@ -512,11 +512,11 @@ void RSSWidget::handleCurrentArticleItemChanged(QListWidgetItem *currentItem, QL
|
||||
|
||||
QString html =
|
||||
u"<div style='border: 2px solid red; margin-left: 5px; margin-right: 5px; margin-bottom: 5px;'>" +
|
||||
u"<div style='background-color: \"%1\"; font-weight: bold; color: \"%2\";'>%3</div>"_qs.arg(highlightedBaseColor, highlightedBaseTextColor, article->title());
|
||||
u"<div style='background-color: \"%1\"; font-weight: bold; color: \"%2\";'>%3</div>"_s.arg(highlightedBaseColor, highlightedBaseTextColor, article->title());
|
||||
if (article->date().isValid())
|
||||
html += u"<div style='background-color: \"%1\";'><b>%2</b>%3</div>"_qs.arg(alternateBaseColor, tr("Date: "), QLocale::system().toString(article->date().toLocalTime()));
|
||||
html += u"<div style='background-color: \"%1\";'><b>%2</b>%3</div>"_s.arg(alternateBaseColor, tr("Date: "), QLocale::system().toString(article->date().toLocalTime()));
|
||||
if (!article->author().isEmpty())
|
||||
html += u"<div style='background-color: \"%1\";'><b>%2</b>%3</div>"_qs.arg(alternateBaseColor, tr("Author: "), article->author());
|
||||
html += u"<div style='background-color: \"%1\";'><b>%2</b>%3</div>"_s.arg(alternateBaseColor, tr("Author: "), article->author());
|
||||
html += u"</div>"
|
||||
u"<div style='margin-left: 5px; margin-right: 5px;'>";
|
||||
if (Qt::mightBeRichText(article->description()))
|
||||
@ -531,23 +531,23 @@ void RSSWidget::handleCurrentArticleItemChanged(QListWidgetItem *currentItem, QL
|
||||
rx.setPatternOptions(QRegularExpression::InvertedGreedinessOption
|
||||
| QRegularExpression::CaseInsensitiveOption);
|
||||
|
||||
rx.setPattern(u"\\[img\\](.+)\\[/img\\]"_qs);
|
||||
description = description.replace(rx, u"<img src=\"\\1\">"_qs);
|
||||
rx.setPattern(u"\\[img\\](.+)\\[/img\\]"_s);
|
||||
description = description.replace(rx, u"<img src=\"\\1\">"_s);
|
||||
|
||||
rx.setPattern(u"\\[url=(\")?(.+)\\1\\]"_qs);
|
||||
description = description.replace(rx, u"<a href=\"\\2\">"_qs);
|
||||
description = description.replace(u"[/url]"_qs, u"</a>"_qs, Qt::CaseInsensitive);
|
||||
rx.setPattern(u"\\[url=(\")?(.+)\\1\\]"_s);
|
||||
description = description.replace(rx, u"<a href=\"\\2\">"_s);
|
||||
description = description.replace(u"[/url]"_s, u"</a>"_s, Qt::CaseInsensitive);
|
||||
|
||||
rx.setPattern(u"\\[(/)?([bius])\\]"_qs);
|
||||
description = description.replace(rx, u"<\\1\\2>"_qs);
|
||||
rx.setPattern(u"\\[(/)?([bius])\\]"_s);
|
||||
description = description.replace(rx, u"<\\1\\2>"_s);
|
||||
|
||||
rx.setPattern(u"\\[color=(\")?(.+)\\1\\]"_qs);
|
||||
description = description.replace(rx, u"<span style=\"color:\\2\">"_qs);
|
||||
description = description.replace(u"[/color]"_qs, u"</span>"_qs, Qt::CaseInsensitive);
|
||||
rx.setPattern(u"\\[color=(\")?(.+)\\1\\]"_s);
|
||||
description = description.replace(rx, u"<span style=\"color:\\2\">"_s);
|
||||
description = description.replace(u"[/color]"_s, u"</span>"_s, Qt::CaseInsensitive);
|
||||
|
||||
rx.setPattern(u"\\[size=(\")?(.+)\\d\\1\\]"_qs);
|
||||
description = description.replace(rx, u"<span style=\"font-size:\\2px\">"_qs);
|
||||
description = description.replace(u"[/size]"_qs, u"</span>"_qs, Qt::CaseInsensitive);
|
||||
rx.setPattern(u"\\[size=(\")?(.+)\\d\\1\\]"_s);
|
||||
description = description.replace(rx, u"<span style=\"font-size:\\2px\">"_s);
|
||||
description = description.replace(u"[/size]"_s, u"</span>"_s, Qt::CaseInsensitive);
|
||||
|
||||
html += u"<pre>" + description + u"</pre>";
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ enum PluginColumns
|
||||
PluginSelectDialog::PluginSelectDialog(SearchPluginManager *pluginManager, QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::PluginSelectDialog)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
, m_pluginManager(pluginManager)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
@ -73,7 +73,7 @@ PluginSelectDialog::PluginSelectDialog(SearchPluginManager *pluginManager, QWidg
|
||||
m_ui->pluginsTree->header()->setFirstSectionMovable(true);
|
||||
m_ui->pluginsTree->header()->setSortIndicator(0, Qt::AscendingOrder);
|
||||
|
||||
m_ui->actionUninstall->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_qs));
|
||||
m_ui->actionUninstall->setIcon(UIThemeManager::instance()->getIcon(u"list-remove"_s));
|
||||
|
||||
connect(m_ui->actionEnable, &QAction::toggled, this, &PluginSelectDialog::enableSelection);
|
||||
connect(m_ui->pluginsTree, &QTreeWidget::customContextMenuRequested, this, &PluginSelectDialog::displayContextMenu);
|
||||
@ -139,7 +139,7 @@ void PluginSelectDialog::dragEnterEvent(QDragEnterEvent *event)
|
||||
qDebug("mimeData: %s", qUtf8Printable(mime));
|
||||
}
|
||||
|
||||
if (event->mimeData()->hasFormat(u"text/plain"_qs) || event->mimeData()->hasFormat(u"text/uri-list"_qs))
|
||||
if (event->mimeData()->hasFormat(u"text/plain"_s) || event->mimeData()->hasFormat(u"text/uri-list"_s))
|
||||
{
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
@ -158,12 +158,12 @@ void PluginSelectDialog::togglePluginState(QTreeWidgetItem *item, int)
|
||||
if (plugin->enabled)
|
||||
{
|
||||
item->setText(PLUGIN_STATE, tr("Yes"));
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"green"_qs);
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"green"_s);
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setText(PLUGIN_STATE, tr("No"));
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"red"_qs);
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"red"_s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ void PluginSelectDialog::on_actionUninstall_triggered()
|
||||
// Disable it instead
|
||||
m_pluginManager->enablePlugin(id, false);
|
||||
item->setText(PLUGIN_STATE, tr("No"));
|
||||
setRowColor(index, u"red"_qs);
|
||||
setRowColor(index, u"red"_s);
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,12 +229,12 @@ void PluginSelectDialog::enableSelection(bool enable)
|
||||
if (enable)
|
||||
{
|
||||
item->setText(PLUGIN_STATE, tr("Yes"));
|
||||
setRowColor(index, u"green"_qs);
|
||||
setRowColor(index, u"green"_s);
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setText(PLUGIN_STATE, tr("No"));
|
||||
setRowColor(index, u"red"_qs);
|
||||
setRowColor(index, u"red"_s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -294,12 +294,12 @@ void PluginSelectDialog::addNewPlugin(const QString &pluginName)
|
||||
if (plugin->enabled)
|
||||
{
|
||||
item->setText(PLUGIN_STATE, tr("Yes"));
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"green"_qs);
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"green"_s);
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setText(PLUGIN_STATE, tr("No"));
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"red"_qs);
|
||||
setRowColor(m_ui->pluginsTree->indexOfTopLevelItem(item), u"red"_s);
|
||||
}
|
||||
// Handle icon
|
||||
if (plugin->iconPath.exists())
|
||||
@ -356,7 +356,7 @@ void PluginSelectDialog::askForPluginUrl()
|
||||
{
|
||||
bool ok = false;
|
||||
QString clipTxt = qApp->clipboard()->text();
|
||||
auto defaultUrl = u"http://"_qs;
|
||||
auto defaultUrl = u"http://"_s;
|
||||
if (Net::DownloadManager::hasSupportedScheme(clipTxt) && clipTxt.endsWith(u".py"))
|
||||
defaultUrl = clipTxt;
|
||||
QString url = AutoExpandableDialog::getText(
|
||||
@ -415,7 +415,7 @@ void PluginSelectDialog::iconDownloadFinished(const Net::DownloadResult &result)
|
||||
PluginInfo *plugin = m_pluginManager->pluginInfo(id);
|
||||
if (!plugin) continue;
|
||||
|
||||
const QString ext = result.url.endsWith(u".ico", Qt::CaseInsensitive) ? u".ico"_qs : u".png"_qs;
|
||||
const QString ext = result.url.endsWith(u".ico", Qt::CaseInsensitive) ? u".ico"_s : u".png"_s;
|
||||
const Path iconPath = SearchPluginManager::pluginsLocation() / Path(id + ext);
|
||||
if (Utils::Fs::copyFile(filePath, iconPath))
|
||||
{
|
||||
|
@ -36,7 +36,7 @@
|
||||
PluginSourceDialog::PluginSourceDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::PluginSourceDialog)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
|
@ -56,7 +56,7 @@ SearchJobWidget::SearchJobWidget(SearchHandler *searchHandler, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_ui(new Ui::SearchJobWidget)
|
||||
, m_searchHandler(searchHandler)
|
||||
, m_nameFilteringMode(u"Search/FilteringMode"_qs)
|
||||
, m_nameFilteringMode(u"Search/FilteringMode"_s)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@ -390,22 +390,22 @@ void SearchJobWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
auto *menu = new QMenu(this);
|
||||
menu->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"download"_qs)
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"download"_s)
|
||||
, tr("Open download window"), this, [this]() { downloadTorrents(AddTorrentOption::ShowDialog); });
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"downloading"_qs, u"download"_qs)
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"downloading"_s, u"download"_s)
|
||||
, tr("Download"), this, [this]() { downloadTorrents(AddTorrentOption::SkipDialog); });
|
||||
menu->addSeparator();
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"application-url"_qs), tr("Open description page")
|
||||
menu->addAction(UIThemeManager::instance()->getIcon(u"application-url"_s), tr("Open description page")
|
||||
, this, &SearchJobWidget::openTorrentPages);
|
||||
|
||||
QMenu *copySubMenu = menu->addMenu(
|
||||
UIThemeManager::instance()->getIcon(u"edit-copy"_qs), tr("Copy"));
|
||||
UIThemeManager::instance()->getIcon(u"edit-copy"_s), tr("Copy"));
|
||||
|
||||
copySubMenu->addAction(UIThemeManager::instance()->getIcon(u"name"_qs, u"edit-copy"_qs), tr("Name")
|
||||
copySubMenu->addAction(UIThemeManager::instance()->getIcon(u"name"_s, u"edit-copy"_s), tr("Name")
|
||||
, this, &SearchJobWidget::copyTorrentNames);
|
||||
copySubMenu->addAction(UIThemeManager::instance()->getIcon(u"insert-link"_qs, u"edit-copy"_qs), tr("Download link")
|
||||
copySubMenu->addAction(UIThemeManager::instance()->getIcon(u"insert-link"_s, u"edit-copy"_s), tr("Download link")
|
||||
, this, &SearchJobWidget::copyTorrentDownloadLinks);
|
||||
copySubMenu->addAction(UIThemeManager::instance()->getIcon(u"application-url"_qs, u"edit-copy"_qs), tr("Description page URL")
|
||||
copySubMenu->addAction(UIThemeManager::instance()->getIcon(u"application-url"_s, u"edit-copy"_s), tr("Description page URL")
|
||||
, this, &SearchJobWidget::copyTorrentURLs);
|
||||
|
||||
menu->popup(event->globalPos());
|
||||
|
@ -69,14 +69,14 @@ namespace
|
||||
switch (st)
|
||||
{
|
||||
case SearchJobWidget::Status::Ongoing:
|
||||
return u"queued"_qs;
|
||||
return u"queued"_s;
|
||||
case SearchJobWidget::Status::Finished:
|
||||
return u"task-complete"_qs;
|
||||
return u"task-complete"_s;
|
||||
case SearchJobWidget::Status::Aborted:
|
||||
return u"task-reject"_qs;
|
||||
return u"task-reject"_s;
|
||||
case SearchJobWidget::Status::Error:
|
||||
case SearchJobWidget::Status::NoResults:
|
||||
return u"dialog-warning"_qs;
|
||||
return u"dialog-warning"_s;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
@ -110,8 +110,8 @@ SearchWidget::SearchWidget(IGUIApplication *app, MainWindow *mainWindow)
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
// Icons
|
||||
m_ui->searchButton->setIcon(UIThemeManager::instance()->getIcon(u"edit-find"_qs));
|
||||
m_ui->pluginsButton->setIcon(UIThemeManager::instance()->getIcon(u"plugins"_qs, u"preferences-system-network"_qs));
|
||||
m_ui->searchButton->setIcon(UIThemeManager::instance()->getIcon(u"edit-find"_s));
|
||||
m_ui->pluginsButton->setIcon(UIThemeManager::instance()->getIcon(u"plugins"_s, u"preferences-system-network"_s));
|
||||
#else
|
||||
// On macOS the icons overlap the text otherwise
|
||||
QSize iconSize = m_ui->tabWidget->iconSize();
|
||||
@ -179,7 +179,7 @@ bool SearchWidget::eventFilter(QObject *object, QEvent *event)
|
||||
void SearchWidget::fillCatCombobox()
|
||||
{
|
||||
m_ui->comboCategory->clear();
|
||||
m_ui->comboCategory->addItem(SearchPluginManager::categoryFullName(u"all"_qs), u"all"_qs);
|
||||
m_ui->comboCategory->addItem(SearchPluginManager::categoryFullName(u"all"_s), u"all"_s);
|
||||
|
||||
using QStrPair = std::pair<QString, QString>;
|
||||
QVector<QStrPair> tmpList;
|
||||
@ -200,9 +200,9 @@ void SearchWidget::fillCatCombobox()
|
||||
void SearchWidget::fillPluginComboBox()
|
||||
{
|
||||
m_ui->selectPlugin->clear();
|
||||
m_ui->selectPlugin->addItem(tr("Only enabled"), u"enabled"_qs);
|
||||
m_ui->selectPlugin->addItem(tr("All plugins"), u"all"_qs);
|
||||
m_ui->selectPlugin->addItem(tr("Select..."), u"multi"_qs);
|
||||
m_ui->selectPlugin->addItem(tr("Only enabled"), u"enabled"_s);
|
||||
m_ui->selectPlugin->addItem(tr("All plugins"), u"all"_s);
|
||||
m_ui->selectPlugin->addItem(tr("Select..."), u"multi"_s);
|
||||
|
||||
using QStrPair = std::pair<QString, QString>;
|
||||
QVector<QStrPair> tmpList;
|
||||
@ -349,7 +349,7 @@ void SearchWidget::on_searchButton_clicked()
|
||||
m_allTabs.append(newTab);
|
||||
|
||||
QString tabName = pattern;
|
||||
tabName.replace(QRegularExpression(u"&{1}"_qs), u"&&"_qs);
|
||||
tabName.replace(QRegularExpression(u"&{1}"_s), u"&&"_s);
|
||||
m_ui->tabWidget->addTab(newTab, tabName);
|
||||
m_ui->tabWidget->setCurrentWidget(newTab);
|
||||
|
||||
|
@ -52,14 +52,14 @@ namespace
|
||||
SpeedLimitDialog::SpeedLimitDialog(QWidget *parent)
|
||||
: QDialog {parent}
|
||||
, m_ui {new Ui::SpeedLimitDialog}
|
||||
, m_storeDialogSize {SETTINGS_KEY(u"Size"_qs)}
|
||||
, m_storeDialogSize {SETTINGS_KEY(u"Size"_s)}
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
m_ui->labelGlobalSpeedIcon->setPixmap(
|
||||
UIThemeManager::instance()->getScaledPixmap(u"slow_off"_qs, Utils::Gui::mediumIconSize(this).height()));
|
||||
UIThemeManager::instance()->getScaledPixmap(u"slow_off"_s, Utils::Gui::mediumIconSize(this).height()));
|
||||
m_ui->labelAltGlobalSpeedIcon->setPixmap(
|
||||
UIThemeManager::instance()->getScaledPixmap(u"slow"_qs, Utils::Gui::mediumIconSize(this).height()));
|
||||
UIThemeManager::instance()->getScaledPixmap(u"slow"_s, Utils::Gui::mediumIconSize(this).height()));
|
||||
|
||||
const auto initSlider = [](QSlider *slider, const int value, const int maximum)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@
|
||||
StatsDialog::StatsDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::StatsDialog)
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_qs))
|
||||
, m_storeDialogSize(SETTINGS_KEY(u"Size"_s))
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
@ -86,13 +86,13 @@ void StatsDialog::update()
|
||||
m_ui->labelGlobalRatio->setText(
|
||||
((atd > 0) && (atu > 0))
|
||||
? Utils::String::fromDouble(static_cast<qreal>(atu) / atd, 2)
|
||||
: u"-"_qs);
|
||||
: u"-"_s);
|
||||
#ifndef QBT_USES_LIBTORRENT2
|
||||
// Cache hits
|
||||
const qreal readRatio = cs.readRatio;
|
||||
m_ui->labelCacheHits->setText(u"%1%"_qs.arg((readRatio > 0)
|
||||
m_ui->labelCacheHits->setText(u"%1%"_s.arg((readRatio > 0)
|
||||
? Utils::String::fromDouble((100 * readRatio), 2)
|
||||
: u"0"_qs));
|
||||
: u"0"_s));
|
||||
#endif
|
||||
// Buffers size
|
||||
m_ui->labelTotalBuf->setText(Utils::Misc::friendlyUnit(cs.totalUsedBuffers * 16 * 1024));
|
||||
@ -100,12 +100,12 @@ void StatsDialog::update()
|
||||
// From lt manual: disk_write_queue and disk_read_queue are the number of peers currently waiting on a disk write or disk read
|
||||
// to complete before it receives or sends any more data on the socket. It's a metric of how disk bound you are.
|
||||
|
||||
m_ui->labelWriteStarve->setText(u"%1%"_qs.arg(((ss.diskWriteQueue > 0) && (ss.peersCount > 0))
|
||||
m_ui->labelWriteStarve->setText(u"%1%"_s.arg(((ss.diskWriteQueue > 0) && (ss.peersCount > 0))
|
||||
? Utils::String::fromDouble((100. * ss.diskWriteQueue / ss.peersCount), 2)
|
||||
: u"0"_qs));
|
||||
m_ui->labelReadStarve->setText(u"%1%"_qs.arg(((ss.diskReadQueue > 0) && (ss.peersCount > 0))
|
||||
: u"0"_s));
|
||||
m_ui->labelReadStarve->setText(u"%1%"_s.arg(((ss.diskReadQueue > 0) && (ss.peersCount > 0))
|
||||
? Utils::String::fromDouble((100. * ss.diskReadQueue / ss.peersCount), 2)
|
||||
: u"0"_qs));
|
||||
: u"0"_s));
|
||||
|
||||
// Disk queues
|
||||
m_ui->labelQueuedJobs->setText(QString::number(cs.jobQueueLength));
|
||||
|
@ -49,7 +49,7 @@ StatusBar::StatusBar(QWidget *parent)
|
||||
#ifndef Q_OS_MACOS
|
||||
// Redefining global stylesheet breaks certain elements on mac like tabs.
|
||||
// Qt checks whether the stylesheet class inherits("QMacStyle") and this becomes false.
|
||||
setStyleSheet(u"QStatusBar::item { border-width: 0; }"_qs);
|
||||
setStyleSheet(u"QStatusBar::item { border-width: 0; }"_s);
|
||||
#endif
|
||||
|
||||
BitTorrent::Session *const session = BitTorrent::Session::instance();
|
||||
@ -63,27 +63,27 @@ StatusBar::StatusBar(QWidget *parent)
|
||||
m_connecStatusLblIcon->setFlat(true);
|
||||
m_connecStatusLblIcon->setFocusPolicy(Qt::NoFocus);
|
||||
m_connecStatusLblIcon->setCursor(Qt::PointingHandCursor);
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"firewalled"_qs));
|
||||
m_connecStatusLblIcon->setToolTip(u"<b>%1</b><br><i>%2</i>"_qs.arg(tr("Connection status:")
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"firewalled"_s));
|
||||
m_connecStatusLblIcon->setToolTip(u"<b>%1</b><br><i>%2</i>"_s.arg(tr("Connection status:")
|
||||
, tr("No direct connections. This may indicate network configuration problems.")));
|
||||
connect(m_connecStatusLblIcon, &QAbstractButton::clicked, this, &StatusBar::connectionButtonClicked);
|
||||
|
||||
m_dlSpeedLbl = new QPushButton(this);
|
||||
m_dlSpeedLbl->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_qs, u"downloading_small"_qs));
|
||||
m_dlSpeedLbl->setIcon(UIThemeManager::instance()->getIcon(u"downloading"_s, u"downloading_small"_s));
|
||||
connect(m_dlSpeedLbl, &QAbstractButton::clicked, this, &StatusBar::capSpeed);
|
||||
m_dlSpeedLbl->setFlat(true);
|
||||
m_dlSpeedLbl->setFocusPolicy(Qt::NoFocus);
|
||||
m_dlSpeedLbl->setCursor(Qt::PointingHandCursor);
|
||||
m_dlSpeedLbl->setStyleSheet(u"text-align:left;"_qs);
|
||||
m_dlSpeedLbl->setStyleSheet(u"text-align:left;"_s);
|
||||
m_dlSpeedLbl->setMinimumWidth(200);
|
||||
|
||||
m_upSpeedLbl = new QPushButton(this);
|
||||
m_upSpeedLbl->setIcon(UIThemeManager::instance()->getIcon(u"upload"_qs, u"seeding"_qs));
|
||||
m_upSpeedLbl->setIcon(UIThemeManager::instance()->getIcon(u"upload"_s, u"seeding"_s));
|
||||
connect(m_upSpeedLbl, &QAbstractButton::clicked, this, &StatusBar::capSpeed);
|
||||
m_upSpeedLbl->setFlat(true);
|
||||
m_upSpeedLbl->setFocusPolicy(Qt::NoFocus);
|
||||
m_upSpeedLbl->setCursor(Qt::PointingHandCursor);
|
||||
m_upSpeedLbl->setStyleSheet(u"text-align:left;"_qs);
|
||||
m_upSpeedLbl->setStyleSheet(u"text-align:left;"_s);
|
||||
m_upSpeedLbl->setMinimumWidth(200);
|
||||
|
||||
m_DHTLbl = new QLabel(tr("DHT: %1 nodes").arg(0), this);
|
||||
@ -140,7 +140,7 @@ StatusBar::StatusBar(QWidget *parent)
|
||||
layout->addWidget(m_upSpeedLbl);
|
||||
|
||||
addPermanentWidget(container);
|
||||
setStyleSheet(u"QWidget {margin: 0;}"_qs);
|
||||
setStyleSheet(u"QWidget {margin: 0;}"_s);
|
||||
container->adjustSize();
|
||||
adjustSize();
|
||||
// Is DHT enabled
|
||||
@ -174,8 +174,8 @@ void StatusBar::updateConnectionStatus()
|
||||
|
||||
if (!BitTorrent::Session::instance()->isListening())
|
||||
{
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"disconnected"_qs));
|
||||
const QString tooltip = u"<b>%1</b><br>%2"_qs.arg(tr("Connection Status:"), tr("Offline. This usually means that qBittorrent failed to listen on the selected port for incoming connections."));
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"disconnected"_s));
|
||||
const QString tooltip = u"<b>%1</b><br>%2"_s.arg(tr("Connection Status:"), tr("Offline. This usually means that qBittorrent failed to listen on the selected port for incoming connections."));
|
||||
m_connecStatusLblIcon->setToolTip(tooltip);
|
||||
}
|
||||
else
|
||||
@ -183,14 +183,14 @@ void StatusBar::updateConnectionStatus()
|
||||
if (sessionStatus.hasIncomingConnections)
|
||||
{
|
||||
// Connection OK
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"connected"_qs));
|
||||
const QString tooltip = u"<b>%1</b><br>%2"_qs.arg(tr("Connection Status:"), tr("Online"));
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"connected"_s));
|
||||
const QString tooltip = u"<b>%1</b><br>%2"_s.arg(tr("Connection Status:"), tr("Online"));
|
||||
m_connecStatusLblIcon->setToolTip(tooltip);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"firewalled"_qs));
|
||||
const QString tooltip = u"<b>%1</b><br><i>%2</i>"_qs.arg(tr("Connection Status:"), tr("No direct connections. This may indicate network configuration problems."));
|
||||
m_connecStatusLblIcon->setIcon(UIThemeManager::instance()->getIcon(u"firewalled"_s));
|
||||
const QString tooltip = u"<b>%1</b><br><i>%2</i>"_s.arg(tr("Connection Status:"), tr("No direct connections. This may indicate network configuration problems."));
|
||||
m_connecStatusLblIcon->setToolTip(tooltip);
|
||||
}
|
||||
}
|
||||
@ -240,13 +240,13 @@ void StatusBar::updateAltSpeedsBtn(bool alternative)
|
||||
{
|
||||
if (alternative)
|
||||
{
|
||||
m_altSpeedsBtn->setIcon(UIThemeManager::instance()->getIcon(u"slow"_qs));
|
||||
m_altSpeedsBtn->setIcon(UIThemeManager::instance()->getIcon(u"slow"_s));
|
||||
m_altSpeedsBtn->setToolTip(tr("Click to switch to regular speed limits"));
|
||||
m_altSpeedsBtn->setDown(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_altSpeedsBtn->setIcon(UIThemeManager::instance()->getIcon(u"slow_off"_qs));
|
||||
m_altSpeedsBtn->setIcon(UIThemeManager::instance()->getIcon(u"slow_off"_s));
|
||||
m_altSpeedsBtn->setToolTip(tr("Click to switch to alternative speed limits"));
|
||||
m_altSpeedsBtn->setDown(false);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ namespace
|
||||
{
|
||||
public:
|
||||
UnifiedFileIconProvider()
|
||||
: m_textPlainIcon {UIThemeManager::instance()->getIcon(u"help-about"_qs, u"text-plain"_qs)}
|
||||
: m_textPlainIcon {UIThemeManager::instance()->getIcon(u"help-about"_s, u"text-plain"_s)}
|
||||
{
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ namespace
|
||||
*/
|
||||
bool doesQFileIconProviderWork()
|
||||
{
|
||||
const Path PSEUDO_UNIQUE_FILE_NAME = Utils::Fs::tempPath() / Path(u"qBittorrent-test-QFileIconProvider-845eb448-7ad5-4cdb-b764-b3f322a266a9"_qs);
|
||||
const Path PSEUDO_UNIQUE_FILE_NAME = Utils::Fs::tempPath() / Path(u"qBittorrent-test-QFileIconProvider-845eb448-7ad5-4cdb-b764-b3f322a266a9"_s);
|
||||
QFileIconProvider provider;
|
||||
const QIcon testIcon1 = provider.icon(QFileInfo((PSEUDO_UNIQUE_FILE_NAME + u".pdf").data()));
|
||||
const QIcon testIcon2 = provider.icon(QFileInfo((PSEUDO_UNIQUE_FILE_NAME + u".png").data()));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user