Explorar o código

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 %!s(int64=6) %!d(string=hai) anos
pai
achega
15770712a8
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  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);
 };
 };