Commit b09e095e authored by David Jarvie's avatar David Jarvie
Browse files

Suppress clazy warnings which should be ignored

parent 6b41f50b
Pipeline #34952 failed with stage
in 6 minutes and 48 seconds
......@@ -30,6 +30,8 @@
#include <QLabel>
#include <QHBoxLayout>
//clazy:excludeall=non-pod-global-static
static const QTime time_23_59(23, 59);
......
......@@ -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;
......
......@@ -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
......
......@@ -24,6 +24,8 @@
using namespace KCalendarCore;
using namespace KAlarmCal;
//clazy:excludeall=non-pod-global-static
namespace
{
......
......@@ -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)
{
......
......@@ -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())
{
......
......@@ -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())
......
......@@ -75,6 +75,8 @@ using namespace KCalUtils;
using namespace KAlarmCal;
//clazy:excludeall=non-pod-global-static
namespace
{
const QString UI_FILE(QStringLiteral("kalarmui.rc"));
......
......@@ -26,6 +26,8 @@
using namespace KAlarmCal;
//clazy:excludeall=non-pod-global-static
namespace
{
......
......@@ -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";
......
......@@ -951,8 +951,8 @@ QModelIndex AkonadiDataModel::resourceIndex(Akonadi::Collection::Id id) const
*/
Collection* AkonadiDataModel::collection(Collection::Id id) const
{
auto it = mResources.find(id);
if (it != mResources.end())
auto it = mResources.constFind(id);
if (it != mResources.constEnd())
{
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())
......
......@@ -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);
......
......@@ -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;
......
......@@ -43,6 +43,8 @@
using namespace KAlarmCal;
//clazy:excludeall=non-pod-global-static
namespace
{
const QString KALARM_RESOURCE(QStringLiteral("akonadi_kalarm_resource"));
......
......@@ -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);
}
......
......@@ -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());
......
......@@ -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
......
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