Skip to content

Commit 59aaa39

Browse files
committed
fix: various clang tidy reports
1 parent 3623c4e commit 59aaa39

4 files changed

Lines changed: 19 additions & 16 deletions

File tree

‎audio/src/backend/openal.cpp‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,12 @@ OpenAL::OpenAL(IAudioSettings& _settings)
115115
captureTimer.setInterval(AUDIO_FRAME_DURATION / 2);
116116
captureTimer.setSingleShot(false);
117117
captureTimer.moveToThread(audioThread);
118-
// TODO for Qt 5.6+: use qOverload
119-
connect(audioThread, &QThread::started, &captureTimer,
120-
static_cast<void (QTimer::*)(void)>(&QTimer::start));
118+
connect(audioThread, &QThread::started, &captureTimer, qOverload<>(&QTimer::start));
121119

122120
cleanupTimer.setInterval(1000);
123121
cleanupTimer.setSingleShot(false);
124122
connect(&cleanupTimer, &QTimer::timeout, this, &OpenAL::cleanupSound);
125-
// TODO for Qt 5.6+: use qOverload
126-
connect(audioThread, &QThread::started, &cleanupTimer,
127-
static_cast<void (QTimer::*)(void)>(&QTimer::start));
123+
connect(audioThread, &QThread::started, &cleanupTimer, qOverload<>(&QTimer::start));
128124

129125
audioThread->start();
130126
}

‎src/chatlog/chatwidget.cpp‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,9 +1228,8 @@ void ChatWidget::onRenderFinished()
12281228
// invalidated. This could be improved in the future but for now I do not
12291229
// believe this is a serious usage impediment. Chats can be exported if a
12301230
// user really needs more than 300 messages to be copied
1231-
if (chatLineStorage->find(selFirstRow) == chatLineStorage->end()
1232-
|| chatLineStorage->find(selLastRow) == chatLineStorage->end()
1233-
|| chatLineStorage->find(selClickedRow) == chatLineStorage->end()) {
1231+
if (!chatLineStorage->contains(selFirstRow) || !chatLineStorage->contains(selLastRow)
1232+
|| !chatLineStorage->contains(selClickedRow)) {
12341233
// FIXME: Segfault when selecting while scrolling down
12351234
clearSelection();
12361235
}

‎src/video/camerasource.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ Q_LOGGING_CATEGORY(ffmpegDeviceAudioOutput, "ffmpeg.device.audio_output")
9797
Q_LOGGING_CATEGORY(ffmpegDeviceAudioInput, "ffmpeg.device.audio_input")
9898
Q_LOGGING_CATEGORY(ffmpegDeviceOutput, "ffmpeg.device.output")
9999
Q_LOGGING_CATEGORY(ffmpegDeviceInput, "ffmpeg.device.input")
100+
Q_LOGGING_CATEGORY(ffmpegHWDevice, "ffmpeg.hwdevice")
100101
} // namespace logcat
101102

102103
const QLoggingCategory& (*avLogCategory(const AVClass* avc))()
@@ -141,6 +142,10 @@ const QLoggingCategory& (*avLogCategory(const AVClass* avc))()
141142
return logcat::ffmpegDeviceOutput;
142143
case AV_CLASS_CATEGORY_DEVICE_INPUT:
143144
return logcat::ffmpegDeviceInput;
145+
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 2, 100)
146+
case AV_CLASS_CATEGORY_HWDEVICE:
147+
return logcat::ffmpegHWDevice;
148+
#endif
144149
}
145150
return logcat::ffmpeg;
146151
}

‎src/widget/form/settingswidget.cpp‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,20 @@ SettingsWidget::SettingsWidget(UpdateCheck& updateCheck, IAudioControl& audio, C
4545
settingsWidgets->setTabPosition(QTabWidget::North);
4646
bodyLayout->addWidget(settingsWidgets.get());
4747

48-
std::unique_ptr<GeneralForm> gfrm(new GeneralForm(settings, style));
48+
std::unique_ptr<GeneralForm> gfrm = std::make_unique<GeneralForm>(settings, style);
4949
connect(gfrm.get(), &GeneralForm::updateIcons, parent, &Widget::updateIcons);
5050

51-
std::unique_ptr<UserInterfaceForm> uifrm(new UserInterfaceForm(smileyPack, settings, style, this));
52-
std::unique_ptr<PrivacyForm> pfrm(new PrivacyForm(core, settings, style, profile));
51+
std::unique_ptr<UserInterfaceForm> uifrm =
52+
std::make_unique<UserInterfaceForm>(smileyPack, settings, style, this);
53+
std::unique_ptr<PrivacyForm> pfrm = std::make_unique<PrivacyForm>(core, settings, style, profile);
5354
connect(pfrm.get(), &PrivacyForm::clearAllReceipts, parent, &Widget::clearAllReceipts);
5455

55-
auto* rawAvfrm = new AVForm(audio, coreAV, cameraSource, audioSettings, videoSettings, style);
56-
std::unique_ptr<AVForm> avfrm(rawAvfrm);
57-
std::unique_ptr<AdvancedForm> expfrm(new AdvancedForm(settings, style, messageBoxManager));
58-
std::unique_ptr<AboutForm> abtfrm(new AboutForm(updateCheck, core->getSelfId().toString(), style));
56+
std::unique_ptr<AVForm> avfrm =
57+
std::make_unique<AVForm>(audio, coreAV, cameraSource, audioSettings, videoSettings, style);
58+
std::unique_ptr<AdvancedForm> expfrm =
59+
std::make_unique<AdvancedForm>(settings, style, messageBoxManager);
60+
std::unique_ptr<AboutForm> abtfrm =
61+
std::make_unique<AboutForm>(updateCheck, core->getSelfId().toString(), style);
5962

6063
connect(&updateCheck, &UpdateCheck::updateAvailable, this, &SettingsWidget::onUpdateAvailable);
6164

0 commit comments

Comments
 (0)