mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 09:13:08 -07:00
Follow project coding style. Issue #2192.
This commit is contained in:
parent
2eb3ec1a6e
commit
ef63202be2
1 changed files with 17 additions and 9 deletions
|
@ -59,7 +59,9 @@
|
||||||
|
|
||||||
Preferences *Preferences::m_instance = 0;
|
Preferences *Preferences::m_instance = 0;
|
||||||
|
|
||||||
Preferences::Preferences() {}
|
Preferences::Preferences()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Preferences *Preferences::instance()
|
Preferences *Preferences::instance()
|
||||||
{
|
{
|
||||||
|
@ -193,6 +195,7 @@ void Preferences::setCloseToTray(bool b)
|
||||||
{
|
{
|
||||||
setValue("Preferences/General/CloseToTray", b);
|
setValue("Preferences/General/CloseToTray", b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool Preferences::isToolbarDisplayed() const
|
bool Preferences::isToolbarDisplayed() const
|
||||||
|
@ -264,6 +267,7 @@ void Preferences::setWinStartup(bool b)
|
||||||
settings.remove("qBittorrent");
|
settings.remove("qBittorrent");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Downloads
|
// Downloads
|
||||||
|
@ -740,6 +744,7 @@ void Preferences::useSystemIconTheme(bool enabled)
|
||||||
{
|
{
|
||||||
setValue("Preferences/Advanced/useSystemIconTheme", enabled);
|
setValue("Preferences/Advanced/useSystemIconTheme", enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool Preferences::recursiveDownloadDisabled() const
|
bool Preferences::recursiveDownloadDisabled() const
|
||||||
|
@ -753,7 +758,8 @@ void Preferences::disableRecursiveDownload(bool disable)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
namespace {
|
namespace
|
||||||
|
{
|
||||||
enum REG_SEARCH_TYPE
|
enum REG_SEARCH_TYPE
|
||||||
{
|
{
|
||||||
USER,
|
USER,
|
||||||
|
@ -872,7 +878,6 @@ namespace {
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Preferences::getPythonPath()
|
QString Preferences::getPythonPath()
|
||||||
|
@ -978,6 +983,7 @@ void Preferences::setMagnetLinkAssoc(bool set)
|
||||||
|
|
||||||
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
|
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
|
@ -1034,6 +1040,7 @@ void Preferences::setMagnetLinkAssoc()
|
||||||
CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
CFStringRef myBundleId = CFBundleGetIdentifier(CFBundleGetMainBundle());
|
||||||
LSSetDefaultHandlerForURLScheme(magnetUrlScheme, myBundleId);
|
LSSetDefaultHandlerForURLScheme(magnetUrlScheme, myBundleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int Preferences::getTrackerPort() const
|
int Preferences::getTrackerPort() const
|
||||||
|
@ -1056,6 +1063,7 @@ void Preferences::setUpdateCheckEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
setValue("Preferences/Advanced/updateCheck", enabled);
|
setValue("Preferences/Advanced/updateCheck", enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool Preferences::confirmTorrentDeletion() const
|
bool Preferences::confirmTorrentDeletion() const
|
||||||
|
@ -1098,6 +1106,7 @@ void Preferences::setTrayIconStyle(TrayIcon::Style style)
|
||||||
{
|
{
|
||||||
setValue("Preferences/Advanced/TrayIconStyle", style);
|
setValue("Preferences/Advanced/TrayIconStyle", style);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Stuff that don't appear in the Options GUI but are saved
|
// Stuff that don't appear in the Options GUI but are saved
|
||||||
|
@ -1459,10 +1468,9 @@ void Preferences::upgrade()
|
||||||
QStringList labels = value("TransferListFilters/customLabels").toStringList();
|
QStringList labels = value("TransferListFilters/customLabels").toStringList();
|
||||||
if (!labels.isEmpty()) {
|
if (!labels.isEmpty()) {
|
||||||
QVariantMap categories = value("BitTorrent/Session/Categories").toMap();
|
QVariantMap categories = value("BitTorrent/Session/Categories").toMap();
|
||||||
foreach (const QString &label, labels) {
|
foreach (const QString &label, labels)
|
||||||
if (!categories.contains(label))
|
if (!categories.contains(label))
|
||||||
categories[label] = "";
|
categories[label] = "";
|
||||||
}
|
|
||||||
setValue("BitTorrent/Session/Categories", categories);
|
setValue("BitTorrent/Session/Categories", categories);
|
||||||
SettingsStorage::instance()->removeValue("TransferListFilters/customLabels");
|
SettingsStorage::instance()->removeValue("TransferListFilters/customLabels");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue