瀏覽代碼

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 年之前
父節點
當前提交
15770712a8
共有 2 個文件被更改,包括 2 次插入2 次删除
  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)
 			    const QString &placeHolder, int maxSize)
 {
 {
 	if (maxSize <= 0 || maxSize > 32767)
 	if (maxSize <= 0 || maxSize > 32767)
-		maxSize = 256;
+		maxSize = 170;
 
 
 	NameDialog dialog(parent);
 	NameDialog dialog(parent);
 	dialog.setWindowTitle(title);
 	dialog.setWindowTitle(title);

+ 1 - 1
UI/window-namedialog.hpp

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