QGIS API Documentation 3.39.0-Master (9ea1ddbe645)
|
FetchedContent holds useful information about a network content being fetched. More...
#include <qgsnetworkcontentfetcherregistry.h>
Public Types | |
enum | ContentStatus { NotStarted , Downloading , Finished , Failed } |
Status of fetched content. More... | |
Public Slots | |
void | cancel () |
Cancel the download operation. | |
void | download (bool redownload=false) |
Start the download. | |
Signals | |
void | errorOccurred (QNetworkReply::NetworkError code, const QString &errorMsg) |
Emitted when an error with code error occurred while processing the request errorMsg is a textual description of the error. | |
void | fetched () |
Emitted when the file is fetched and accessible. | |
Public Member Functions | |
QgsFetchedContent (const QString &url, QTemporaryFile *file=nullptr, ContentStatus status=NotStarted, const QString &authConfig=QString()) | |
Constructs a FetchedContent with pointer to the downloaded file and status of the download. | |
~QgsFetchedContent () override | |
QString | authConfig () const |
Returns the authentication configuration id use for this fetched content. | |
QNetworkReply::NetworkError | error () const |
Returns the potential error of the download. | |
QFile * | file () const |
Returns a pointer to the local file, or nullptr if the file is not accessible yet. | |
const QString | filePath () const |
Returns the path to the local file, an empty string if the file is not accessible yet. | |
ContentStatus | status () const |
Returns the status of the download. | |
FetchedContent holds useful information about a network content being fetched.
Definition at line 41 of file qgsnetworkcontentfetcherregistry.h.
Status of fetched content.
Enumerator | |
---|---|
NotStarted | No download started for such URL. |
Downloading | Currently downloading. |
Finished | Download finished and successful. |
Failed | Download failed. |
Definition at line 46 of file qgsnetworkcontentfetcherregistry.h.
|
inlineexplicit |
Constructs a FetchedContent with pointer to the downloaded file and status of the download.
Definition at line 55 of file qgsnetworkcontentfetcherregistry.h.
|
inlineoverride |
Definition at line 63 of file qgsnetworkcontentfetcherregistry.h.
|
inline |
Returns the authentication configuration id use for this fetched content.
Definition at line 88 of file qgsnetworkcontentfetcherregistry.h.
|
slot |
Cancel the download operation.
Definition at line 144 of file qgsnetworkcontentfetcherregistry.cpp.
|
slot |
Start the download.
redownload | if set to true , it will restart any achieved or pending download. |
Definition at line 118 of file qgsnetworkcontentfetcherregistry.cpp.
|
inline |
Returns the potential error of the download.
Definition at line 83 of file qgsnetworkcontentfetcherregistry.h.
|
signal |
Emitted when an error with code error occurred while processing the request errorMsg is a textual description of the error.
|
signal |
Emitted when the file is fetched and accessible.
|
inline |
Returns a pointer to the local file, or nullptr
if the file is not accessible yet.
Definition at line 73 of file qgsnetworkcontentfetcherregistry.h.
|
inline |
Returns the path to the local file, an empty string if the file is not accessible yet.
Definition at line 77 of file qgsnetworkcontentfetcherregistry.h.
|
inline |
Returns the status of the download.
Definition at line 80 of file qgsnetworkcontentfetcherregistry.h.