diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-11-30 12:39:56 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-11-30 12:39:56 +0900 |
commit | fbbe9cf4e456b0e045d43979ecd4dd620e4183fe (patch) | |
tree | 7b078588ad49a305879e115362f11fcf64027a1a /src | |
parent | 862ea634731bcc0f0b1ac38a99e7f75271ee6356 (diff) | |
download | universal-indent-gui-tqt-fbbe9cf4e456b0e045d43979ecd4dd620e4183fe.tar.gz universal-indent-gui-tqt-fbbe9cf4e456b0e045d43979ecd4dd620e4183fe.zip |
Fix parsing issue with old style uigui_uncrustify.ini. This allows universal-indent-gui-tqt to work also with the original (pre regex) indenter option file
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src')
-rw-r--r-- | src/IndentHandler.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/IndentHandler.cpp b/src/IndentHandler.cpp index f80b7c6..6056f37 100644 --- a/src/IndentHandler.cpp +++ b/src/IndentHandler.cpp @@ -1088,12 +1088,18 @@ void IndentHandler::readIndentIniFile(const TQString &iniFilePath) paramBoolean.checkBox = chkBox; TQStringList trueFalseStrings = TQStringList::split("|", m_indenterSettings->value(indenterParameter + "/TrueFalse").toString()); - paramBoolean.trueString = trueFalseStrings[0]; - paramBoolean.falseString = trueFalseStrings[1]; + if (trueFalseStrings.count() > 0) + { + paramBoolean.trueString = trueFalseStrings[0]; + paramBoolean.falseString = trueFalseStrings[1]; + } TQStringList trueFalseRegexStrings = TQStringList::split("|", m_indenterSettings->value(indenterParameter + "/TrueFalseRegex").toString()); - paramBoolean.trueRegexString = trueFalseRegexStrings[0]; - paramBoolean.falseRegexString = trueFalseRegexStrings[1]; + if (trueFalseRegexStrings.count() > 0) + { + paramBoolean.trueRegexString = trueFalseRegexStrings[0]; + paramBoolean.falseRegexString = trueFalseRegexStrings[1]; + } paramBoolean.checkBox->setChecked(m_indenterSettings->value(paramBoolean.paramName + "/ValueDefault").toBool()); m_paramBooleans.append(paramBoolean); |