File indexing completed on 2024-11-24 04:31:15

0001 /*
0002     SPDX-FileCopyrightText: 2009 Joris Guisson <joris.guisson@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #ifndef BT_PREALLOCATIONJOB_H
0007 #define BT_PREALLOCATIONJOB_H
0008 
0009 #include <torrent/job.h>
0010 
0011 namespace bt
0012 {
0013 class PreallocationThread;
0014 class ChunkManager;
0015 
0016 class KTORRENT_EXPORT PreallocationJob : public bt::Job
0017 {
0018     Q_OBJECT
0019 public:
0020     PreallocationJob(ChunkManager *cman, TorrentControl *tc);
0021     ~PreallocationJob() override;
0022 
0023     void start() override;
0024     void kill(bool quietly = true) override;
0025     TorrentStatus torrentStatus() const override
0026     {
0027         return ALLOCATING_DISKSPACE;
0028     }
0029 
0030 private Q_SLOTS:
0031     void finished();
0032 
0033 private:
0034     ChunkManager *cman;
0035     PreallocationThread *prealloc_thread;
0036 };
0037 
0038 }
0039 
0040 #endif // BT_PREALLOCATIONJOB_H