Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up PVR as per clang-tidy report #17685

Merged
merged 3 commits into from Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion xbmc/pvr/PVRDatabase.cpp
Expand Up @@ -780,7 +780,7 @@ bool CPVRDatabase::Persist(CPVRChannelGroup& group)
}

std::string strQuery;
bReturn = true;

CSingleLock lock(m_critSection);
{
/* insert a new entry when this is a new group, or replace the existing one otherwise */
Expand Down
4 changes: 2 additions & 2 deletions xbmc/pvr/channels/PVRChannelGroup.h
Expand Up @@ -489,7 +489,7 @@ namespace PVR
/*!
* @brief Init class
*/
virtual void OnInit();
void OnInit();

/*!
* @brief Load the channels stored in the database.
Expand Down Expand Up @@ -528,7 +528,7 @@ namespace PVR
/*!
* @brief Clear this channel list.
*/
virtual void Unload();
void Unload();

/*!
* @brief Load the channels from the clients.
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp
Expand Up @@ -476,7 +476,7 @@ bool CGUIDialogPVRChannelManager::OnClickButtonNewChannel()

pDlgSelect->SetHeading(CVariant{19213}); // Select Client

for (const auto client : m_clientsWithSettingsList)
for (const auto& client : m_clientsWithSettingsList)
pDlgSelect->Add(client->Name());
pDlgSelect->Open();

Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/dialogs/GUIDialogPVRChannelsOSD.cpp
Expand Up @@ -271,7 +271,7 @@ void CGUIDialogPVRChannelsOSD::OnInputDone()
if (channelNumber.IsValid())
{
int itemIndex = 0;
for (const CFileItemPtr channel : *m_vecItems)
for (const CFileItemPtr& channel : *m_vecItems)
{
if (channel->GetPVRChannelInfoTag()->ChannelNumber() == channelNumber)
{
Expand Down
2 changes: 0 additions & 2 deletions xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
Expand Up @@ -58,8 +58,6 @@ bool CGUIDialogPVRGuideInfo::OnClickButtonRecord(CGUIMessage& message)

if (message.GetSenderId() == CONTROL_BTN_RECORD)
{
bReturn = true;

const std::shared_ptr<CPVRTimerInfoTag> timerTag = CServiceBroker::GetPVRManager().Timers()->GetTimerForEpgTag(m_progItem);
if (timerTag)
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/guilib/PVRGUIActions.cpp
Expand Up @@ -1589,7 +1589,7 @@ namespace PVR
pDialog->Reset();
pDialog->SetHeading(CVariant{19119}); // "On which backend do you want to search?"

for (const auto client : possibleScanClients)
for (const auto& client : possibleScanClients)
pDialog->Add(client->GetFriendlyName());

pDialog->Open();
Expand Down
6 changes: 3 additions & 3 deletions xbmc/pvr/recordings/PVRRecordings.cpp
Expand Up @@ -140,7 +140,7 @@ std::vector<std::shared_ptr<CPVRRecording>> CPVRRecordings::GetAll() const
std::shared_ptr<CPVRRecording> CPVRRecordings::GetById(unsigned int iId) const
{
CSingleLock lock(m_critSection);
for (const auto recording : m_recordings)
for (const auto& recording : m_recordings)
{
if (iId == recording.second->m_iRecordingId)
return recording.second;
Expand All @@ -159,7 +159,7 @@ std::shared_ptr<CPVRRecording> CPVRRecordings::GetByPath(const std::string& path
bool bDeleted = recPath.IsDeleted();
bool bRadio = recPath.IsRadio();

for (const auto recording : m_recordings)
for (const auto& recording : m_recordings)
{
std::shared_ptr<CPVRRecording> current = recording.second;
// Omit recordings not matching criteria
Expand Down Expand Up @@ -221,7 +221,7 @@ std::shared_ptr<CPVRRecording> CPVRRecordings::GetRecordingForEpgTag(const std::

CSingleLock lock(m_critSection);

for (const auto recording : m_recordings)
for (const auto& recording : m_recordings)
{
if (recording.second->IsDeleted())
continue;
Expand Down
4 changes: 2 additions & 2 deletions xbmc/pvr/timers/PVRTimers.cpp
Expand Up @@ -53,9 +53,9 @@ bool CPVRTimersContainer::UpdateFromClient(const std::shared_ptr<CPVRTimerInfoTa
std::shared_ptr<CPVRTimerInfoTag> CPVRTimersContainer::GetByClient(int iClientId, int iClientIndex) const
{
CSingleLock lock(m_critSection);
for (const auto startDates : m_tags)
for (const auto& startDates : m_tags)
{
for (const auto timer : startDates.second)
for (const auto& timer : startDates.second)
{
if (timer->m_iClientId == iClientId && timer->m_iClientIndex == iClientIndex)
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/windows/GUIWindowPVRChannels.cpp
Expand Up @@ -328,7 +328,7 @@ void CGUIWindowPVRChannelsBase::OnInputDone()
if (channelNumber.IsValid())
{
int itemIndex = 0;
for (const CFileItemPtr channel : *m_vecItems)
for (const CFileItemPtr& channel : *m_vecItems)
{
if (channel->GetPVRChannelInfoTag()->ChannelNumber() == channelNumber)
{
Expand Down