Skip to content

Commit a93e268

Browse files
committed
Qt Plugin: Add quit() signal.
1 parent bc3504e commit a93e268

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

docs/ClassQAppImageUpdate.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ All methods in this class is [reentrant](https://doc.qt.io/qt-5/threads-reentran
5858
| void | [error(short, short)](#void-errorshort-errorcode-short-action) |
5959
| void | [progress(int, qint64, qint64, double, QString, short)](#void-progressint-percentage--qint64-bytesreceived--qint64-bytestotal--double-speed--qstring-speedunits-short-action) |
6060
| void | [logger(QString, QString)](#void-loggerqstring--qstring) |
61+
| void | [quit()](#void-quit) |
6162

6263

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

394395

396+
### void quit()
397+
<p align="right"> <code>[SIGNAL]</code> </p>
398+
399+
Emitted when it's required quit the current application when using the GUI updater.
400+
401+
395402
## QString errorCodeToString(short errorCode)
396403
<p align="right"> <code>[STATIC]</code> </p>
397404

docs/PluginInterface.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ I'm not sure about other Qt bindings, So help is much welcomed.
5252
| [error(short, short)](#errorshort-errorcode-short-action) | Emitted when some error occurs in an action. |
5353
| [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. |
5454
| [logger(QString, QString)](#loggerqstring--qstring) | See here for more information. |
55-
55+
| [quit()](#quit) | Emitted when it's desired to quit current application. |
5656

5757
## Actions
5858

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

344+
### quit()
345+
<p align="right"> <code>[SIGNAL]</code> </p>
346+
347+
Emitted when it's desired to quit the current application when using GUI update.
348+
349+
344350
### QObject\* getObject()
345351

346352
Returns the QObject pointer. Useful when using this plugin in C++.

include/qappimageupdateinterface.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class QAppImageUpdateInterface {
3434
virtual void progress(int, qint64, qint64, double, QString, short) = 0;
3535
virtual void logger(QString, QString) = 0;
3636
virtual void error(short, short) = 0;
37+
virtual void quit() = 0;
3738
};
3839

3940
#ifndef QAppImageUpdateInterface_iid

include/qappimageupdateinterfaceimpl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class QAppImageUpdateInterfaceImpl : public QObject, QAppImageUpdateInterface {
4646
void progress(int, qint64, qint64, double, QString, short);
4747
void logger(QString, QString);
4848
void error(short, short);
49+
void quit();
4950
private:
5051
QScopedPointer<QAppImageUpdate> m_Private;
5152
};

src/qappimageupdateinterfaceimpl.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ QAppImageUpdateInterfaceImpl::QAppImageUpdateInterfaceImpl(QObject *parent)
2525
this, &QAppImageUpdateInterfaceImpl::logger, Qt::DirectConnection);
2626
connect(s, &QAppImageUpdate::error,
2727
this, &QAppImageUpdateInterfaceImpl::error, Qt::DirectConnection);
28+
connect(s, &QAppImageUpdate::quit,
29+
this, &QAppImageUpdateInterfaceImpl::quit, Qt::DirectConnection);
2830
}
2931

3032
QAppImageUpdateInterfaceImpl::~QAppImageUpdateInterfaceImpl() {

0 commit comments

Comments
 (0)