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
b09e095e
Commit
b09e095e
authored
Sep 20, 2020
by
David Jarvie
Browse files
Suppress clazy warnings which should be ignored
parent
6b41f50b
Pipeline
#34952
failed with stage
in 6 minutes and 48 seconds
Changes
17
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/alarmtimewidget.cpp
View file @
b09e095e
...
...
@@ -30,6 +30,8 @@
#include <QLabel>
#include <QHBoxLayout>
//clazy:excludeall=non-pod-global-static
static
const
QTime
time_23_59
(
23
,
59
);
...
...
src/birthdaydlg.cpp
View file @
b09e095e
...
...
@@ -245,7 +245,7 @@ BirthdayDlg::BirthdayDlg(QWidget* parent)
QVector
<
KAEvent
>
BirthdayDlg
::
events
()
const
{
QVector
<
KAEvent
>
list
;
const
QModelIndexList
indexes
=
mListView
->
selectionModel
()
->
selectedRows
();
const
QModelIndexList
indexes
=
mListView
->
selectionModel
()
->
selectedRows
();
//clazy:exclude=inefficient-qlist
const
int
count
=
indexes
.
count
();
if
(
!
count
)
return
list
;
...
...
src/dbushandler.cpp
View file @
b09e095e
...
...
@@ -26,6 +26,8 @@ using namespace KCalendarCore;
#include <stdlib.h>
//clazy:excludeall=non-pod-global-static
namespace
{
const
QString
REQUEST_DBUS_OBJECT
(
QStringLiteral
(
"/kalarm"
));
// D-Bus object path of KAlarm's request interface
...
...
src/displaycalendar.cpp
View file @
b09e095e
...
...
@@ -24,6 +24,8 @@
using
namespace
KCalendarCore
;
using
namespace
KAlarmCal
;
//clazy:excludeall=non-pod-global-static
namespace
{
...
...
src/eventlistview.cpp
View file @
b09e095e
...
...
@@ -84,7 +84,7 @@ void EventListView::clearSelection()
*/
QModelIndex
EventListView
::
selectedIndex
()
const
{
const
QModelIndexList
list
=
selectionModel
()
->
selectedRows
();
const
QModelIndexList
list
=
selectionModel
()
->
selectedRows
();
//clazy:exclude=inefficient-qlist
if
(
list
.
count
()
!=
1
)
return
QModelIndex
();
return
list
[
0
];
...
...
@@ -96,7 +96,7 @@ QModelIndex EventListView::selectedIndex() const
*/
KAEvent
EventListView
::
selectedEvent
()
const
{
const
QModelIndexList
list
=
selectionModel
()
->
selectedRows
();
const
QModelIndexList
list
=
selectionModel
()
->
selectedRows
();
//clazy:exclude=inefficient-qlist
if
(
list
.
count
()
!=
1
)
return
KAEvent
();
const
EventListModel
*
model
=
static_cast
<
const
EventListModel
*>
(
list
[
0
].
model
());
...
...
@@ -109,7 +109,7 @@ KAEvent EventListView::selectedEvent() const
QVector
<
KAEvent
>
EventListView
::
selectedEvents
()
const
{
QVector
<
KAEvent
>
elist
;
const
QModelIndexList
ixlist
=
selectionModel
()
->
selectedRows
();
const
QModelIndexList
ixlist
=
selectionModel
()
->
selectedRows
();
//clazy:exclude=inefficient-qlist
int
count
=
ixlist
.
count
();
if
(
count
)
{
...
...
src/functions.cpp
View file @
b09e095e
...
...
@@ -68,6 +68,7 @@ using namespace KCalendarCore;
#include <QPushButton>
#include <QTemporaryFile>
//clazy:excludeall=non-pod-global-static
namespace
{
...
...
@@ -2016,7 +2017,7 @@ KAlarm::UpdateResult sendToKOrganizer(const KAEvent& event)
if
(
status
!=
KAlarm
::
UPDATE_OK
)
return
status
;
QDBusInterface
korgInterface
(
KORG_DBUS_SERVICE
,
QStringLiteral
(
KORG_DBUS_PATH
),
KORG_DBUS_IFACE
);
const
QList
<
QVariant
>
args
{
iCal
};
const
QList
<
QVariant
>
args
{
iCal
};
//clazy:exclude=inefficient-qlist
QDBusReply
<
bool
>
reply
=
korgInterface
.
callWithArgumentList
(
QDBus
::
Block
,
QStringLiteral
(
"addIncidence"
),
args
);
if
(
!
reply
.
isValid
())
{
...
...
src/kamail.cpp
View file @
b09e095e
...
...
@@ -662,7 +662,7 @@ QStringList KAMail::errors(const QString& err, ErrType prefix)
QString
KAMail
::
getMailBody
(
quint32
serialNumber
)
{
//TODO: Need to use Akonadi instead
const
QList
<
QVariant
>
args
{
serialNumber
,
(
int
)
0
};
const
QList
<
QVariant
>
args
{
serialNumber
,
(
int
)
0
};
//clazy:exclude=inefficient-qlist
QDBusInterface
iface
(
KMAIL_DBUS_SERVICE
,
QString
(),
QStringLiteral
(
"KMailIface"
));
const
QDBusReply
<
QString
>
reply
=
iface
.
callWithArgumentList
(
QDBus
::
Block
,
QStringLiteral
(
"getDecodedBodyPart"
),
args
);
if
(
!
reply
.
isValid
())
...
...
src/mainwindow.cpp
View file @
b09e095e
...
...
@@ -75,6 +75,8 @@ using namespace KCalUtils;
using
namespace
KAlarmCal
;
//clazy:excludeall=non-pod-global-static
namespace
{
const
QString
UI_FILE
(
QStringLiteral
(
"kalarmui.rc"
));
...
...
src/messagenotification.cpp
View file @
b09e095e
...
...
@@ -26,6 +26,8 @@
using
namespace
KAlarmCal
;
//clazy:excludeall=non-pod-global-static
namespace
{
...
...
src/preferences.cpp
View file @
b09e095e
...
...
@@ -35,6 +35,8 @@
using
namespace
KHolidays
;
using
namespace
KAlarmCal
;
//clazy:excludeall=non-pod-global-static
// Config file entry names
static
const
char
*
GENERAL_SECTION
=
"General"
;
...
...
src/resources/akonadidatamodel.cpp
View file @
b09e095e
...
...
@@ -951,8 +951,8 @@ QModelIndex AkonadiDataModel::resourceIndex(Akonadi::Collection::Id id) const
*/
Collection
*
AkonadiDataModel
::
collection
(
Collection
::
Id
id
)
const
{
auto
it
=
mResources
.
f
ind
(
id
);
if
(
it
!=
mResources
.
e
nd
())
auto
it
=
mResources
.
constF
ind
(
id
);
if
(
it
!=
mResources
.
constE
nd
())
{
Collection
&
c
=
AkonadiResource
::
collection
(
it
.
value
());
if
(
c
.
isValid
())
...
...
@@ -976,7 +976,7 @@ Collection* AkonadiDataModel::collection(const Resource& resource) const
*/
QModelIndex
AkonadiDataModel
::
itemIndex
(
const
Akonadi
::
Item
&
item
)
const
{
const
QModelIndexList
ixs
=
modelIndexesForItem
(
this
,
item
);
const
QModelIndexList
ixs
=
modelIndexesForItem
(
this
,
item
);
//clazy:exclude=inefficient-qlist
for
(
const
QModelIndex
&
ix
:
ixs
)
{
if
(
ix
.
isValid
())
...
...
src/resources/eventmodel.cpp
View file @
b09e095e
...
...
@@ -89,8 +89,8 @@ QModelIndexList EventListModel::match(const QModelIndex& start, int role, const
if
(
role
<
Qt
::
UserRole
)
return
QSortFilterProxyModel
::
match
(
start
,
role
,
value
,
hits
,
flags
);
QModelIndexList
matches
;
const
QModelIndexList
indexes
=
sourceModel
()
->
match
(
mapToSource
(
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
for
(
const
QModelIndex
&
ix
:
indexes
)
{
QModelIndex
proxyIndex
=
mapFromSource
(
ix
);
...
...
src/resources/fileresourcedatamodel.cpp
View file @
b09e095e
...
...
@@ -866,7 +866,7 @@ QModelIndexList FileResourceDataModel::match(const QModelIndex& start, int role,
{
case
ResourceIdRole
:
{
QModelIndexList
result
;
QModelIndexList
result
;
//clazy:exclude=inefficient-qlist
const
ResourceId
id
=
value
.
toLongLong
();
if
(
id
>=
0
)
{
...
...
@@ -878,7 +878,7 @@ QModelIndexList FileResourceDataModel::match(const QModelIndex& start, int role,
}
case
EventIdRole
:
{
QModelIndexList
result
;
QModelIndexList
result
;
//clazy:exclude=inefficient-qlist
const
QModelIndex
ix
=
eventIndex
(
value
.
toString
());
if
(
ix
.
isValid
())
result
+=
ix
;
...
...
src/resources/fileresourcemigrator.cpp
View file @
b09e095e
...
...
@@ -43,6 +43,8 @@
using
namespace
KAlarmCal
;
//clazy:excludeall=non-pod-global-static
namespace
{
const
QString
KALARM_RESOURCE
(
QStringLiteral
(
"akonadi_kalarm_resource"
));
...
...
src/resources/resourcemodel.cpp
View file @
b09e095e
...
...
@@ -91,8 +91,8 @@ QModelIndexList ResourceFilterModel::match(const QModelIndex& start, int role, c
if
(
role
<
Qt
::
UserRole
)
return
QSortFilterProxyModel
::
match
(
start
,
role
,
value
,
hits
,
flags
);
QModelIndexList
matches
;
const
QModelIndexList
indexes
=
sourceModel
()
->
match
(
mapToSource
(
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
for
(
const
QModelIndex
&
ix
:
indexes
)
{
QModelIndex
proxyIndex
=
mapFromSource
(
ix
);
...
...
@@ -377,7 +377,7 @@ void ResourceCheckListModel::selectionChanged(const QItemSelection& selected, co
{
if
(
mResetting
)
return
;
const
QModelIndexList
sel
=
selected
.
indexes
();
const
QModelIndexList
sel
=
selected
.
indexes
();
//clazy:exclude=inefficient-qlist
for
(
const
QModelIndex
&
ix
:
sel
)
{
// Try to enable the resource, but untick it if not possible
...
...
@@ -386,7 +386,7 @@ void ResourceCheckListModel::selectionChanged(const QItemSelection& selected, co
if
(
!
resource
.
isEnabled
(
mAlarmType
))
mSelectionModel
->
select
(
ix
,
QItemSelectionModel
::
Deselect
);
}
const
QModelIndexList
desel
=
deselected
.
indexes
();
const
QModelIndexList
desel
=
deselected
.
indexes
();
//clazy:exclude=inefficient-qlist
for
(
const
QModelIndex
&
ix
:
desel
)
mModel
->
resource
(
ix
).
setEnabled
(
mAlarmType
,
false
);
}
...
...
src/resources/resourceselectdialog.cpp
View file @
b09e095e
...
...
@@ -68,7 +68,7 @@ void ResourceSelectDialog::setDefaultResource(const Resource& resource)
Resource
ResourceSelectDialog
::
selectedResource
()
const
{
const
QModelIndexList
indexes
=
mResourceList
->
selectionModel
()
->
selectedRows
();
const
QModelIndexList
indexes
=
mResourceList
->
selectionModel
()
->
selectedRows
();
//clazy:exclude=inefficient-qlist
if
(
indexes
.
isEmpty
())
return
Resource
();
return
mModel
->
resource
(
indexes
[
0
].
row
());
...
...
src/soundpicker.cpp
View file @
b09e095e
...
...
@@ -28,6 +28,8 @@
#include <QHBoxLayout>
#include <QStandardPaths>
//clazy:excludeall=non-pod-global-static
namespace
{
QMap
<
Preferences
::
SoundType
,
int
>
varIndexes
;
// mapping from sound type to combo index
...
...
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