Browse Source

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.
Richard Stanway 6 years ago
parent
commit
15770712a8
2 changed files with 2 additions and 2 deletions
  1. 1 1
      UI/window-namedialog.cpp
  2. 1 1
      UI/window-namedialog.hpp

+ 1 - 1
UI/window-namedialog.cpp

@@ -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);

+ 1 - 1
UI/window-namedialog.hpp

@@ -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);
 };