/* * SPDX-FileCopyrightText: 2013 Aleix Pol Gonzalez * * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ #pragma once #include #include #include #include #include class SnapResource; class QSnapdRequest; class QSnapdClient; class SnapTransaction : public Transaction { Q_OBJECT public: SnapTransaction(QSnapdClient *client, SnapResource *app, Role role, AbstractResource::State newState); void cancel() override; void proceed() override; private Q_SLOTS: void finishTransaction(); private: void setRequest(QSnapdRequest *req); void progressed(); void setSpeed(QSnapdTask *downloadTask); QSnapdClient *const m_client; SnapResource *const m_app; QScopedPointer m_request; const AbstractResource::State m_newState; QElapsedTimer m_downloadTimer; qint64 m_lastProgressDone = 0; };