Go to the documentation of this file.
14 #include <QCoreApplication>
37 void run(
void)
override
48 QMutexLocker locker(&
m_lock);
59 QMutexLocker locker(&
m_lock);
71 QMutexLocker locker(&
m_lock);
86 QCoreApplication::postEvent(
95 QMutexLocker locker(&
m_lock);
101 QMutexLocker locker(&
m_lock);
118 QMutexLocker locker(&
m_lock);
124 if (!it->GetChanID())
127 m_cache[it->GetRecordingID()] = it;
135 Cache::iterator it =
m_cache.begin();
136 Cache::iterator nit = it;
137 for (; it !=
m_cache.end(); it = nit)
142 if ((*it)->GetAvailableStatus() ==
asDeleted)
156 QMutexLocker locker(&
m_lock);
161 (*it)->clone(pginfo,
true);
172 QMutexLocker locker(&
m_lock);
174 Cache::iterator it =
m_cache.find(recordingID);
178 (*it)->SetFilesize(filesize);
180 (*it)->SetAvailableStatus(
asAvailable,
"PIC::UpdateFileSize");
191 QMutexLocker locker(&
m_lock);
193 Cache::const_iterator it =
m_cache.find(recordingID);
197 recgroup = (*it)->GetRecordingGroup();
220 Cache::iterator it =
m_cache.find(recordingID);
223 (*it)->SetAvailableStatus(
asDeleted,
"PIC::Remove");
251 std::sort(list.begin(), list.end(), reversePISort);
253 std::sort(list.begin(), list.end(), PISort);
259 Cache::const_iterator it =
m_cache.find(recordingID);
270 for (
const auto & pi : qAsConst(
m_cache))
void Add(const ProgramInfo &pginfo)
Adds a ProgramInfo to the cache.
ProgramInfoLoader(ProgramInfoCache &c, const bool updateUI)
long long copy(QFile &dst, QFile &src, uint block_size)
Copies src file to dst file.
QString GetRecGroup(uint recordingID) const
Returns the ProgramInfo::recgroup or an empty string if not found.
bool Update(const ProgramInfo &pginfo)
Updates a ProgramInfo in the cache.
void GetOrdered(std::vector< ProgramInfo * > &list, bool newest_first=false)
uint GetRecordingID(void) const
This class is used as a container for messages.
friend class ProgramInfoLoader
QDateTime GetRecordingStartTime(void) const
Approximate time the recording started.
vector< ProgramInfo * > * RemoteGetRecordedList(int sort)
void ScheduleLoad(bool updateUI=true)
ProgramInfo * GetRecordingInfo(uint recordingID) const
void Refresh(void)
Refreshed the cache.
static void free_vec(VPI_ptr &v)
void WaitForLoadToComplete(void) const
bool IsLoadInProgress(void) const
void Load(bool updateUI=true)
ProgramInfoCache & m_cache
uint GetChanID(void) const
This is the unique key used in the database to locate tuning information.
Holds information on recordings and videos.
vector< ProgramInfo * > * VPI_ptr
QWaitCondition m_loadWait
bool Remove(uint recordingID)
Marks a ProgramInfo in the cache for deletion on the next call to Refresh().
bool UpdateFileSize(uint recordingID, uint64_t filesize)
Updates a ProgramInfo in the cache.
static MThreadPool * globalInstance(void)
void Clear(void)
Clears the cache, m_lock must be held when this is called.
void start(QRunnable *runnable, const QString &debugName, int priority=0)
std::vector< ProgramInfo * > * m_nextCache