Browse Source

UI: Initialize max length of LineEditAutoResize in constructor

LineEditAutoResize didn't have its maxLength initialized in the
constructor, leaving it to be a random value until set via setMaxLength.
The one place where LineEditAutoResize was used immediately set this
after calling the constructor, but if we use this anywhere else in the
future it makes sense to have this initialized.
As it is meant to mostly behave like a QLineEdit, lets use the same
default value of 32767.

Detected by PVS-Studio.
gxalpha 1 năm trước cách đây
mục cha
commit
f462ffb224
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      UI/lineedit-autoresize.cpp

+ 1 - 1
UI/lineedit-autoresize.cpp

@@ -1,6 +1,6 @@
 #include "lineedit-autoresize.hpp"
 
-LineEditAutoResize::LineEditAutoResize()
+LineEditAutoResize::LineEditAutoResize() : m_maxLength(32767)
 {
 	connect(this, &LineEditAutoResize::textChanged, this,
 		&LineEditAutoResize::checkTextLength);