mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -07:00
Improve behavior when using ProgramUpdater class
This is mainly to avoid involving of `sender()` function.
This commit is contained in:
parent
5c819f7242
commit
88d695f7af
4 changed files with 90 additions and 79 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue