#include <icecast.h>
Public Member Functions | |
icecast (QObject *parent) | |
virtual | ~icecast () |
Private Slots | |
void | process_file (KJob *job) |
void | use_data (icecast_internalThread::streamEntryList list) |
Private Attributes | |
KTempDir | m_tempdir |
QPointer< KIO::CopyJob > | m_copyjob |
icecast_internalThread | m_thread |
This class provides Icecast streams (http://icecast.org) as Qt model derived from streamDirectoryModel.
Internally, it downloads from icecast.org a file with the list of streams and processes it to provide the information in form of a Qt model. Download and processing is done in a separate thread which is started on instanciating the class. It will take some seconds, but as the work in done in it's own thread, it will not block your UI.
Definition at line 40 of file icecast.h.
icecast::icecast | ( | QObject * | parent | ) | [explicit] |
Constructor of the class.
parent | Sets the parent widget of this object. |
Definition at line 25 of file icecast.cpp.
References m_copyjob, m_tempdir, and process_file().
icecast::~icecast | ( | ) | [virtual] |
void icecast::process_file | ( | KJob * | job | ) | [private, slot] |
Starts the processing of the downloaded file with the stream list if there didn't happen errors while the download.
Definition at line 44 of file icecast.cpp.
References m_tempdir, m_thread, icecast_internalThread::setFilename(), and use_data().
Referenced by icecast().
void icecast::use_data | ( | icecast_internalThread::streamEntryList | list | ) | [private, slot] |
Publicate the result of m_thread.
Definition at line 56 of file icecast.cpp.
References streamDirectoryEntry::appendChild(), m_tempdir, and streamDirectoryModel::rootEntry.
Referenced by process_file().
QPointer<KIO::CopyJob> icecast::m_copyjob [private] |
A guarded pointer to our copy job.
Definition at line 60 of file icecast.h.
Referenced by icecast(), and ~icecast().
KTempDir icecast::m_tempdir [private] |
The temporary directory which is used to download the stream list.
We download the file here and not in the thread because the KIO library is not reentrant or even thread save.
Definition at line 58 of file icecast.h.
Referenced by icecast(), process_file(), and use_data().
icecast_internalThread icecast::m_thread [private] |
Used to download the list of streams and process them in a separate thread.
Definition at line 62 of file icecast.h.
Referenced by process_file().