QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlMovieNewVersion Class Reference

A class to check the existence of a new version of the application on the network. More...

Inheritance diagram for QtlMovieNewVersion:

Public Member Functions

 QtlMovieNewVersion (bool silent, bool autoDelete, QtlMovieSettings *settings, QtlLogger *log, QObject *parent=0)
 Constructor. More...
 

Private Slots

void downloadLatestVersion ()
 Invoked when the user wants to download the last version. More...
 
void httpCompleted (bool success, const QUrl &url, const QString &response, const QString &mimeType)
 Invoked when the Web request is completed. More...
 
void releaseNotesCompleted (bool success, const QUrl &url, const QString &response, const QString &mimeType)
 Invoked when the Web request for release notes is completed. More...
 

Private Member Functions

 QtlMovieNewVersion () Q_DECL_EQ_DELETE
 
void displayReleaseNotes ()
 Display the new version message with release notes. More...
 
void fail (const QString &message)
 Terminate the operation with error. More...
 
void succeed ()
 Terminate the operation with success. More...
 

Private Attributes

bool _autoDelete
 Delete itself after completion of all requests. More...
 
QtlVersion _currentVersion
 Current version of the application. More...
 
QString _latestUrl
 Download URL of the latest available version. More...
 
QtlVersion _latestVersion
 Latest available version of the application. More...
 
QtlLogger_log
 Message logger. More...
 
bool _newerVersion
 Newer version found. More...
 
QtlSimpleWebRequest _newVersionRequest
 Web request for new version. More...
 
QString _releaseNotes
 Text of the release notes. More...
 
QtlSimpleWebRequest _releaseNotesRequest
 Web request for the content of the release notes. More...
 
QtlMovieSettings_settings
 Application settings. More...
 
bool _silent
 Do not report the errors or absence of new version. More...
 
QString _statusMessage
 Message to display about the new version. More...
 

Detailed Description

A class to check the existence of a new version of the application on the network.

This class requires the cooperation of a server. An instance of this class sends a Web request to a server using a cookie describing the current platform (a Base64-encoded JSON structure). The server is responsible for finding a new version for this platform, if available, and returns the response as a JSON structure.

For debug purpose, the environment variable QTLMOVIE_NEWVERSION_URL can be set to an alternate server. If this URL is defined, it overrides any application-defined URL.

Constructor & Destructor Documentation

◆ QtlMovieNewVersion() [1/2]

QtlMovieNewVersion::QtlMovieNewVersion ( bool  silent,
bool  autoDelete,
QtlMovieSettings settings,
QtlLogger log,
QObject *  parent = 0 
)

Constructor.

The search for a new version is automatically started.

Parameters
[in]silentIf true, do not report the errors or absence of new version.
[in]autoDeleteIf true, this object deletes itself after completion of all requests.
[in]settingsApplication settings.
[in]logMessage logger.
[in]parentOptional parent object.

◆ QtlMovieNewVersion() [2/2]

QtlMovieNewVersion::QtlMovieNewVersion ( )
private

Member Function Documentation

◆ httpCompleted

void QtlMovieNewVersion::httpCompleted ( bool  success,
const QUrl &  url,
const QString &  response,
const QString &  mimeType 
)
privateslot

Invoked when the Web request is completed.

Parameters
[in]successTrue on success, false on error (network error for instance).
[in]urlURL of the returned content. May not be the same as the original URL is some redirection occured.
[in]responseIf success is true, contains the text of the response. If status is false, contains an error message.
[in]mimeTypeIf success is true, contains the MIME type of the response.

◆ releaseNotesCompleted

void QtlMovieNewVersion::releaseNotesCompleted ( bool  success,
const QUrl &  url,
const QString &  response,
const QString &  mimeType 
)
privateslot

Invoked when the Web request for release notes is completed.

Parameters
[in]successTrue on success, false on error (network error for instance).
[in]urlURL of the returned content. May not be the same as the original URL is some redirection occured.
[in]responseIf success is true, contains the text of the response. If status is false, contains an error message.
[in]mimeTypeIf success is true, contains the MIME type of the response.

◆ downloadLatestVersion

void QtlMovieNewVersion::downloadLatestVersion ( )
privateslot

Invoked when the user wants to download the last version.

◆ fail()

void QtlMovieNewVersion::fail ( const QString &  message)
private

Terminate the operation with error.

Parameters
[in]messageError message.

◆ succeed()

void QtlMovieNewVersion::succeed ( )
private

Terminate the operation with success.

◆ displayReleaseNotes()

void QtlMovieNewVersion::displayReleaseNotes ( )
private

Display the new version message with release notes.

Member Data Documentation

◆ _settings

QtlMovieSettings* QtlMovieNewVersion::_settings
private

Application settings.

◆ _log

QtlLogger* QtlMovieNewVersion::_log
private

Message logger.

◆ _silent

bool QtlMovieNewVersion::_silent
private

Do not report the errors or absence of new version.

◆ _autoDelete

bool QtlMovieNewVersion::_autoDelete
private

Delete itself after completion of all requests.

◆ _currentVersion

QtlVersion QtlMovieNewVersion::_currentVersion
private

Current version of the application.

◆ _newVersionRequest

QtlSimpleWebRequest QtlMovieNewVersion::_newVersionRequest
private

Web request for new version.

◆ _releaseNotesRequest

QtlSimpleWebRequest QtlMovieNewVersion::_releaseNotesRequest
private

Web request for the content of the release notes.

◆ _latestVersion

QtlVersion QtlMovieNewVersion::_latestVersion
private

Latest available version of the application.

◆ _latestUrl

QString QtlMovieNewVersion::_latestUrl
private

Download URL of the latest available version.

◆ _newerVersion

bool QtlMovieNewVersion::_newerVersion
private

Newer version found.

◆ _statusMessage

QString QtlMovieNewVersion::_statusMessage
private

Message to display about the new version.

◆ _releaseNotes

QString QtlMovieNewVersion::_releaseNotes
private

Text of the release notes.


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