File: dbustorrentfile.cpp

package info (click to toggle)
ktorrent 25.04.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,104 kB
  • sloc: cpp: 40,482; xml: 1,163; python: 182; sh: 10; makefile: 5
file content (78 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
    SPDX-FileCopyrightText: 2008 Joris Guisson <joris.guisson@gmail.com>
    SPDX-FileCopyrightText: 2008 Ivan Vasic <ivasic@gmail.com>
    SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "dbustorrentfile.h"

namespace kt
{
DBusTorrentFile::DBusTorrentFile(bt::TorrentFileInterface &file, QObject *parent)
    : QObject(parent)
    , file(file)
{
}

DBusTorrentFile::~DBusTorrentFile()
{
}

QString DBusTorrentFile::path() const
{
    return file.getPath();
}

QString DBusTorrentFile::pathOnDisk() const
{
    return file.getPathOnDisk();
}

qulonglong DBusTorrentFile::size() const
{
    return file.getSize();
}

int DBusTorrentFile::priority() const
{
    return file.getPriority();
}

void DBusTorrentFile::setPriority(int prio)
{
    if (prio > 60 || prio < 10)
        return;

    if (prio % 10 != 0)
        return;

    file.setPriority((bt::Priority)prio);
}

void DBusTorrentFile::setDoNotDownload(bool dnd)
{
    file.setDoNotDownload(dnd);
}

int DBusTorrentFile::firstChunk() const
{
    return file.getFirstChunk();
}

int DBusTorrentFile::lastChunk() const
{
    return file.getLastChunk();
}

double DBusTorrentFile::percentage() const
{
    return file.getDownloadPercentage();
}

bool DBusTorrentFile::isMultiMedia() const
{
    return file.isMultimedia();
}
}

#include "moc_dbustorrentfile.cpp"