Skip to content
Snippets Groups Projects
updatehandler.h 730 B
Newer Older
akiraohgaki's avatar
akiraohgaki committed
#pragma once

#include <QObject>

class ConfigHandler;

class UpdateHandler : public QObject
akiraohgaki's avatar
akiraohgaki committed
{
    Q_OBJECT

public:
    explicit UpdateHandler(ConfigHandler *configHandler, QObject *parent = nullptr);
akiraohgaki's avatar
akiraohgaki committed
signals:
    void checkAllStarted();
    void checkAllFinished();
akiraohgaki's avatar
akiraohgaki committed
    void updateStarted(QString path);
    void updateFinished(QString path, QString newPath);
akiraohgaki's avatar
akiraohgaki committed
    void updateProgress(QString path, int progress);

akiraohgaki's avatar
akiraohgaki committed
public slots:
    bool checkAll() const;
    bool update(const QString &path) const;
akiraohgaki's avatar
akiraohgaki committed
#ifdef QTLIB_UNIX
    QString describeAppImage(const QString &path) const;
    bool checkAppImage(const QString &path) const;
akiraohgaki's avatar
akiraohgaki committed
    bool updateAppImage(const QString &path);
akiraohgaki's avatar
akiraohgaki committed
#endif

    ConfigHandler *configHandler_;
};