Skip to content

Commit

Permalink
Qt Plugin: Add quit() signal.
Browse files Browse the repository at this point in the history
  • Loading branch information
antony-jr committed Mar 10, 2021
1 parent bc3504e commit a93e268
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/ClassQAppImageUpdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ All methods in this class is [reentrant](https://doc.qt.io/qt-5/threads-reentran
| void | [error(short, short)](#void-errorshort-errorcode-short-action) |
| void | [progress(int, qint64, qint64, double, QString, short)](#void-progressint-percentage--qint64-bytesreceived--qint64-bytestotal--double-speed--qstring-speedunits-short-action) |
| void | [logger(QString, QString)](#void-loggerqstring--qstring) |
| void | [quit()](#void-quit) |


## Static Public Members
Expand Down Expand Up @@ -392,6 +393,12 @@ Emitted when the updater issues a log message with the *first QString* as the lo
the *second QString* as the path to the respective AppImage.


### void quit()
<p align="right"> <code>[SIGNAL]</code> </p>

Emitted when it's required quit the current application when using the GUI updater.


## QString errorCodeToString(short errorCode)
<p align="right"> <code>[STATIC]</code> </p>

Expand Down
8 changes: 7 additions & 1 deletion docs/PluginInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ I'm not sure about other Qt bindings, So help is much welcomed.
| [error(short, short)](#errorshort-errorcode-short-action) | Emitted when some error occurs in an action. |
| [progress(int, qint64, qint64, double, QString, short)](#progressint-percentage--qint64-bytesreceived--qint64-bytestotal--double-speed--qstring-speedunits-short-action) | Emitted on progress of a action. |
| [logger(QString, QString)](#loggerqstring--qstring) | See here for more information. |

| [quit()](#quit) | Emitted when it's desired to quit current application. |

## Actions

Expand Down Expand Up @@ -341,6 +341,12 @@ The updater's progress is emitted through this unified signal.
Emitted when the updater issues a log message with the *first QString* as the log message and
the *second QString* as the path to the respective AppImage.

### quit()
<p align="right"> <code>[SIGNAL]</code> </p>

Emitted when it's desired to quit the current application when using GUI update.


### QObject\* getObject()

Returns the QObject pointer. Useful when using this plugin in C++.
Expand Down
1 change: 1 addition & 0 deletions include/qappimageupdateinterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class QAppImageUpdateInterface {
virtual void progress(int, qint64, qint64, double, QString, short) = 0;
virtual void logger(QString, QString) = 0;
virtual void error(short, short) = 0;
virtual void quit() = 0;
};

#ifndef QAppImageUpdateInterface_iid
Expand Down
1 change: 1 addition & 0 deletions include/qappimageupdateinterfaceimpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class QAppImageUpdateInterfaceImpl : public QObject, QAppImageUpdateInterface {
void progress(int, qint64, qint64, double, QString, short);
void logger(QString, QString);
void error(short, short);
void quit();
private:
QScopedPointer<QAppImageUpdate> m_Private;
};
Expand Down
2 changes: 2 additions & 0 deletions src/qappimageupdateinterfaceimpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ QAppImageUpdateInterfaceImpl::QAppImageUpdateInterfaceImpl(QObject *parent)
this, &QAppImageUpdateInterfaceImpl::logger, Qt::DirectConnection);
connect(s, &QAppImageUpdate::error,
this, &QAppImageUpdateInterfaceImpl::error, Qt::DirectConnection);
connect(s, &QAppImageUpdate::quit,
this, &QAppImageUpdateInterfaceImpl::quit, Qt::DirectConnection);
}

QAppImageUpdateInterfaceImpl::~QAppImageUpdateInterfaceImpl() {
Expand Down

0 comments on commit a93e268

Please sign in to comment.