mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
Make use of QStringLiteral
Only changed instances that are initialized at program start.
This commit is contained in:
parent
fcbcf4039b
commit
ceaf755ac6
@ -93,7 +93,7 @@ namespace
|
|||||||
#define SETTINGS_KEY(name) "Application/" name
|
#define SETTINGS_KEY(name) "Application/" name
|
||||||
|
|
||||||
// FileLogger properties keys
|
// FileLogger properties keys
|
||||||
#define FILELOGGER_SETTINGS_KEY(name) SETTINGS_KEY("FileLogger/") name
|
#define FILELOGGER_SETTINGS_KEY(name) QStringLiteral(SETTINGS_KEY("FileLogger/") name)
|
||||||
const QString KEY_FILELOGGER_ENABLED = FILELOGGER_SETTINGS_KEY("Enabled");
|
const QString KEY_FILELOGGER_ENABLED = FILELOGGER_SETTINGS_KEY("Enabled");
|
||||||
const QString KEY_FILELOGGER_PATH = FILELOGGER_SETTINGS_KEY("Path");
|
const QString KEY_FILELOGGER_PATH = FILELOGGER_SETTINGS_KEY("Path");
|
||||||
const QString KEY_FILELOGGER_BACKUP = FILELOGGER_SETTINGS_KEY("Backup");
|
const QString KEY_FILELOGGER_BACKUP = FILELOGGER_SETTINGS_KEY("Backup");
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
#include "session.h"
|
#include "session.h"
|
||||||
#include "trackerentry.h"
|
#include "trackerentry.h"
|
||||||
|
|
||||||
const QString QB_EXT {".!qB"};
|
const QString QB_EXT {QStringLiteral(".!qB")};
|
||||||
|
|
||||||
namespace libt = libtorrent;
|
namespace libt = libtorrent;
|
||||||
using namespace BitTorrent;
|
using namespace BitTorrent;
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "base/logger.h"
|
#include "base/logger.h"
|
||||||
#include "base/settingsstorage.h"
|
#include "base/settingsstorage.h"
|
||||||
|
|
||||||
static const QString KEY_ENABLED = QLatin1String("Network/PortForwardingEnabled");
|
static const QString KEY_ENABLED = QStringLiteral("Network/PortForwardingEnabled");
|
||||||
|
|
||||||
namespace libt = libtorrent;
|
namespace libt = libtorrent;
|
||||||
using namespace Net;
|
using namespace Net;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "base/settingsstorage.h"
|
#include "base/settingsstorage.h"
|
||||||
|
|
||||||
#define SETTINGS_KEY(name) "Network/Proxy/" name
|
#define SETTINGS_KEY(name) QStringLiteral("Network/Proxy/" name)
|
||||||
const QString KEY_ONLY_FOR_TORRENTS = SETTINGS_KEY("OnlyForTorrents");
|
const QString KEY_ONLY_FOR_TORRENTS = SETTINGS_KEY("OnlyForTorrents");
|
||||||
const QString KEY_TYPE = SETTINGS_KEY("Type");
|
const QString KEY_TYPE = SETTINGS_KEY("Type");
|
||||||
const QString KEY_IP = SETTINGS_KEY("IP");
|
const QString KEY_IP = SETTINGS_KEY("IP");
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
#define SETTINGS_KEY(name) "AddNewTorrentDialog/" name
|
#define SETTINGS_KEY(name) QStringLiteral("AddNewTorrentDialog/" name)
|
||||||
const QString KEY_ENABLED = SETTINGS_KEY("Enabled");
|
const QString KEY_ENABLED = SETTINGS_KEY("Enabled");
|
||||||
const QString KEY_DEFAULTCATEGORY = SETTINGS_KEY("DefaultCategory");
|
const QString KEY_DEFAULTCATEGORY = SETTINGS_KEY("DefaultCategory");
|
||||||
const QString KEY_TREEHEADERSTATE = SETTINGS_KEY("TreeHeaderState");
|
const QString KEY_TREEHEADERSTATE = SETTINGS_KEY("TreeHeaderState");
|
||||||
@ -69,7 +69,7 @@ namespace
|
|||||||
const QString KEY_EXPANDED = SETTINGS_KEY("Expanded");
|
const QString KEY_EXPANDED = SETTINGS_KEY("Expanded");
|
||||||
const QString KEY_TOPLEVEL = SETTINGS_KEY("TopLevel");
|
const QString KEY_TOPLEVEL = SETTINGS_KEY("TopLevel");
|
||||||
const QString KEY_SAVEPATHHISTORY = SETTINGS_KEY("SavePathHistory");
|
const QString KEY_SAVEPATHHISTORY = SETTINGS_KEY("SavePathHistory");
|
||||||
const char KEY_SAVEPATHHISTORYLENGTH[] = SETTINGS_KEY("SavePathHistoryLength");
|
const QString KEY_SAVEPATHHISTORYLENGTH = SETTINGS_KEY("SavePathHistoryLength");
|
||||||
const QString KEY_REMEMBERLASTSAVEPATH = SETTINGS_KEY("RememberLastSavePath");
|
const QString KEY_REMEMBERLASTSAVEPATH = SETTINGS_KEY("RememberLastSavePath");
|
||||||
|
|
||||||
// just a shortcut
|
// just a shortcut
|
||||||
@ -204,7 +204,7 @@ void AddNewTorrentDialog::setSavePathHistoryLength(int value)
|
|||||||
CachedSettingValue<int> &AddNewTorrentDialog::savePathHistoryLengthSetting()
|
CachedSettingValue<int> &AddNewTorrentDialog::savePathHistoryLengthSetting()
|
||||||
{
|
{
|
||||||
const int defaultHistoryLength = 8;
|
const int defaultHistoryLength = 8;
|
||||||
static CachedSettingValue<int> setting(KEY_SAVEPATHHISTORYLENGTH, defaultHistoryLength,
|
static CachedSettingValue<int> setting(KEY_SAVEPATHHISTORYLENGTH.toUtf8().constData(), defaultHistoryLength,
|
||||||
[](int v)
|
[](int v)
|
||||||
{
|
{
|
||||||
return std::max(minPathHistoryLength, std::min(maxPathHistoryLength, v));
|
return std::max(minPathHistoryLength, std::min(maxPathHistoryLength, v));
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "ui_cookiesdialog.h"
|
#include "ui_cookiesdialog.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#define SETTINGS_KEY(name) "CookiesDialog/" name
|
#define SETTINGS_KEY(name) QStringLiteral("CookiesDialog/" name)
|
||||||
const QString KEY_SIZE = SETTINGS_KEY("Size");
|
const QString KEY_SIZE = SETTINGS_KEY("Size");
|
||||||
const QString KEY_COOKIESVIEWSTATE = SETTINGS_KEY("CookiesViewState");
|
const QString KEY_COOKIESVIEWSTATE = SETTINGS_KEY("CookiesViewState");
|
||||||
|
|
||||||
|
@ -121,12 +121,12 @@ namespace
|
|||||||
#define SETTINGS_KEY(name) "GUI/" name
|
#define SETTINGS_KEY(name) "GUI/" name
|
||||||
|
|
||||||
// ExecutionLog properties keys
|
// ExecutionLog properties keys
|
||||||
#define EXECUTIONLOG_SETTINGS_KEY(name) SETTINGS_KEY("Log/") name
|
#define EXECUTIONLOG_SETTINGS_KEY(name) QStringLiteral(SETTINGS_KEY("Log/") name)
|
||||||
const QString KEY_EXECUTIONLOG_ENABLED = EXECUTIONLOG_SETTINGS_KEY("Enabled");
|
const QString KEY_EXECUTIONLOG_ENABLED = EXECUTIONLOG_SETTINGS_KEY("Enabled");
|
||||||
const QString KEY_EXECUTIONLOG_TYPES = EXECUTIONLOG_SETTINGS_KEY("Types");
|
const QString KEY_EXECUTIONLOG_TYPES = EXECUTIONLOG_SETTINGS_KEY("Types");
|
||||||
|
|
||||||
// Notifications properties keys
|
// Notifications properties keys
|
||||||
#define NOTIFICATIONS_SETTINGS_KEY(name) SETTINGS_KEY("Notifications/") name
|
#define NOTIFICATIONS_SETTINGS_KEY(name) QStringLiteral(SETTINGS_KEY("Notifications/") name)
|
||||||
const QString KEY_NOTIFICATIONS_ENABLED = NOTIFICATIONS_SETTINGS_KEY("Enabled");
|
const QString KEY_NOTIFICATIONS_ENABLED = NOTIFICATIONS_SETTINGS_KEY("Enabled");
|
||||||
const QString KEY_NOTIFICATIONS_TORRENTADDED = NOTIFICATIONS_SETTINGS_KEY("TorrentAdded");
|
const QString KEY_NOTIFICATIONS_TORRENTADDED = NOTIFICATIONS_SETTINGS_KEY("TorrentAdded");
|
||||||
|
|
||||||
|
@ -41,14 +41,14 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const QString RSS_URL("https://www.fosshub.com/software/feedqBittorent");
|
const QString RSS_URL {QStringLiteral("https://www.fosshub.com/software/feedqBittorent")};
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
const QString OS_TYPE("Mac OS X");
|
const QString OS_TYPE {QStringLiteral("Mac OS X")};
|
||||||
#elif defined(Q_OS_WIN) && (defined(__x86_64__) || defined(_M_X64))
|
#elif defined(Q_OS_WIN) && (defined(__x86_64__) || defined(_M_X64))
|
||||||
const QString OS_TYPE("Windows x64");
|
const QString OS_TYPE {QStringLiteral("Windows x64")};
|
||||||
#else
|
#else
|
||||||
const QString OS_TYPE("Windows");
|
const QString OS_TYPE {QStringLiteral("Windows")};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString getStringValue(QXmlStreamReader &xml);
|
QString getStringValue(QXmlStreamReader &xml);
|
||||||
|
@ -68,12 +68,12 @@
|
|||||||
|
|
||||||
constexpr int MAX_ALLOWED_FILESIZE = 10 * 1024 * 1024;
|
constexpr int MAX_ALLOWED_FILESIZE = 10 * 1024 * 1024;
|
||||||
|
|
||||||
const QString PATH_PREFIX_IMAGES {"/images/"};
|
const QString PATH_PREFIX_IMAGES {QStringLiteral("/images/")};
|
||||||
const QString PATH_PREFIX_THEME {"/theme/"};
|
const QString PATH_PREFIX_THEME {QStringLiteral("/theme/")};
|
||||||
const QString WWW_FOLDER {":/www"};
|
const QString WWW_FOLDER {QStringLiteral(":/www")};
|
||||||
const QString PUBLIC_FOLDER {"/public"};
|
const QString PUBLIC_FOLDER {QStringLiteral("/public")};
|
||||||
const QString PRIVATE_FOLDER {"/private"};
|
const QString PRIVATE_FOLDER {QStringLiteral("/private")};
|
||||||
const QString MAX_AGE_MONTH {"public, max-age=2592000"};
|
const QString MAX_AGE_MONTH {QStringLiteral("public, max-age=2592000")};
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user