Skip to content

Commit

Permalink
[EPG] Cleanup: Remove a bunch of unused member functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksooo committed Jun 19, 2016
1 parent e38907f commit df8a2bc
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 272 deletions.
78 changes: 0 additions & 78 deletions xbmc/epg/Epg.cpp
Expand Up @@ -111,17 +111,6 @@ void CEpg::SetName(const std::string &strName)
}
}

void CEpg::SetScraperName(const std::string &strScraperName)
{
CSingleLock lock(m_critSection);

if (m_strScraperName != strScraperName)
{
m_bChanged = true;
m_strScraperName = strScraperName;
}
}

void CEpg::SetUpdatePending(bool bUpdatePending /* = true */)
{
{
Expand Down Expand Up @@ -253,18 +242,6 @@ bool CEpg::CheckPlayingEvent(void)
return false;
}

CEpgInfoTagPtr CEpg::GetTag(const CDateTime &StartTime) const
{
CSingleLock lock(m_critSection);
std::map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.find(StartTime);
if (it != m_tags.end())
{
return it->second;
}

return CEpgInfoTagPtr();
}

CEpgInfoTagPtr CEpg::GetTagByBroadcastId(unsigned int iUniqueBroadcastId) const
{
if (iUniqueBroadcastId != EPG_TAG_INVALID_UID)
Expand All @@ -291,18 +268,6 @@ CEpgInfoTagPtr CEpg::GetTagBetween(const CDateTime &beginTime, const CDateTime &
return CEpgInfoTagPtr();
}

CEpgInfoTagPtr CEpg::GetTagAround(const CDateTime &time) const
{
CSingleLock lock(m_critSection);
for (std::map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.begin(); it != m_tags.end(); ++it)
{
if ((it->second->StartAsUTC() < time) && (it->second->EndAsUTC() > time))
return it->second;
}

return CEpgInfoTagPtr();
}

void CEpg::AddEntry(const CEpgInfoTag &tag)
{
CEpgInfoTagPtr newTag;
Expand Down Expand Up @@ -830,17 +795,6 @@ const std::string &CEpg::ConvertGenreIdToString(int iID, int iSubID)
return g_localizeStrings.Get(iLabelId);
}

bool CEpg::IsRadio(void) const
{
CSingleLock lock(m_critSection);
return m_pvrChannel ? m_pvrChannel->IsRadio() : false;
}

bool CEpg::IsRemovableTag(const CEpgInfoTag &tag) const
{
return !tag.HasTimer();
}

bool CEpg::LoadFromClients(time_t start, time_t end)
{
bool bReturn(false);
Expand Down Expand Up @@ -872,20 +826,6 @@ CEpgInfoTagPtr CEpg::GetNextEvent(const CEpgInfoTag& tag) const
return retVal;
}

CEpgInfoTagPtr CEpg::GetPreviousEvent(const CEpgInfoTag& tag) const
{
CSingleLock lock(m_critSection);
std::map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.find(tag.StartAsUTC());
if (it != m_tags.end() && it != m_tags.begin())
{
--it;
return it->second;
}

CEpgInfoTagPtr retVal;
return retVal;
}

CPVRChannelPtr CEpg::Channel(void) const
{
CSingleLock lock(m_critSection);
Expand All @@ -898,18 +838,6 @@ int CEpg::ChannelID(void) const
return m_pvrChannel ? m_pvrChannel->ChannelID() : -1;
}

int CEpg::ChannelNumber(void) const
{
CSingleLock lock(m_critSection);
return m_pvrChannel ? m_pvrChannel->ChannelNumber() : -1;
}

int CEpg::SubChannelNumber(void) const
{
CSingleLock lock(m_critSection);
return m_pvrChannel ? m_pvrChannel->SubChannelNumber() : -1;
}

void CEpg::SetChannel(const PVR::CPVRChannelPtr &channel)
{
CSingleLock lock(m_critSection);
Expand All @@ -926,12 +854,6 @@ void CEpg::SetChannel(const PVR::CPVRChannelPtr &channel)
}
}

bool CEpg::HasPVRChannel(void) const
{
CSingleLock lock(m_critSection);
return m_pvrChannel != NULL;
}

bool CEpg::UpdatePending(void) const
{
CSingleLock lock(m_critSection);
Expand Down
39 changes: 0 additions & 39 deletions xbmc/epg/Epg.h
Expand Up @@ -82,8 +82,6 @@ namespace EPG
PVR::CPVRChannelPtr Channel(void) const;

int ChannelID(void) const;
int ChannelNumber(void) const;
int SubChannelNumber(void) const;

/*!
* @brief Channel the channel tag linked to this EPG table.
Expand All @@ -97,12 +95,6 @@ namespace EPG
*/
const std::string &ScraperName(void) const { return m_strScraperName; }

/*!
* @brief Change the name of the scraper to use.
* @param strScraperName The new scraper.
*/
void SetScraperName(const std::string &strScraperName);

/*!
* @brief Specify if EPG should be manually updated on the next cycle
* @param bUpdatePending True if EPG should be manually updated
Expand Down Expand Up @@ -144,11 +136,6 @@ namespace EPG
*/
bool HasValidEntries(void) const;

/*!
* @return True if this EPG has a PVR channel set, false otherwise.
*/
bool HasPVRChannel(void) const;

/*!
* @brief Remove all entries from this EPG that finished before the given time
* and that have no timers set.
Expand Down Expand Up @@ -179,13 +166,6 @@ namespace EPG
*/
CEpgInfoTagPtr GetTagNext() const;

/*!
* @brief Get the event that occurs at the given time.
* @param time The time in UTC to find the event for.
* @return The found tag or NULL if it wasn't found.
*/
CEpgInfoTagPtr GetTagAround(const CDateTime &time) const;

/*!
* Get the event that occurs between the given begin and end time.
* @param beginTime Minimum start time in UTC of the event.
Expand All @@ -194,17 +174,6 @@ namespace EPG
*/
CEpgInfoTagPtr GetTagBetween(const CDateTime &beginTime, const CDateTime &endTime) const;

/*!
* @brief Get the infotag with the given begin time.
*
* Get the infotag with the given ID.
* If it wasn't found, try finding the event with the given start time
*
* @param beginTime The start time in UTC of the event to find if it wasn't found by it's unique ID.
* @return The found tag or an empty tag if it wasn't found.
*/
CEpgInfoTagPtr GetTag(const CDateTime &beginTime) const;

/*!
* @brief Get the event matching the given unique broadcast id
* @param iUniqueBroadcastId The uid to look up
Expand Down Expand Up @@ -299,13 +268,7 @@ namespace EPG
*/
bool UpdateEntry(const EPG_TAG *data, bool bUpdateDatabase = false);

/*!
* @return True if this is an EPG table for a radio channel, false otherwise.
*/
bool IsRadio(void) const;

CEpgInfoTagPtr GetNextEvent(const CEpgInfoTag& tag) const;
CEpgInfoTagPtr GetPreviousEvent(const CEpgInfoTag& tag) const;

size_t Size(void) const;

Expand Down Expand Up @@ -367,8 +330,6 @@ namespace EPG
*/
bool UpdateEntries(const CEpg &epg, bool bStoreInDb = true);

bool IsRemovableTag(const EPG::CEpgInfoTag &tag) const;

std::map<CDateTime, CEpgInfoTagPtr> m_tags;
std::map<int, CEpgInfoTagPtr> m_changedTags;
std::map<int, CEpgInfoTagPtr> m_deletedTags;
Expand Down
37 changes: 0 additions & 37 deletions xbmc/epg/EpgContainer.cpp
Expand Up @@ -272,14 +272,6 @@ void CEpgContainer::LoadFromDB(void)
m_bLoaded = bLoaded;
}

bool CEpgContainer::PersistTables(void)
{
m_critSection.lock();
auto copy = m_epgs;
m_critSection.unlock();
return m_database.Persist(copy);
}

bool CEpgContainer::PersistAll(void)
{
bool bReturn(true);
Expand Down Expand Up @@ -397,18 +389,6 @@ CEpgInfoTagPtr CEpgContainer::GetTagById(const CPVRChannelPtr &channel, unsigned
return retval;
}

CEpgPtr CEpgContainer::GetByChannel(const CPVRChannel &channel) const
{
CSingleLock lock(m_critSection);
for (const auto &epgEntry : m_epgs)
{
if (channel.ChannelID() == epgEntry.second->ChannelID())
return epgEntry.second;
}

return CEpgPtr();
}

void CEpgContainer::InsertFromDatabase(int iEpgID, const std::string &strName, const std::string &strScraperName)
{
// table might already have been created when pvr channels were loaded
Expand Down Expand Up @@ -698,17 +678,6 @@ bool CEpgContainer::UpdateEPG(bool bOnlyPending /* = false */)
return !bInterrupted;
}

int CEpgContainer::GetEPGAll(CFileItemList &results)
{
int iInitialSize = results.Size();

CSingleLock lock(m_critSection);
for (const auto &epgEntry : m_epgs)
epgEntry.second->Get(results);

return results.Size() - iInitialSize;
}

const CDateTime CEpgContainer::GetFirstEPGDate(void)
{
CDateTime returnValue;
Expand Down Expand Up @@ -794,12 +763,6 @@ bool CEpgContainer::CheckPlayingEvents(void)
return bReturn;
}

bool CEpgContainer::IsInitialising(void) const
{
CSingleLock lock(m_critSection);
return m_bIsInitialising;
}

void CEpgContainer::SetHasPendingUpdates(bool bHasPendingUpdates /* = true */)
{
CSingleLock lock(m_critSection);
Expand Down
21 changes: 0 additions & 21 deletions xbmc/epg/EpgContainer.h
Expand Up @@ -133,13 +133,6 @@ namespace EPG
*/
virtual int GetEPGSearch(CFileItemList &results, const EpgSearchFilter &filter);

/*!
* @brief Get all EPG tables.
* @param results The fileitem list to store the results in.
* @return The amount of entries that were added.
*/
virtual int GetEPGAll(CFileItemList &results);

/*!
* @brief Get the start time of the first entry.
* @return The start time.
Expand Down Expand Up @@ -167,13 +160,6 @@ namespace EPG
*/
virtual CEpgInfoTagPtr GetTagById(const PVR::CPVRChannelPtr &channel, unsigned int iBroadcastId) const;

/*!
* @brief Get an EPG table given a PVR channel.
* @param channel The channel to get the EPG table for.
* @return The table or NULL if it wasn't found.
*/
virtual CEpgPtr GetByChannel(const PVR::CPVRChannel &channel) const;

/*!
* @brief Notify EPG table observers when the currently active tag changed.
* @return True if the check was done, false if it was not the right time to check
Expand Down Expand Up @@ -228,19 +214,12 @@ namespace EPG
*/
void SetHasPendingUpdates(bool bHasPendingUpdates = true);

/*!
* @return True while being initialised.
*/
bool IsInitialising(void) const;

/*!
* @brief Call Persist() on each table
* @return True when they all were persisted, false otherwise.
*/
bool PersistAll(void);

bool PersistTables(void);

/*!
* @brief client can trigger an update request for a channel
*/
Expand Down
5 changes: 0 additions & 5 deletions xbmc/epg/EpgInfoTag.cpp
Expand Up @@ -290,11 +290,6 @@ CEpgInfoTagPtr CEpgInfoTag::GetNextEvent(void) const
return GetTable()->GetNextEvent(*this);
}

CEpgInfoTagPtr CEpgInfoTag::GetPreviousEvent(void) const
{
return GetTable()->GetPreviousEvent(*this);
}

void CEpgInfoTag::SetUniqueBroadcastID(unsigned int iUniqueBroadcastID)
{
m_iUniqueBroadcastID = iUniqueBroadcastID;
Expand Down
19 changes: 2 additions & 17 deletions xbmc/epg/EpgInfoTag.h
Expand Up @@ -68,17 +68,8 @@ namespace EPG
*/
CEpgInfoTag(CEpg *epg, PVR::CPVRChannelPtr pvrChannel, const std::string &strTableName = "", const std::string &strIconPath = "");

// Prevent copy construction, even for CEpgInfoTag instances and friends.
// Note: Only declared, but intentionally not implemented
// to prevent compiler generated copy ctor and to force
// a linker error in case somebody tries to call it.
CEpgInfoTag(const CEpgInfoTag &tag);

// Prevent copy by assignment, even for CEpgInfoTag instances and friends.
// Note: Only declared, but intentionally not implemented
// to prevent compiler generated assignment operator and to force
// a linker error in case somebody tries to call it.
CEpgInfoTag &operator =(const CEpgInfoTag &other);
CEpgInfoTag(const CEpgInfoTag &tag) = delete;
CEpgInfoTag &operator =(const CEpgInfoTag &other) = delete;

public:
virtual ~CEpgInfoTag();
Expand Down Expand Up @@ -120,12 +111,6 @@ namespace EPG
*/
CEpgInfoTagPtr GetNextEvent(void) const;

/*!
* @brief Get a pointer to the previous event. Set by CEpg in a call to Sort()
* @return A pointer to the previous event or NULL if it's not set.
*/
CEpgInfoTagPtr GetPreviousEvent(void) const;

/*!
* @brief The table this event belongs to
* @return The table this event belongs to
Expand Down

0 comments on commit df8a2bc

Please sign in to comment.