WSL/SLF GitLab Repository

Commit e3a358ef authored by Mathias Bavay's avatar Mathias Bavay
Browse files

More types fixes

parent 544d1f07
...@@ -718,7 +718,7 @@ void PreviewWindow::insertText(const insert_text &mode) ...@@ -718,7 +718,7 @@ void PreviewWindow::insertText(const insert_text &mode)
} }
if (!username.isEmpty() || !user_domain.isEmpty()) copyright.append(", "); if (!username.isEmpty() || !user_domain.isEmpty()) copyright.append(", ");
copyright.append(year); copyright.append(year);
for (int ii=copyright.size()+1; ii<marker.size(); ii++) for (qsizetype ii=copyright.size()+1; ii<marker.size(); ii++)
copyright.append(" "); copyright.append(" ");
QString header; QString header;
...@@ -766,15 +766,15 @@ void PreviewWindow::transformWhitespaces(const transform_whitespaces &mode) ...@@ -766,15 +766,15 @@ void PreviewWindow::transformWhitespaces(const transform_whitespaces &mode)
break; break;
case LONGEST_WS: case LONGEST_WS:
for (auto &sec : *preview_ini_.getSections()) { for (auto &sec : *preview_ini_.getSections()) {
int max_key_length = 0; qsizetype max_key_length = 0;
for (auto &key : sec.getKeyValueList()) { for (auto &key : sec.getKeyValueList()) {
if (!key.second.getValue().isNull() && key.first.length() > max_key_length) if (!key.second.getValue().isNull() && key.first.length() > max_key_length)
max_key_length = key.first.length(); max_key_length = key.first.length();
} }
for (auto &key : sec.getKeyValueList()) { for (auto &key : sec.getKeyValueList()) {
const int nr_ws = max_key_length - key.first.length() + 1; const qsizetype nr_ws = max_key_length - key.first.length() + 1;
sec.getKeyValue(key.first)->setKeyValWhitespaces( sec.getKeyValue(key.first)->setKeyValWhitespaces(
std::vector<QString>( {"", QString(" ").repeated(nr_ws), " ", " "} ) ); std::vector<QString>( {"", QString(" ").repeated(static_cast<int>(nr_ws)), " ", " "} ) );
} }
} }
} //switch } //switch
...@@ -830,10 +830,10 @@ bool PreviewWindow::transformComments(const transform_comments &mode) ...@@ -830,10 +830,10 @@ bool PreviewWindow::transformComments(const transform_comments &mode)
if (lines.at(ii).trimmed().startsWith("#") || if (lines.at(ii).trimmed().startsWith("#") ||
lines.at(ii).trimmed().startsWith(";")) { lines.at(ii).trimmed().startsWith(";")) {
//find first "#" or ";" and delete: //find first "#" or ";" and delete:
int prefix_pos = lines.at(ii).indexOf("#"); qsizetype prefix_pos = lines.at(ii).indexOf("#");
if (prefix_pos == -1) if (prefix_pos == -1)
prefix_pos = lines.at(ii).indexOf(";"); prefix_pos = lines.at(ii).indexOf(";");
lines[ii].remove(prefix_pos, 1); lines[ii].remove(static_cast<int>(prefix_pos), 1);
removed_comment = true; removed_comment = true;
} }
} }
...@@ -1026,10 +1026,10 @@ QString PreviewWindow::trimComment(const QString &comment) const ...@@ -1026,10 +1026,10 @@ QString PreviewWindow::trimComment(const QString &comment) const
} else { } else {
QStringList lines(comment.split("\n")); QStringList lines(comment.split("\n"));
for (auto &line : lines) { for (auto &line : lines) {
int pre = line.indexOf("#"); qsizetype pre = line.indexOf("#");
if (pre == -1) if (pre == -1)
pre = line.indexOf(";"); pre = line.indexOf(";");
line = line.mid(pre, 1) + line.mid(pre + 1).trimmed(); line = line.mid(static_cast<int>(pre), 1) + line.mid(static_cast<int>(pre) + 1).trimmed();
} }
return lines.join("\n"); return lines.join("\n");
} }
......
Supports Markdown
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