mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-24 23:08:07 -05:00
Make cleaning of user input optional
This commit is contained in:
parent
80334088d0
commit
92711c5798
|
|
@ -16,7 +16,7 @@ public:
|
|||
static bool AskForName(QWidget *parent, const QString &title,
|
||||
const QString &text, std::string &userTextInput,
|
||||
const QString &placeHolder = QString(""),
|
||||
int maxSize = 170);
|
||||
int maxSize = 170, bool clean = true);
|
||||
|
||||
private:
|
||||
QLabel *label;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ static void CleanWhitespace(std::string &str)
|
|||
bool AdvSSNameDialog::AskForName(QWidget *parent, const QString &title,
|
||||
const QString &text,
|
||||
std::string &userTextInput,
|
||||
const QString &placeHolder, int maxSize)
|
||||
const QString &placeHolder, int maxSize,
|
||||
bool clean)
|
||||
{
|
||||
if (maxSize <= 0 || maxSize > 32767) {
|
||||
maxSize = 170;
|
||||
|
|
@ -61,6 +62,8 @@ bool AdvSSNameDialog::AskForName(QWidget *parent, const QString &title,
|
|||
return false;
|
||||
}
|
||||
userTextInput = dialog.userText->text().toUtf8().constData();
|
||||
CleanWhitespace(userTextInput);
|
||||
if (clean) {
|
||||
CleanWhitespace(userTextInput);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user