Changeset View
Changeset View
Standalone View
Standalone View
src/ruqolacore/rocketchataccountsettings.h
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 36 | public: | |||
---|---|---|---|---|---|
52 | Q_REQUIRED_RESULT QString cacheBasePath(); | 52 | Q_REQUIRED_RESULT QString cacheBasePath(); | ||
53 | 53 | | |||
54 | Q_REQUIRED_RESULT QString userName() const; | 54 | Q_REQUIRED_RESULT QString userName() const; | ||
55 | void setUserName(const QString &userName); | 55 | void setUserName(const QString &userName); | ||
56 | 56 | | |||
57 | Q_REQUIRED_RESULT QString password() const; | 57 | Q_REQUIRED_RESULT QString password() const; | ||
58 | void setPassword(const QString &password); | 58 | void setPassword(const QString &password); | ||
59 | 59 | | |||
60 | Q_REQUIRED_RESULT QString twoFactorAuthenticationCode() const; | ||||
61 | void setTwoFactorAuthenticationCode(const QString &twoFactorAuthenticationCode); | ||||
62 | | ||||
60 | void removeSettings(); | 63 | void removeSettings(); | ||
61 | 64 | | |||
62 | Q_REQUIRED_RESULT bool showUnreadOnTop() const; | 65 | Q_REQUIRED_RESULT bool showUnreadOnTop() const; | ||
63 | bool setShowUnreadOnTop(bool showUnreadOnTop); | 66 | bool setShowUnreadOnTop(bool showUnreadOnTop); | ||
64 | 67 | | |||
65 | Q_REQUIRED_RESULT qint64 expireToken() const; | 68 | Q_REQUIRED_RESULT qint64 expireToken() const; | ||
66 | void setExpireToken(const qint64 &expireToken); | 69 | void setExpireToken(const qint64 &expireToken); | ||
67 | 70 | | |||
68 | Q_REQUIRED_RESULT bool tokenExpired() const; | 71 | Q_REQUIRED_RESULT bool tokenExpired() const; | ||
69 | 72 | | |||
70 | Q_SIGNALS: | 73 | Q_SIGNALS: | ||
71 | void serverURLChanged(); | 74 | void serverURLChanged(); | ||
72 | void userNameChanged(); | 75 | void userNameChanged(); | ||
73 | void userIDChanged(); | 76 | void userIDChanged(); | ||
74 | void accountNameChanged(); | 77 | void accountNameChanged(); | ||
75 | void passwordChanged(); | 78 | void passwordChanged(); | ||
79 | void twoFactorAuthenticationCodeChanged(); | ||||
76 | 80 | | |||
77 | private: | 81 | private: | ||
78 | Q_DISABLE_COPY(RocketChatAccountSettings) | 82 | Q_DISABLE_COPY(RocketChatAccountSettings) | ||
79 | void initializeSettings(const QString &accountFileName); | 83 | void initializeSettings(const QString &accountFileName); | ||
80 | void slotPasswordRead(QKeychain::Job *job); | 84 | void slotPasswordRead(QKeychain::Job *job); | ||
81 | void slotPasswordWritten(QKeychain::Job *job); | 85 | void slotPasswordWritten(QKeychain::Job *job); | ||
82 | 86 | | |||
83 | QString mUserId; | 87 | QString mUserId; | ||
84 | QString mAuthToken; | 88 | QString mAuthToken; | ||
85 | QString mServerUrl; | 89 | QString mServerUrl; | ||
86 | QString mAccountName; | 90 | QString mAccountName; | ||
87 | QString mCachePath; | 91 | QString mCachePath; | ||
88 | QString mUserName; | 92 | QString mUserName; | ||
89 | QString mPassword; | 93 | QString mPassword; | ||
94 | QString mTwoFactorAuthenticationCode; | ||||
90 | qint64 mExpireToken = -1; | 95 | qint64 mExpireToken = -1; | ||
91 | QSettings *mSetting = nullptr; | 96 | QSettings *mSetting = nullptr; | ||
92 | bool mShowUnreadOnTop = false; | 97 | bool mShowUnreadOnTop = false; | ||
93 | }; | 98 | }; | ||
94 | 99 | | |||
95 | #endif // ROCKETCHATACCOUNTSETTINGS_H | 100 | #endif // ROCKETCHATACCOUNTSETTINGS_H |