Commit fe718576 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove some clazy warning

parent 63581b54
Pipeline #50251 passed with stage
in 7 minutes and 56 seconds
......@@ -321,6 +321,7 @@ void CrontabPrinter::drawTable(const QList<int> &columnWidths)
QList<int> CrontabPrinter::findMaxWidths(const QList<QStringList> &contents, int columnCount)
{
QList<int> columnWidths;
columnWidths.reserve(columnCount);
for (int i = 0; i < columnCount; ++i) {
columnWidths.append(0);
}
......
......@@ -50,7 +50,7 @@ QString CTDayOfWeek::describe() const
QString CTDayOfWeek::getName(const int ndx, const bool format)
{
initializeNames();
return (format == shortFormat) ? shortName[ndx] : longName[ndx];
return (format == shortFormat) ? shortName.at(ndx) : longName.at(ndx);
}
void CTDayOfWeek::initializeNames()
......
......@@ -25,7 +25,7 @@ QString CTMonth::describe() const
QString CTMonth::getName(const int ndx)
{
initializeNames();
return shortName[ndx];
return shortName.at(ndx);
}
void CTMonth::initializeNames()
......
......@@ -26,6 +26,7 @@ CTUnit::CTUnit(const CTUnit &source)
mInitialEnabled.clear();
mEnabled.clear();
mInitialEnabled.reserve(mMax + 1);
for (int i = 0; i <= mMax; i++) {
mInitialEnabled.append(false);
mEnabled.append(source.mEnabled.at(i));
......@@ -239,7 +240,7 @@ void CTUnit::apply()
{
mInitialTokStr = exportUnit();
for (int i = mMin; i <= mMax; i++) {
mInitialEnabled[i] = mEnabled[i];
mInitialEnabled[i] = mEnabled.at(i);
}
mDirty = false;
}
......@@ -247,7 +248,7 @@ void CTUnit::apply()
void CTUnit::cancel()
{
for (int i = mMin; i <= mMax; i++) {
mEnabled[i] = mInitialEnabled[i];
mEnabled[i] = mInitialEnabled.at(i);
}
mDirty = false;
}
......
......@@ -52,6 +52,7 @@ QList<TaskWidget *> TasksWidget::selectedTasksWidget() const
QList<TaskWidget *> tasksWidget;
const QList<QTreeWidgetItem *> tasksItems = treeWidget()->selectedItems();
tasksWidget.reserve(tasksItems.count());
for (QTreeWidgetItem *item : tasksItems) {
TaskWidget *taskWidget = static_cast<TaskWidget *>(item);
tasksWidget.append(taskWidget);
......@@ -98,6 +99,7 @@ void TasksWidget::runTaskNow() const
QStringList commandList;
const auto variables = ctCron->variables();
commandList.reserve(variables.count() + 5);
for (CTVariable *variable : variables) {
commandList << QStringLiteral("export %1=\"%2\"").arg(variable->variable, variable->value);
}
......
......@@ -78,6 +78,7 @@ QList<VariableWidget *> VariablesWidget::selectedVariablesWidget() const
QList<VariableWidget *> variablesWidget;
const QList<QTreeWidgetItem *> variablesItems = treeWidget()->selectedItems();
variablesWidget.reserve(variablesItems.count());
for (QTreeWidgetItem *item : variablesItems) {
VariableWidget *variableWidget = static_cast<VariableWidget *>(item);
variablesWidget.append(variableWidget);
......
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