forked from qt-creator/qt-creator
Git: De-noise
* Remove QLatin1{String|Char} where possible
* Use initializer lists for QStringList
Change-Id: I8479f87f4fc909b5d74d854956885564209538e4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
539e33da02
commit
516161c875
@@ -51,7 +51,7 @@ GitSubmitEditorWidget::GitSubmitEditorWidget() :
|
||||
m_gitSubmitPanelUi.setupUi(m_gitSubmitPanel);
|
||||
new GitSubmitHighlighter(descriptionEdit());
|
||||
|
||||
m_emailValidator = new QRegExpValidator(QRegExp(QLatin1String("[^@ ]+@[^@ ]+\\.[a-zA-Z]+")), this);
|
||||
m_emailValidator = new QRegExpValidator(QRegExp("[^@ ]+@[^@ ]+\\.[a-zA-Z]+"), this);
|
||||
const QPixmap error = Core::Icons::ERROR.pixmap();
|
||||
m_gitSubmitPanelUi.invalidAuthorLabel->setPixmap(error);
|
||||
m_gitSubmitPanelUi.invalidEmailLabel->setToolTip(tr("Provide a valid email to commit."));
|
||||
@@ -66,7 +66,7 @@ GitSubmitEditorWidget::GitSubmitEditorWidget() :
|
||||
void GitSubmitEditorWidget::setPanelInfo(const GitSubmitEditorPanelInfo &info)
|
||||
{
|
||||
m_gitSubmitPanelUi.repositoryLabel->setText(QDir::toNativeSeparators(info.repository));
|
||||
if (info.branch.contains(QLatin1String("(no branch)")))
|
||||
if (info.branch.contains("(no branch)"))
|
||||
m_gitSubmitPanelUi.branchLabel->setText(QString::fromLatin1("<span style=\"color:red\">%1</span>")
|
||||
.arg(tr("Detached HEAD")));
|
||||
else
|
||||
@@ -163,8 +163,8 @@ QString GitSubmitEditorWidget::cleanupDescription(const QString &input) const
|
||||
{
|
||||
// We need to manually purge out comment lines starting with
|
||||
// hash '#' since git does not do that when using -F.
|
||||
const QChar newLine = QLatin1Char('\n');
|
||||
const QChar hash = QLatin1Char('#');
|
||||
const QChar newLine = '\n';
|
||||
const QChar hash = '#';
|
||||
QString message = input;
|
||||
for (int pos = 0; pos < message.size(); ) {
|
||||
const int newLinePos = message.indexOf(newLine, pos);
|
||||
|
||||
Reference in New Issue
Block a user