Commit 75ea8116 authored by David Jarvie's avatar David Jarvie
Browse files

Suppress clang-tidy warnings

parent cd75d482
Pipeline #44872 passed with stage
in 17 minutes and 28 seconds
......@@ -1734,7 +1734,8 @@ bool convertTimeString(const QByteArray& timeString, KADateTime& dateTime, const
return false;
QString zone = (i >= 0) ? QString::fromLatin1(timeString.mid(i)) : QString();
char timeStr[MAX_DT_LEN+1];
strcpy(timeStr, timeString.left(i >= 0 ? i : MAX_DT_LEN).constData());
strncpy(timeStr, timeString.left(i >= 0 ? i : MAX_DT_LEN).constData(), MAX_DT_LEN);
timeStr[MAX_DT_LEN] = '\0';
int dt[5] = { -1, -1, -1, -1, -1 };
char* s;
char* end;
......
......@@ -372,7 +372,7 @@ void MainWindow::showEvent(QShowEvent* se)
mShown = true;
if (mMenuError)
QTimer::singleShot(0, this, &MainWindow::showMenuErrorMessage); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(0, this, &MainWindow::showMenuErrorMessage); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
}
/******************************************************************************
......
......@@ -108,7 +108,8 @@ void MessageDisplay::redisplayAlarms()
for (const Event::Ptr& kcalEvent : kcalEvents)
{
bool showDefer, showEdit;
reinstateFromDisplaying(kcalEvent, event, resource, showEdit, showDefer);
if (!reinstateFromDisplaying(kcalEvent, event, resource, showEdit, showDefer))
continue;
const EventId eventId(event);
if (findEvent(eventId))
qCDebug(KALARM_LOG) << "MessageDisplay::redisplayAlarms: Message display already exists:" << eventId;
......
......@@ -812,7 +812,7 @@ void MessageDisplayHelper::playAudio()
{
// The message is to be spoken. In case of error messges,
// call it on a timer to allow the display to be shown first.
QTimer::singleShot(0, this, &MessageDisplayHelper::slotSpeak); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(0, this, &MessageDisplayHelper::slotSpeak); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
}
}
......@@ -895,7 +895,7 @@ void MessageDisplayHelper::playReady()
*/
void MessageDisplayHelper::audioTerminating()
{
QTimer::singleShot(0, this, &MessageDisplayHelper::startAudio); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(0, this, &MessageDisplayHelper::startAudio); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
}
/******************************************************************************
......@@ -950,7 +950,7 @@ AudioThread::~AudioThread()
mAudioOwner = nullptr;
// Notify after deleting mAudioThread, so that isAudioPlaying() will
// return the correct value.
QTimer::singleShot(0, theApp(), &KAlarmApp::notifyAudioStopped); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(0, theApp(), &KAlarmApp::notifyAudioStopped); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
}
/******************************************************************************
......@@ -1059,7 +1059,7 @@ void AudioThread::checkAudioPlay()
{
// Pause before playing the file again
mPausing = true;
QTimer::singleShot(mRepeatPause * 1000, this, &AudioThread::checkAudioPlay); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(mRepeatPause * 1000, this, &AudioThread::checkAudioPlay); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
mMutex.unlock();
return;
}
......@@ -1133,7 +1133,7 @@ bool MessageDisplayHelper::activateAutoClose()
int delay = QDateTime::currentDateTimeUtc().secsTo(mCloseTime);
if (delay < 0)
delay = 0;
QTimer::singleShot(delay * 1000, this, &MessageDisplayHelper::autoCloseNow); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(delay * 1000, this, &MessageDisplayHelper::autoCloseNow); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
if (!delay)
return false; // don't show the alarm if auto-closing is already due
}
......@@ -1261,7 +1261,7 @@ void MessageDisplayHelper::checkDeferralLimit()
n = QDateTime::currentDateTimeUtc().secsTo(mDeferLimit);
if (n > 0)
{
QTimer::singleShot(n * 1000, this, &MessageDisplayHelper::checkDeferralLimit); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(n * 1000, this, &MessageDisplayHelper::checkDeferralLimit); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
return;
}
}
......
......@@ -97,6 +97,6 @@ ActionReply RtcWakeAction::settimer(const QVariantMap& args)
return reply;
}
KAUTH_HELPER_MAIN("org.kde.kalarm.rtcwake", RtcWakeAction)
KAUTH_HELPER_MAIN("org.kde.kalarm.rtcwake", RtcWakeAction) //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
// vim: et sw=4:
......@@ -437,7 +437,7 @@ void SoundWidget::playSound()
mPlayer->setParent(this);
#else
mPlayer = new Phonon::MediaObject(this);
auto* output = new Phonon::AudioOutput(Phonon::MusicCategory, mPlayer);
auto* output = new Phonon::AudioOutput(Phonon::MusicCategory, mPlayer); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
mPlayer->setCurrentSource(mUrl);
Phonon::createPath(mPlayer, output);
#endif
......
......@@ -106,7 +106,7 @@ TemplateDlg::TemplateDlg(QWidget* parent)
this, &QDialog::close);
topLayout->addWidget(buttonBox);
KActionCollection* actions = new KActionCollection(this);
KActionCollection* actions = new KActionCollection(this); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
QAction* act = KStandardAction::selectAll(mListView, &QTreeView::selectAll, actions);
topLevelWidget()->addAction(act);
act = KStandardAction::deselect(mListView, &QAbstractItemView::clearSelection, actions);
......
......@@ -177,7 +177,7 @@ void TrayWindow::slotPreferences()
void TrayWindow::slotQuit()
{
// Note: QTimer::singleShot(0, ...) never calls the slot.
QTimer::singleShot(1, this, &TrayWindow::slotQuitAfter); //NOLINT(resources/fileresourcecalendarupdater.cpp)
QTimer::singleShot(1, this, &TrayWindow::slotQuitAfter); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
}
void TrayWindow::slotQuitAfter()
{
......@@ -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; //clazy:exclude=inefficient-qlist QList is better than QVector for insertions
QList<TipItem> items; //clazy:exclude=inefficient-qlist,inefficient-qlist-soft 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)
{
......
......@@ -1247,7 +1247,7 @@ QString UndoDeletes::defaultActionText() const
{
if (mUndos->isEmpty())
return QString();
for (const UndoItem* item : *mUndos)
for (const UndoItem* item : qAsConst(*mUndos))
{
switch (item->calendar())
{
......
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