ImageFetcher Class Reference

ImageFetcher handles requests to get images. More...

#include <imagefetcher.h>

Collaboration diagram for ImageFetcher:
Collaboration graph
[legend]

List of all members.

Public Slots

void fetchImage (const QUrl &url)
 Fecth image from given url.

Signals

void imageReceived (const QUrl &url, const QPixmap &image)
 Signal which is emitted when image is received from the server and loaded to pixmap.
void error (const QString &message)
 Signal which is emitted when there is error in network reply.

Public Member Functions

 ImageFetcher (NetworkAccessManager *manager, QObject *parent=0)
 Default constructor.

Private Slots

void downloadFinished (QNetworkReply *reply)
 This slot is called when network manager has finished the download. Loads image and emits imageReceived signal with url and image. If there was a error in reply emits error-signal.
void startNextDownload ()
 This slot is called when next download is started. Takes url from queue, sends request and puts request to download queue.

Private Attributes

QList< QNetworkReply * > m_currentDownloads
 List of current downloads.
QQueue< QUrl > m_downloadQueue
 Queue of pending requests.
NetworkAccessManagerm_manager
 Network access manager.

Detailed Description

ImageFetcher handles requests to get images.

Author:
Henri Lampela

Constructor & Destructor Documentation

ImageFetcher::ImageFetcher ( NetworkAccessManager manager,
QObject *  parent = 0 
)

Default constructor.

Parameters:
manager QNetworkAccessManager
parent Parent object

Member Function Documentation

void ImageFetcher::downloadFinished ( QNetworkReply *  reply  )  [private, slot]

This slot is called when network manager has finished the download. Loads image and emits imageReceived signal with url and image. If there was a error in reply emits error-signal.

Parameters:
reply 
void ImageFetcher::error ( const QString &  message  )  [signal]

Signal which is emitted when there is error in network reply.

Parameters:
message error message
void ImageFetcher::fetchImage ( const QUrl &  url  )  [slot]

Fecth image from given url.

Parameters:
url Image url
void ImageFetcher::imageReceived ( const QUrl &  url,
const QPixmap &  image 
) [signal]

Signal which is emitted when image is received from the server and loaded to pixmap.

Parameters:
url URL to image
image image QPixmap

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

Generated on Thu Jun 10 09:44:02 2010 for Situare client for Maemo by  doxygen 1.6.1