aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/instanceview/InstanceDelegate.cpp
diff options
context:
space:
mode:
authorEzekiel Smith <ezekielsmith@protonmail.com>2022-03-21 01:04:40 +1100
committerSefa Eyeoglu <contact@scrumplex.net>2022-03-22 20:11:15 +0100
commit58957122b9dd2a19a0504efe8944cfb50e29a012 (patch)
tree53ff598dc4124d716c409d9e3786294616603add /launcher/ui/instanceview/InstanceDelegate.cpp
parent8b46658b05b3c85aab24183931583fbaaea6a228 (diff)
downloadPrismLauncher-58957122b9dd2a19a0504efe8944cfb50e29a012.tar.gz
PrismLauncher-58957122b9dd2a19a0504efe8944cfb50e29a012.tar.bz2
PrismLauncher-58957122b9dd2a19a0504efe8944cfb50e29a012.zip
Merge pull request #306 from Scrumplex/limit-instance-lengths
Limit instance names to 128 chars
Diffstat (limited to 'launcher/ui/instanceview/InstanceDelegate.cpp')
-rw-r--r--launcher/ui/instanceview/InstanceDelegate.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/launcher/ui/instanceview/InstanceDelegate.cpp b/launcher/ui/instanceview/InstanceDelegate.cpp
index 3c4ca63f..22ff78cd 100644
--- a/launcher/ui/instanceview/InstanceDelegate.cpp
+++ b/launcher/ui/instanceview/InstanceDelegate.cpp
@@ -405,6 +405,8 @@ void ListViewDelegate::setModelData(QWidget* editor, QAbstractItemModel* model,
QString text = realeditor->toPlainText();
text.replace(QChar('\n'), QChar(' '));
text = text.trimmed();
+ // Prevent instance names longer than 128 chars
+ text.truncate(128);
if(text.size() != 0)
{
model->setData(index, text);