mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 07:57:22 -06:00
Improve behavior when using ProgramUpdater class
This is mainly to avoid involving of `sender()` function.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2021 Mike Tzou (Chocobo1)
|
||||
* Copyright (C) 2010 Christophe Dumez <chris@qbittorrent.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -29,6 +30,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
namespace Net
|
||||
{
|
||||
@@ -41,18 +44,19 @@ class ProgramUpdater final : public QObject
|
||||
Q_DISABLE_COPY(ProgramUpdater)
|
||||
|
||||
public:
|
||||
explicit ProgramUpdater(QObject *parent = nullptr, bool invokedByUser = false);
|
||||
using QObject::QObject;
|
||||
|
||||
void checkForUpdates() const;
|
||||
void updateProgram() const;
|
||||
QString getNewVersion() const;
|
||||
bool updateProgram() const;
|
||||
|
||||
signals:
|
||||
void updateCheckFinished(bool updateAvailable, const QString &version, bool invokedByUser);
|
||||
void updateCheckFinished();
|
||||
|
||||
private slots:
|
||||
void rssDownloadFinished(const Net::DownloadResult &result);
|
||||
|
||||
private:
|
||||
QString m_updateUrl;
|
||||
const bool m_invokedByUser;
|
||||
QString m_newVersion;
|
||||
QUrl m_updateURL;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user