kdeconnect-kde/core/compositefiletransferjob.h
Kai Uwe Broulik daa6f7fc14 Clean up FileTransferJob description
* Set magic `destUrl` property to let it know the job destination in case of
  multiple files being transferred
* Set a normal "Receiving File(s)" title like we do with "Copying" title
* Set device name and destination path as details
2021-01-31 22:22:36 +01:00

51 lines
1.1 KiB
C++

/**
* SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#ifndef COMPOSITEFILETRANSFERJOB_H
#define COMPOSITEFILETRANSFERJOB_H
#include "kdeconnectcore_export.h"
#include <KCompositeJob>
#include <QElapsedTimer>
class FileTransferJob;
class KDECONNECTCORE_EXPORT CompositeFileTransferJob
: public KCompositeJob
{
Q_OBJECT
public:
explicit CompositeFileTransferJob(const QString& deviceId);
void start() override;
bool isRunning() const;
bool addSubjob(KJob* job) override;
protected:
bool doKill() override;
private Q_SLOTS:
void slotProcessedAmount(KJob *job, KJob::Unit unit, qulonglong amount);
void slotResult(KJob *job) override;
void startNextSubJob();
private:
QString m_deviceId;
bool m_running;
int m_currentJobNum;
int m_totalJobs;
quint64 m_currentJobSendPayloadSize;
quint64 m_totalSendPayloadSize;
quint64 m_totalPayloadSize;
FileTransferJob *m_currentJob;
QElapsedTimer m_timer;
quint64 m_prevElapsedTime;
};
#endif //COMPOSITEFILETRANSFERJOB_H