| 124 | } |
| 125 | |
| 126 | QString SimpleCommitForm::extendedDescription(int wrapAtColumn) const |
| 127 | { |
| 128 | if (wrapAtColumn <= 0) |
| 129 | return m_messageEdit->toPlainText(); |
| 130 | int currentLineLen = 0; |
| 131 | QString ret; |
| 132 | for(const auto c: m_messageEdit->toPlainText()) { |
| 133 | if (c == QLatin1Char('\n')) { |
| 134 | ret += QLatin1Char('\n'); |
| 135 | currentLineLen = 0; |
| 136 | } else if (currentLineLen > wrapAtColumn && c.isSpace()) { |
| 137 | ret += QLatin1Char('\n'); |
| 138 | currentLineLen = 0; |
| 139 | } else { |
| 140 | ret += c; |
| 141 | currentLineLen++; |
| 142 | } |
| 143 | } |
| 144 | return ret; |
| 145 | } |
| 146 | |
| 147 | void SimpleCommitForm::setExtendedDescription(const QString& txt) |
| 148 | { |