| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SoftwareUpdate Class Reference

The SoftwareUpdate class provides an interface for checking for software updates and engaging the update process. More...

`#include <software_update.h>`

Inheritance diagram for SoftwareUpdate:

## Signals
void | updateAvailable (QString newVersion, QString releaseNotes)
void | updateCheckFailed (const QString &errorString)
void | updateEngaged ()
void | appShutdownRequested (ShutdownEvent *shutdownEvent)

## Public Member Functions
| SoftwareUpdate (const SoftwareUpdate &)=delete
SoftwareUpdate & | operator= (const SoftwareUpdate &)=delete
void | init (bool runWithoutSilentCheck=false)
void | cleanup ()
void | startAutoCheck (int intervalSeconds=0)
void | stopAutoCheck ()
bool | isAutoCheckEnabled () const

## Static Public Member Functions
static SoftwareUpdate * | instance ()
static void | performUIUpdate ()
static QString | info ()
static bool | plattformSupported ()

## Protected Member Functions
| SoftwareUpdate (QObject *parent=nullptr)

## Detailed Description

The SoftwareUpdate class provides an interface for checking for software updates and engaging the update process.

This class is implemented as a singleton and can be accessed through the static instance() method. It provides methods for initializing and cleaning up the update framework, as well as for starting and stopping automatic update checks. The class also emits signals when updates are available, when update checks fail, when the update process is engaged, and when the application requests a shutdown for performing an update.

## Member Function Documentation

## ◆ appShutdownRequested

void SoftwareUpdate::appShutdownRequested | ( | ShutdownEvent * | shutdownEvent | ) |
| signal

Emitted when the application requests a shutdown (because it will perform an update).

## ◆ cleanup()

void SoftwareUpdate::cleanup | ( |  | ) |

Cleans up the update framework and stops the automatic update check.

## ◆ info()

QString SoftwareUpdate::info | ( |  | ) |
| static

Returns a string with the information about which software update framework is being used.

## ◆ init()

void SoftwareUpdate::init | ( | bool | runWithoutSilentCheck = `false` | ) |

This method will be called by the main application after it has initialized far enough that the update frameworks can be initialized. Together with that the automatic update check will also be started, if the user has enabled it in the preferences. The interval used will be the one set in the preferences as well.

Parameters

  runWithoutSilentCheck | If true, the update check will be performed as it had been before the silent check was implemented, by using the API versions of the silent checks.

HAVE_SOFTWARE_UPDATE

## ◆ performUIUpdate()

void SoftwareUpdate::performUIUpdate | ( |  | ) |
| static

This will initiate the UI update process. It is assumed, that if the periodic update check is enabled, this will be called by the user by interacting with the update notification. It will also be called when clicking on the "Check for updates" action in the "Help" menu.

The "normal" flow is, that we periodically check for updates in the background and notify the user if an update is available. It is then up to the user to decide if they want to update or not.

## ◆ plattformSupported()

bool SoftwareUpdate::plattformSupported | ( |  | ) |
| static

A runtime "wrapper" for HAVE_SOFTWARE_UPDATE and including platform checks. This can be used by the UI to check if an update is currently supported and possible or not.

Returns
  true The platform is supported
  false The platform is not supported

## ◆ updateAvailable

void SoftwareUpdate::updateAvailable | ( | QString | newVersion,
|  | QString | releaseNotes
| ) |  |
| signal

Emitted when a new software update is available.

## ◆ updateCheckFailed

void SoftwareUpdate::updateCheckFailed | ( | const QString & | errorString | ) |
| signal

Emitted when the update check fails.

## ◆ updateEngaged

void SoftwareUpdate::updateEngaged | ( |  | ) |
| signal

Emitted when the update process is engaged. This will be emitted in either of the following cases:

1. The user has accepted to update after being notified about an available update.
2. The user has accepted to update after manually checking for updates through the UI
3. The user has been presented with the update dialog but dismissed it
4. The user has been presented with the update dialog but cancelled it
5. The update process has failed

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

- /builds/wireshark/wireshark/ui/qt/utils/software_update.h
- /builds/wireshark/wireshark/ui/qt/utils/software_update.cpp