Disable clipboardsharing in view only mode.
[kdenetwork.git] / kget / core / kgetkjobadapter.cpp
blob4800ff03278c8aeaf7bcc1613d70f78390f8cf75
1 /* This file is part of the KDE project
3 Copyright (C) 2008 Javier Goday <jgoday @ gmail.com>
4 Idea by Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 #include "kgetkjobadapter.h"
13 KGetKJobAdapter::KGetKJobAdapter(QObject *parent, TransferHandler *transfer) : KJob(parent)
15 m_transferHandler = transfer;
18 KGetKJobAdapter::~KGetKJobAdapter()
22 qulonglong KGetKJobAdapter::processedAmount(Unit unit) const
24 Q_UNUSED(unit)
25 return m_transferHandler->downloadedSize();
28 qulonglong KGetKJobAdapter::totalAmount(Unit unit) const
30 Q_UNUSED(unit)
31 return m_transferHandler->totalSize();
34 unsigned long KGetKJobAdapter::percent() const
36 return m_transferHandler->percent();
39 void KGetKJobAdapter::slotUpdateDescription()
41 emit description(this, "KGet Transfer",
42 qMakePair(QString("source"), m_transferHandler->source().prettyUrl()),
43 qMakePair(QString("destination"), m_transferHandler->dest().prettyUrl()));
45 emitSpeed(m_transferHandler->downloadSpeed());
46 setProcessedAmount(KJob::Bytes, processedAmount(KJob::Bytes));
47 setTotalAmount(KJob::Bytes, totalAmount(KJob::Bytes));
48 setPercent(percent());