Changeset View
Changeset View
Standalone View
Standalone View
src/kedittagsdialog.cpp
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Line(s) | |||||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | void KEditTagsDialog::slotTextEdited(const QString& text) | 129 | void KEditTagsDialog::slotTextEdited(const QString& text) | ||
130 | { | 130 | { | ||
131 | // Remove unnecessary spaces from a new tag is | 131 | // Remove unnecessary spaces from a new tag is | ||
132 | // mandatory, as the user cannot see the difference | 132 | // mandatory, as the user cannot see the difference | ||
133 | // between a tag "Test" and "Test ". | 133 | // between a tag "Test" and "Test ". | ||
134 | QString tagText = text.simplified(); | 134 | QString tagText = text.simplified(); | ||
135 | while (tagText.endsWith("//")) { | 135 | while (tagText.endsWith(QLatin1String("//"))) { | ||
bruns: `.endsWith` has a QLatin1String overload | |||||
136 | tagText.chop(1); | 136 | tagText.chop(1); | ||
137 | m_newTagEdit->setText(tagText); | 137 | m_newTagEdit->setText(tagText); | ||
138 | return; | 138 | return; | ||
139 | } | 139 | } | ||
140 | 140 | | |||
141 | // Remove all tree items related to the previous new tag | 141 | // Remove all tree items related to the previous new tag | ||
142 | const QStringList splitTag = m_newTag.split(QLatin1Char('/'), QString::SkipEmptyParts); | 142 | const QStringList splitTag = m_newTag.split(QLatin1Char('/'), QString::SkipEmptyParts); | ||
143 | for (int i = splitTag.size() - 1; i >= 0 && i < splitTag.size(); --i) { | 143 | for (int i = splitTag.size() - 1; i >= 0 && i < splitTag.size(); --i) { | ||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |
.endsWith has a QLatin1String overload