VCS Submit: Run check script in repository, do not front-trim message.

Make checkscript a bit more verbose.

Task-number: QTCREATORBUG-451
Task-number: QTCREATORBUG-422
This commit is contained in:
Friedemann Kleint
2009-12-14 10:56:50 +01:00
parent bad8a15f3b
commit 0af3c1f13a
9 changed files with 68 additions and 12 deletions

View File

@@ -221,12 +221,20 @@ void SubmitEditorWidget::unregisterActions(QAction *editorUndoAction, QAction *
}
}
// Make sure we have one terminating NL
static inline QString trimMessageText(const QString &t)
// Make sure we have one terminating NL. Do not trim front as leading space might be
// required for some formattings.
static inline QString trimMessageText(QString t)
{
QString rc = t.trimmed();
rc += QLatin1Char('\n');
return rc;
if (t.isEmpty())
return t;
// Trim back of string.
const int last = t.size() - 1;
int lastWordCharacter = last;
for ( ; lastWordCharacter >= 0 && t.at(lastWordCharacter).isSpace() ; lastWordCharacter--) ;
if (lastWordCharacter != last)
t.truncate(lastWordCharacter + 1);
t += QLatin1Char('\n');
return t;
}
// Extract the wrapped text from a text edit, which performs