Commit d62a490a authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

changes

parent 43702d31
Pipeline #89545 passed with stage
in 3 minutes and 3 seconds
......@@ -55,7 +55,7 @@ KateColorPickerConfigPage::KateColorPickerConfigPage(QWidget *parent, KateColorP
chkHexLengths.insert(6, new QCheckBox(i18n("6 digits (#RRGGBB)"), this));
chkHexLengths.insert(3, new QCheckBox(i18n("3 digits (#RGB)"), this));
for (QCheckBox *chk : qAsConst(chkHexLengths)) {
for (QCheckBox *chk : std::as_const(chkHexLengths)) {
hexLayout->addWidget(chk);
connect(chk, &QCheckBox::stateChanged, this, &KateColorPickerConfigPage::changed);
}
......@@ -118,8 +118,9 @@ void KateColorPickerConfigPage::reset()
chkPreviewAfterColor->setChecked(config.readEntry("PreviewAfterColor", true));
const QList<int> enabledHexLengths = config.readEntry("HexLengths", QList<int>{12, 9, 6, 3});
const auto hexLengths = chkHexLengths.keys();
for (const int hexLength : hexLengths) {
chkHexLengths[hexLength]->setChecked(enabledHexLengths.contains(hexLength));
for (auto it = chkHexLengths.cbegin(); it != chkHexLengths.cend(); ++it) {
int hexLength = it.key();
it.value()->setChecked(enabledHexLengths.contains(hexLength));
}
}
......@@ -396,11 +396,12 @@ bool CEWidget::compilationFailed(const QJsonObject &obj)
text.replace(re, QLatin1String(""));
QStringList lines;
lines.reserve(text.size() / maxChars);
for (int i = 0; i < text.size(); i += maxChars) {
lines << text.mid(i, maxChars);
}
for (const auto &line : qAsConst(lines)) {
for (const auto &line : std::as_const(lines)) {
AsmRow r;
r.text = line;
rows.push_back(r);
......
......@@ -2694,7 +2694,7 @@ public:
// collect active urls
QSet<QString> fpaths;
const auto views = m_mainWindow->views();
for (const auto &view : views) {
for (const auto view : views) {
if (auto doc = view->document()) {
fpaths.insert(doc->url().toLocalFile());
}
......
......@@ -183,7 +183,7 @@ void KateProjectCompletion::allMatches(QStandardItemModel &model, KTextEditor::V
/**
* let project index fill the completion for this document
*/
for (const auto &project : qAsConst(projects)) {
for (const auto project : qAsConst(projects)) {
if (project->projectIndex()) {
project->projectIndex()->findMatches(model, view->document()->text(range), KateProjectIndex::CompletionMatches);
}
......
......@@ -103,7 +103,7 @@ void KateProjectInfoViewIndex::slotTextChanged(const QString &text)
m_project->projectIndex()->findMatches(*m_model, text, KateProjectIndex::FindMatches);
} else if (!text.isEmpty()) {
const auto projects = m_pluginView->plugin()->projects();
for (const auto &project : projects) {
for (const auto project : projects) {
if (project->projectIndex()) {
project->projectIndex()->findMatches(*m_model, text, KateProjectIndex::FindMatches, TAG_FULLMATCH | TAG_OBSERVECASE);
}
......
......@@ -64,7 +64,7 @@ QStringList KateProjectCodeAnalysisToolClazy::arguments()
args = QStringList{QStringLiteral("-p"), compileCommandsDir};
}
QStringList fileList = filter(m_project->files());
const QStringList fileList = filter(m_project->files());
setActualFilesCount(fileList.size());
return args << fileList;
......
......@@ -296,7 +296,7 @@ bool KateApp::openUrl(const QUrl &url, const QString &encoding, bool isTempFile)
bool KateApp::isOnActivity(const QString &activity)
{
for (const auto &window : qAsConst(m_mainWindows)) {
for (const auto window : qAsConst(m_mainWindows)) {
const KWindowInfo info(window->winId(), {}, NET::WM2Activities);
const auto activities = info.activities();
// handle special case of "on all activities"
......
......@@ -74,8 +74,8 @@ private Q_SLOTS:
// collect the stuff
QString clipboardText;
int row = -1;
const auto selectedIndexes = this->selectedIndexes();
for (const auto selected : selectedIndexes) {
const auto selectedIdxs = selectedIndexes();
for (const auto &selected : selectedIdxs) {
// we want to separate columns by " " and rows by "\n"
// first element: just append + remember row
......
......@@ -81,11 +81,11 @@ void KateSessionManager::updateSessionList()
changed = true;
}
}
// Remove gone sessions from our list
const auto sessions = m_sessions.keys();
for (const QString &session : sessions) {
if ((list.indexOf(session) < 0) && (m_sessions.value(session) != activeSession())) {
m_sessions.remove(session);
for (auto it = m_sessions.cbegin(); it != m_sessions.cend(); ++it) {
if (list.indexOf(it.key()) < 0 && it.value() != activeSession()) {
m_sessions.remove(it.key());
changed = true;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment