mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 05:13:30 -07:00
Store enum type in settings directly
Affected settings will be migrated to new keys so nothing should break. PR #15800.
This commit is contained in:
parent
ab5605d54b
commit
e3fe66d3ec
10 changed files with 216 additions and 67 deletions
|
@ -29,6 +29,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QtContainerFwd>
|
||||
#include <QtGlobal>
|
||||
#include <QVariant>
|
||||
|
@ -40,38 +41,50 @@ class QNetworkCookie;
|
|||
class QSize;
|
||||
class QTime;
|
||||
|
||||
enum SchedulerDays
|
||||
namespace Scheduler
|
||||
{
|
||||
EVERY_DAY,
|
||||
WEEK_DAYS,
|
||||
WEEK_ENDS,
|
||||
MON,
|
||||
TUE,
|
||||
WED,
|
||||
THU,
|
||||
FRI,
|
||||
SAT,
|
||||
SUN
|
||||
};
|
||||
Q_NAMESPACE
|
||||
|
||||
namespace TrayIcon
|
||||
{
|
||||
enum Style
|
||||
enum class Days : int
|
||||
{
|
||||
NORMAL = 0,
|
||||
MONO_DARK,
|
||||
MONO_LIGHT
|
||||
EveryDay = 0,
|
||||
Weekday = 1,
|
||||
Weekend = 2,
|
||||
Monday = 3,
|
||||
Tuesday = 4,
|
||||
Wednesday = 5,
|
||||
Thursday = 6,
|
||||
Friday = 7,
|
||||
Saturday = 8,
|
||||
Sunday = 9
|
||||
};
|
||||
Q_ENUM_NS(Days)
|
||||
}
|
||||
|
||||
namespace DNS
|
||||
{
|
||||
enum Service
|
||||
Q_NAMESPACE
|
||||
|
||||
enum class Service : int
|
||||
{
|
||||
DYNDNS,
|
||||
NOIP,
|
||||
NONE = -1
|
||||
DynDNS = 0,
|
||||
NoIP = 1,
|
||||
None = -1
|
||||
};
|
||||
Q_ENUM_NS(Service)
|
||||
}
|
||||
|
||||
namespace TrayIcon
|
||||
{
|
||||
Q_NAMESPACE
|
||||
|
||||
enum class Style : int
|
||||
{
|
||||
Normal = 0,
|
||||
MonoDark = 1,
|
||||
MonoLight = 2
|
||||
};
|
||||
Q_ENUM_NS(Style)
|
||||
}
|
||||
|
||||
class Preferences : public QObject
|
||||
|
@ -161,8 +174,8 @@ public:
|
|||
void setSchedulerStartTime(const QTime &time);
|
||||
QTime getSchedulerEndTime() const;
|
||||
void setSchedulerEndTime(const QTime &time);
|
||||
SchedulerDays getSchedulerDays() const;
|
||||
void setSchedulerDays(SchedulerDays days);
|
||||
Scheduler::Days getSchedulerDays() const;
|
||||
void setSchedulerDays(Scheduler::Days days);
|
||||
|
||||
// Search
|
||||
bool isSearchEnabled() const;
|
||||
|
@ -236,7 +249,7 @@ public:
|
|||
bool isDynDNSEnabled() const;
|
||||
void setDynDNSEnabled(bool enabled);
|
||||
DNS::Service getDynDNSService() const;
|
||||
void setDynDNSService(int service);
|
||||
void setDynDNSService(DNS::Service service);
|
||||
QString getDynDomainName() const;
|
||||
void setDynDomainName(const QString &name);
|
||||
QString getDynDNSUsername() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue