Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
KCron
Commits
7b792569
Commit
7b792569
authored
Jan 17, 2021
by
Laurent Montel
😁
Browse files
Port some foreach
parent
4d6c48ca
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/crontablib/ctInitializationError.cpp
View file @
7b792569
...
...
@@ -15,7 +15,7 @@ QString CTInitializationError::errorMessage() const
void
CTInitializationError
::
setErrorMessage
(
const
QString
&
errorMessage
)
{
this
->
mError
=
errorMessage
;
mError
=
errorMessage
;
}
bool
CTInitializationError
::
hasErrorMessage
()
const
...
...
src/crontablib/ctcron.cpp
View file @
7b792569
...
...
@@ -320,7 +320,7 @@ CTSaveStatus CTCron::save()
ctTask
->
apply
();
}
for
each
(
CTVariable
*
ctVariable
,
d
->
variable
)
{
for
(
CTVariable
*
ctVariable
:
qAsConst
(
d
->
variable
)
)
{
ctVariable
->
apply
();
}
...
...
@@ -359,7 +359,7 @@ bool CTCron::isDirty() const
}
}
for
each
(
CTVariable
*
ctVariable
,
d
->
variable
)
{
for
(
CTVariable
*
ctVariable
:
qAsConst
(
d
->
variable
)
)
{
if
(
ctVariable
->
dirty
())
{
return
true
;
}
...
...
@@ -372,7 +372,7 @@ QString CTCron::path() const
{
QString
path
;
for
each
(
CTVariable
*
ctVariable
,
d
->
variable
)
{
for
(
CTVariable
*
ctVariable
:
qAsConst
(
d
->
variable
)
)
{
if
(
ctVariable
->
variable
==
QLatin1String
(
"PATH"
))
{
path
=
ctVariable
->
value
;
}
...
...
src/crontablib/cthour.cpp
View file @
7b792569
...
...
@@ -18,8 +18,7 @@ CTHour::CTHour(const QString &tokStr)
int
CTHour
::
findPeriod
()
const
{
QList
<
int
>
periods
;
periods
<<
2
<<
3
<<
4
<<
6
<<
8
;
const
QList
<
int
>
periods
{
2
,
3
,
4
,
6
,
8
};
return
CTUnit
::
findPeriod
(
periods
);
}
...
...
src/crontablib/cttask.cpp
View file @
7b792569
...
...
@@ -224,12 +224,10 @@ QString CTTask::schedulingCronFormat() const
return
QStringLiteral
(
"@reboot"
);
}
QString
scheduling
;
scheduling
+=
minute
.
exportUnit
()
+
QLatin1String
(
" "
);
scheduling
+=
hour
.
exportUnit
()
+
QLatin1String
(
" "
);
scheduling
+=
dayOfMonth
.
exportUnit
()
+
QLatin1String
(
" "
);
scheduling
+=
month
.
exportUnit
()
+
QLatin1String
(
" "
);
QString
scheduling
=
minute
.
exportUnit
()
+
QLatin1Char
(
' '
);
scheduling
+=
hour
.
exportUnit
()
+
QLatin1Char
(
' '
);
scheduling
+=
dayOfMonth
.
exportUnit
()
+
QLatin1Char
(
' '
);
scheduling
+=
month
.
exportUnit
()
+
QLatin1Char
(
' '
);
scheduling
+=
dayOfWeek
.
exportUnit
();
return
scheduling
;
...
...
src/crontablib/ctvariable.cpp
View file @
7b792569
...
...
@@ -25,9 +25,7 @@ CTVariable::CTVariable(const QString &tokenString, const QString &_comment, cons
enabled
=
true
;
}
int
spacepos
(
0
);
spacepos
=
tokStr
.
indexOf
(
QRegExp
(
QLatin1String
(
"[ =]"
)));
const
int
spacepos
=
tokStr
.
indexOf
(
QRegExp
(
QLatin1String
(
"[ =]"
)));
variable
=
tokStr
.
mid
(
0
,
spacepos
);
value
=
tokStr
.
mid
(
spacepos
+
1
,
tokStr
.
length
()
-
spacepos
-
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment