Tc_Group = 0x00008000,
Tc_Selection = 0x00010000
};
+ typedef int ChangesFlags;
enum Capability
{
DeleteFiles = 0x00000002
};
Q_DECLARE_FLAGS(DeleteOptions, DeleteOption)
- typedef int ChangesFlags;
Transfer(TransferGroup * parent, TransferFactory * factory,
Scheduler * scheduler, const KUrl & src, const KUrl & dest,
{
setCapabilities(Transfer::Cap_SpeedLimit | Transfer::Cap_Resuming);
- // FIXME: once downloaded and KGet is restarted transfer is not seeded
-
lt::settings_pack ltsettings;
ltsettings.set_int(lt::settings_pack::alert_mask,
lt::alert::status_notification
kDebug(5001) << "TransferTorrent::fileModel";
if (!m_filemodel) {
- m_filemodel = new FileModel(TransferTorrent::files(), m_dest.upUrl(), this);
+ m_filemodel = new FileModel(files(), directory(), this);
// TODO: disable downloading based on check state
// TODO: file state should not be based on global transfer state
return m_filemodel;
}
+void TransferTorrent::init()
+{
+ kDebug(5001) << "TransferTorrent::init";
+
+ // start even if transfer is finished so that torrent is seeded
+ const bool shouldstart = (policy() != Job::Stop);
+ if (shouldstart) {
+ start();
+ }
+
+ kDebug(5001) << "TransferTorrent::init: should start" << shouldstart;
+}
+
void TransferTorrent::timerEvent(QTimerEvent *event)
{
if (event->timerId() != m_timerid) {
~TransferTorrent();
public:
+ void init() final;
void deinit(Transfer::DeleteOptions options) final;
+ QList<KUrl> files() const final;
+ FileModel* fileModel() final;
// Job reimplementations
void start() final;
void stop() final;
bool isStalled() const final;
bool isWorking() const final;
- // Transfer reimplementations
- QList<KUrl> files() const final;
- FileModel* fileModel() final;
protected:
// QObject reimplementation