UI: Set default maximum name length to 170 characters

As the names entered into this dialog can be used as part of file names
(for example, saving a scene collection), allowing long names can result
in silent data loss where OBS creates the collection and allows the user
to manipulate it, but it cannot be saved on exit. This is due to the
MAX_PATH limitation on Windows (260 characters). 170 was chosen to
accomodate the length of the user app data folder plus some room for
extensions like .json.tmp.
master
Richard Stanway 2019-07-18 16:11:34 +02:00
parent dd3ed096f8
commit 15770712a8
No known key found for this signature in database
GPG Key ID: AAC1E5265D71B3FD
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ bool NameDialog::AskForName(QWidget *parent, const QString &title,
const QString &placeHolder, int maxSize)
{
if (maxSize <= 0 || maxSize > 32767)
maxSize = 256;
maxSize = 170;
NameDialog dialog(parent);
dialog.setWindowTitle(title);

View File

@ -35,5 +35,5 @@ public:
static bool AskForName(QWidget *parent, const QString &title,
const QString &text, std::string &str,
const QString &placeHolder = QString(""),
int maxSize = 256);
int maxSize = 170);
};