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
2c702048
Commit
2c702048
authored
Oct 05, 2021
by
Corbin Schwimmbeck
Browse files
Use a fancy stl function as recommended by cppcheck
It's just for fun, seemed like a neat trick the compiler recommended.
parent
68f21786
Pipeline
#85885
passed with stage
in 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/crontabPrinter.cpp
View file @
2c702048
...
...
@@ -12,6 +12,7 @@
#include
<QPainter>
#include
<QPrintDialog>
#include
<QPrinter>
#include
<numeric>
#include
<KLocalizedString>
...
...
@@ -279,10 +280,7 @@ void CrontabPrinter::drawTable(const QList<int> &columnWidths)
{
mPainter
->
translate
(
0
,
-
mCurrentRowPosition
+
computeMargin
());
int
columnWidthsTotal
=
0
;
for
(
int
columnWidth
:
columnWidths
)
{
columnWidthsTotal
+=
columnWidth
;
}
int
columnWidthsTotal
=
std
::
accumulate
(
columnWidths
.
begin
(),
columnWidths
.
end
(),
0
);
const
int
margin
=
computeMargin
();
int
linePositionX
=
margin
;
...
...
src/crontablib/ctSaveStatus.cpp
View file @
2c702048
...
...
@@ -14,10 +14,10 @@ CTSaveStatus::CTSaveStatus()
}
CTSaveStatus
::
CTSaveStatus
(
const
QString
&
errorMessage
,
const
QString
&
detailErrorMessage
)
:
mErrorStatus
(
true
)
,
mError
(
errorMessage
)
,
mDetailError
(
detailErrorMessage
)
{
mErrorStatus
=
true
;
mError
=
errorMessage
;
mDetailError
=
detailErrorMessage
;
}
QString
CTSaveStatus
::
errorMessage
()
const
...
...
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