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
PIM
KAlarm
Commits
4c8ee41a
Commit
4c8ee41a
authored
Dec 19, 2020
by
David Jarvie
Browse files
Clazy fixes
parent
b1bf7b6a
Pipeline
#44762
canceled with stage
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/editdlgtypes.cpp
View file @
4c8ee41a
...
...
@@ -1399,8 +1399,10 @@ void EditEmailAlarmDlg::saveState(const KAEvent* event)
*/
bool
EditEmailAlarmDlg
::
type_stateChanged
()
const
{
int
count
=
mEmailAttachList
->
count
();
QStringList
emailAttach
;
for
(
int
i
=
0
,
end
=
mEmailAttachList
->
count
();
i
<
end
;
++
i
)
emailAttach
.
reserve
(
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
emailAttach
+=
mEmailAttachList
->
itemText
(
i
);
if
((
mEmailFromList
&&
mSavedEmailFrom
!=
mEmailFromList
->
currentIdentityName
())
||
mSavedEmailTo
!=
mEmailToEdit
->
text
()
...
...
src/functions.cpp
View file @
4c8ee41a
...
...
@@ -819,8 +819,10 @@ QVector<KAEvent> getSortedActiveEvents(QObject* parent, AlarmListModel** model)
(
*
model
)
->
setEventTypeFilter
(
CalEvent
::
ACTIVE
);
(
*
model
)
->
sort
(
AlarmListModel
::
TimeColumn
);
}
int
count
=
(
*
model
)
->
rowCount
();
QVector
<
KAEvent
>
result
;
for
(
int
i
=
0
,
count
=
(
*
model
)
->
rowCount
();
i
<
count
;
++
i
)
result
.
reserve
(
count
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
const
KAEvent
event
=
(
*
model
)
->
event
(
i
);
if
(
event
.
enabled
()
&&
!
event
.
expired
())
...
...
src/kalarmapp.cpp
View file @
4c8ee41a
...
...
@@ -349,7 +349,7 @@ void KAlarmApp::showRestoredWindows()
if
(
!
mRestoredWindows
.
isEmpty
())
{
// Display message windows restored at startup.
for
(
MessageWindow
*
win
:
mRestoredWindows
)
for
(
MessageWindow
*
win
:
qAsConst
(
mRestoredWindows
)
)
win
->
display
();
mRestoredWindows
.
clear
();
}
...
...
src/kamail.cpp
View file @
4c8ee41a
...
...
@@ -687,6 +687,7 @@ QStringList extractEmailsAndNormalize(const QString& emailAddresses)
{
const
QStringList
splitEmails
(
KEmailAddress
::
splitAddressList
(
emailAddresses
));
QStringList
normalizedEmail
;
normalizedEmail
.
reserve
(
splitEmails
.
count
());
for
(
const
QString
&
email
:
splitEmails
)
{
normalizedEmail
<<
KEmailAddress
::
extractEmailAddress
(
KEmailAddress
::
normalizeAddressesAndEncodeIdn
(
email
));
...
...
src/resources/fileresourcecreator.cpp
View file @
4c8ee41a
...
...
@@ -43,7 +43,7 @@ void FileResourceCreator::doCreateResource()
{
QStringList
typeDescs
;
for
(
ResourceType
::
StorageType
t
:
types
)
typeDescs
+=
Resource
::
storageTypeString
(
t
);
typeDescs
+=
Resource
::
storageTypeString
(
t
);
//clazy:exclude=reserve-candidates There are very few types
ResourceType
::
StorageType
type
=
types
[
0
];
if
(
types
.
count
()
>
1
)
{
...
...
src/resources/resourcemodel.cpp
View file @
4c8ee41a
...
...
@@ -91,8 +91,9 @@ QModelIndexList ResourceFilterModel::match(const QModelIndex& start, int role, c
if
(
role
<
Qt
::
UserRole
)
return
QSortFilterProxyModel
::
match
(
start
,
role
,
value
,
hits
,
flags
);
QModelIndexList
matches
;
//clazy:exclude=inefficient-qlist
const
QModelIndexList
indexes
=
sourceModel
()
->
match
(
mapToSource
(
start
),
role
,
value
,
hits
,
flags
);
//clazy:exclude=inefficient-qlist
QModelIndexList
matches
;
//clazy:exclude=inefficient-qlist
matches
.
reserve
(
indexes
.
count
());
for
(
const
QModelIndex
&
ix
:
indexes
)
{
QModelIndex
proxyIndex
=
mapFromSource
(
ix
);
...
...
@@ -388,7 +389,7 @@ void ResourceCheckListModel::selectionChanged(const QItemSelection& selected, co
}
const
QModelIndexList
desel
=
deselected
.
indexes
();
//clazy:exclude=inefficient-qlist
for
(
const
QModelIndex
&
ix
:
desel
)
mModel
->
resource
(
ix
).
setEnabled
(
mAlarmType
,
false
);
mModel
->
resource
(
ix
).
setEnabled
(
mAlarmType
,
false
);
//clazy:exclude=writing-to-temporary
}
/******************************************************************************
...
...
src/traywindow.cpp
View file @
4c8ee41a
...
...
@@ -333,7 +333,7 @@ QString TrayWindow::tooltipAlarmText() const
// Get today's and tomorrow's alarms, sorted in time order
int
i
,
iend
;
QList
<
TipItem
>
items
;
QList
<
TipItem
>
items
;
//clazy:exclude=inefficient-qlist QList is better than QVector for insertions
QVector
<
KAEvent
>
events
=
KAlarm
::
getSortedActiveEvents
(
const_cast
<
TrayWindow
*>
(
this
),
&
mAlarmsModel
);
for
(
i
=
0
,
iend
=
events
.
count
();
i
<
iend
;
++
i
)
{
...
...
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