icecast Class Reference

Provides Icecast streams as Qt model. More...

#include <icecast.h>

Inheritance diagram for icecast:

Inheritance graph
[legend]
Collaboration diagram for icecast:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

Provides Icecast streams as Qt model.

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.


Constructor & Destructor Documentation

icecast::icecast ( QObject *  parent  )  [explicit]

Constructor of the class.

Parameters:
parent Sets the parent widget of this object.

Definition at line 25 of file icecast.cpp.

References m_copyjob, m_tempdir, and process_file().

Here is the call graph for this function:

icecast::~icecast (  )  [virtual]

The desctructor.

Definition at line 37 of file icecast.cpp.

References m_copyjob.


Member Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

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.

Note:
We use a directory and not a simple temporary file because there were problems to overwrite an yet existing file with KIO.

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().

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().


The documentation for this class was generated from the following files:

doxygen