summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-14 16:36:30 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-05-14 16:36:30 +0300
commitb3bb0531de9033bbb5940ac9418d6b158bf08a39 (patch)
treea0751d24269c483f63be9520f813c4eda9a67c4b /include
parentUse QSharedPointer to manage TimelineViews and RoomInfoListItems (diff)
downloadnheko-b3bb0531de9033bbb5940ac9418d6b158bf08a39.tar.xz
Make InputValidator class members static
Diffstat (limited to 'include')
-rw-r--r--include/InputValidator.h29
-rw-r--r--include/LoginPage.h3
-rw-r--r--include/RegisterPage.h3
3 files changed, 7 insertions, 28 deletions
diff --git a/include/InputValidator.h b/include/InputValidator.h

index feeaf70a..347ded9b 100644 --- a/include/InputValidator.h +++ b/include/InputValidator.h
@@ -15,8 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef MATRIXIDVALIDATOR_H -#define MATRIXIDVALIDATOR_H +#ifndef MATRIX_INPUT_VALIDATOR_H +#define MATRIX_INPUT_VALIDATOR_H #include <QRegExp> #include <QRegExpValidator> @@ -24,26 +24,11 @@ class InputValidator { public: - InputValidator(QObject *parent = 0); - // Validators for the different types of input. - QRegExpValidator *id_; - QRegExpValidator *localpart_; - QRegExpValidator *password_; - QRegExpValidator *domain_; - -private: - // Regular expression used to validate the whole matrix id. - const QRegExp matrix_id_; - - // Regular expressino to validate the matrix localpart. - const QRegExp matrix_localpart_; - - // Regular expression to validate a password for a matrix account. - const QRegExp matrix_password_; - - // Regular expression to validate a domain name. - const QRegExp server_domain_; + static QRegExpValidator Id; + static QRegExpValidator Localpart; + static QRegExpValidator Password; + static QRegExpValidator Domain; }; -#endif // MATRIXIDVALIDATOR_H +#endif // MATRIX_INPUT_VALIDATOR_H diff --git a/include/LoginPage.h b/include/LoginPage.h
index 8a44ef7a..ccd40072 100644 --- a/include/LoginPage.h +++ b/include/LoginPage.h
@@ -25,7 +25,6 @@ #include <QWidget> #include "FlatButton.h" -#include "InputValidator.h" #include "LoginSettings.h" #include "MatrixClient.h" #include "OverlayModal.h" @@ -84,8 +83,6 @@ private: LoginSettings *login_settings_; QString custom_domain_; - InputValidator *matrix_id_validator_; - // Matrix client API provider. QSharedPointer<MatrixClient> client_; }; diff --git a/include/RegisterPage.h b/include/RegisterPage.h
index 578ff902..9ac550bf 100644 --- a/include/RegisterPage.h +++ b/include/RegisterPage.h
@@ -26,7 +26,6 @@ #include "Avatar.h" #include "FlatButton.h" -#include "InputValidator.h" #include "MatrixClient.h" #include "RaisedButton.h" #include "TextField.h" @@ -71,8 +70,6 @@ private: TextField *password_confirmation_; TextField *server_input_; - InputValidator *validator_; - // Matrix client API provider. QSharedPointer<MatrixClient> client_; };