Compare commits
621 Commits
release-4.
...
release-4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9ed621178 | ||
|
|
400743fc64 | ||
|
|
ea8c57be23 | ||
|
|
591cde53cf | ||
|
|
90bb67c654 | ||
|
|
8f7fda492c | ||
|
|
f92d85c536 | ||
|
|
55c98d8706 | ||
|
|
6e94b03c13 | ||
|
|
e3a82d4614 | ||
|
|
c61f641613 | ||
|
|
b64a51337e | ||
|
|
19dcf7851b | ||
|
|
fb346e15e8 | ||
|
|
827d8c0dad | ||
|
|
beef041e71 | ||
|
|
8b575484e6 | ||
|
|
d4b77a6541 | ||
|
|
4ba6334506 | ||
|
|
b78899cb9a | ||
|
|
0dec7b9f4f | ||
|
|
81a4f3ced0 | ||
|
|
b155b8609f | ||
|
|
970ad7cf28 | ||
|
|
c4625f50a8 | ||
|
|
001bd38557 | ||
|
|
7aae915a68 | ||
|
|
5f1ac96f66 | ||
|
|
68c2d81072 | ||
|
|
4dea03fc74 | ||
|
|
a70942ed53 | ||
|
|
7e8c72f424 | ||
|
|
e538eae726 | ||
|
|
898239a42e | ||
|
|
1055cc0f45 | ||
|
|
9f36b54b04 | ||
|
|
1f42ab8c4f | ||
|
|
3f0fbc0810 | ||
|
|
7e4b62c68d | ||
|
|
784b154228 | ||
|
|
ddba79ef3d | ||
|
|
7712d0ada0 | ||
|
|
38837db8de | ||
|
|
d997d887e5 | ||
|
|
341a971cd3 | ||
|
|
fa380c8b2c | ||
|
|
758c70283f | ||
|
|
747c70a58e | ||
|
|
6ca2e42bca | ||
|
|
cb505a07fe | ||
|
|
5819b6dd39 | ||
|
|
644e7d0450 | ||
|
|
b0e3d77975 | ||
|
|
643a209812 | ||
|
|
c3311e83a0 | ||
|
|
3301e9cb69 | ||
|
|
cf2c0bd47e | ||
|
|
df0c5c41c5 | ||
|
|
59e6757242 | ||
|
|
6bbcf9b3d6 | ||
|
|
208d21ff73 | ||
|
|
2df71dbde5 | ||
|
|
9e4f246c89 | ||
|
|
e4fc8e4156 | ||
|
|
883d4d81d5 | ||
|
|
041b86981f | ||
|
|
470e993c2d | ||
|
|
cbf10ebb7f | ||
|
|
89f06274bb | ||
|
|
c07cd440cd | ||
|
|
e90be67fec | ||
|
|
37ea01bd44 | ||
|
|
ccc91e2e52 | ||
|
|
d31954761f | ||
|
|
aa122b062e | ||
|
|
65921eaf7b | ||
|
|
bfbd978d3f | ||
|
|
1876dbd523 | ||
|
|
ea7eb7c0ec | ||
|
|
19c733ce95 | ||
|
|
2ba5dd1344 | ||
|
|
61eddfce90 | ||
|
|
0840556f77 | ||
|
|
f564e8a1c4 | ||
|
|
315d9835b2 | ||
|
|
ed03456999 | ||
|
|
e1a14007f8 | ||
|
|
a15cfae03a | ||
|
|
c2a195360a | ||
|
|
a4f99995bb | ||
|
|
16616f4e0e | ||
|
|
a5294e1e08 | ||
|
|
a8dbff06a3 | ||
|
|
d9cd5d4680 | ||
|
|
ac42ccb5e4 | ||
|
|
68ca95faf0 | ||
|
|
8d285c66aa | ||
|
|
1f28122428 | ||
|
|
6ec179e0f7 | ||
|
|
423511765a | ||
|
|
c061d67b14 | ||
|
|
4863078744 | ||
|
|
88881de8c6 | ||
|
|
690c439ae6 | ||
|
|
e78b5202bc | ||
|
|
c9be1d0a19 | ||
|
|
3348eef423 | ||
|
|
931af6c97e | ||
|
|
cea2948593 | ||
|
|
a468c84b30 | ||
|
|
7278625f53 | ||
|
|
7b3e692f68 | ||
|
|
fdb0d97b28 | ||
|
|
08a2439f46 | ||
|
|
6767487e40 | ||
|
|
141a2d2856 | ||
|
|
2eea57e609 | ||
|
|
0b185e347b | ||
|
|
1e1db31ab5 | ||
|
|
7233274110 | ||
|
|
d4e2b21534 | ||
|
|
4f206f987a | ||
|
|
dfddda57b9 | ||
|
|
0cacd71503 | ||
|
|
fdf3ebbb6c | ||
|
|
a3d9e457a0 | ||
|
|
ffb5c0635e | ||
|
|
b4f23d8154 | ||
|
|
ed310c2dac | ||
|
|
50167d40d7 | ||
|
|
5261d4375f | ||
|
|
0b56cd5fa0 | ||
|
|
e22946ef61 | ||
|
|
0457fd260e | ||
|
|
c60b7b213e | ||
|
|
c759c4301e | ||
|
|
307736e263 | ||
|
|
7aa5bc4bc1 | ||
|
|
c47e4efade | ||
|
|
b0781e820c | ||
|
|
1aca3b0adc | ||
|
|
20c4b0ee0c | ||
|
|
3df4a7ac2e | ||
|
|
efdeb81af1 | ||
|
|
34295a78f2 | ||
|
|
57163612ff | ||
|
|
1a9b009951 | ||
|
|
9406b4b226 | ||
|
|
38dc6ab8cf | ||
|
|
55c3db339b | ||
|
|
34456a7459 | ||
|
|
02b029abbe | ||
|
|
b26eb3d146 | ||
|
|
7cb6100c9c | ||
|
|
ef06485c45 | ||
|
|
1c2d9c1fe4 | ||
|
|
6f7f7d87c6 | ||
|
|
817aadd52d | ||
|
|
058bad0af3 | ||
|
|
0e421ae415 | ||
|
|
2227c3afc1 | ||
|
|
050af8a793 | ||
|
|
6207855f3b | ||
|
|
a65a70ab48 | ||
|
|
4110bb874f | ||
|
|
5c74f374af | ||
|
|
a8420a43f9 | ||
|
|
279bce2014 | ||
|
|
f3d370870d | ||
|
|
0e30659c26 | ||
|
|
f34dfca5e6 | ||
|
|
cec68c3fd7 | ||
|
|
5c2f698cb4 | ||
|
|
f5fc2d52b8 | ||
|
|
edef85fa3e | ||
|
|
6244ad5fa8 | ||
|
|
aba23f67a0 | ||
|
|
1a913c502b | ||
|
|
078982ada6 | ||
|
|
3035184d25 | ||
|
|
fccdc7ebdc | ||
|
|
e0c74c2d39 | ||
|
|
288f372914 | ||
|
|
ba331436fa | ||
|
|
afd4069eb4 | ||
|
|
387f9b1230 | ||
|
|
2114817890 | ||
|
|
dac2ab5409 | ||
|
|
b87ca60c5a | ||
|
|
6d44075662 | ||
|
|
69af205094 | ||
|
|
8a2e3f5d93 | ||
|
|
3f79726ab9 | ||
|
|
d1c4b1599a | ||
|
|
a0842a1e68 | ||
|
|
29042e4841 | ||
|
|
3e2cfb5136 | ||
|
|
0d55599e02 | ||
|
|
ea1b0b26b1 | ||
|
|
176b2eb18b | ||
|
|
98a1c111b9 | ||
|
|
47048d8410 | ||
|
|
882fa7ecd4 | ||
|
|
d07ece53e6 | ||
|
|
afd2f6ba14 | ||
|
|
226b0d4194 | ||
|
|
44e4b5d238 | ||
|
|
c59d2575c8 | ||
|
|
f50b4724a6 | ||
|
|
48cbccff1e | ||
|
|
e31ec20ec4 | ||
|
|
b9ec216aa5 | ||
|
|
2ac3004762 | ||
|
|
543cbc6d1c | ||
|
|
27d8dbf13b | ||
|
|
e487b31877 | ||
|
|
2845a791d0 | ||
|
|
024df8c53f | ||
|
|
12d97475da | ||
|
|
5154d431f6 | ||
|
|
0fc1ad664f | ||
|
|
bb683bd393 | ||
|
|
69df8174b9 | ||
|
|
56ccf28000 | ||
|
|
0a45fc9ffe | ||
|
|
a56262401b | ||
|
|
ebea0d91af | ||
|
|
d6cea2f76d | ||
|
|
4386fd9f89 | ||
|
|
1c18edac76 | ||
|
|
247b93e8ec | ||
|
|
6470f9acb9 | ||
|
|
65e0aa6b82 | ||
|
|
53cc8e1115 | ||
|
|
72b8ec8f3b | ||
|
|
29e24232ad | ||
|
|
6d0cceca83 | ||
|
|
8e9b928b61 | ||
|
|
df81e84fc2 | ||
|
|
e6a1b72354 | ||
|
|
e48b97466c | ||
|
|
84b9929025 | ||
|
|
5c50dba9e1 | ||
|
|
55b9b8fc91 | ||
|
|
fb698896c9 | ||
|
|
95c32221a2 | ||
|
|
230fc8e11e | ||
|
|
9b919b6c34 | ||
|
|
49d3b7bf30 | ||
|
|
1d778676cd | ||
|
|
e887b3106f | ||
|
|
be5600dae2 | ||
|
|
686fb701bf | ||
|
|
a73c4d57b1 | ||
|
|
e6ce1dd0b0 | ||
|
|
25ab660c14 | ||
|
|
38d3eea6ee | ||
|
|
13f69a2245 | ||
|
|
ec337a8a84 | ||
|
|
267362a7a0 | ||
|
|
11f26bfefd | ||
|
|
87c3f5163e | ||
|
|
22bdf98617 | ||
|
|
e5001e8f40 | ||
|
|
ddd6c82dd7 | ||
|
|
155dc49c5a | ||
|
|
c2c0dd2717 | ||
|
|
27cf98a962 | ||
|
|
aaaa67050c | ||
|
|
52ae118e3c | ||
|
|
cb929f7e59 | ||
|
|
94b64884f8 | ||
|
|
8a590c7472 | ||
|
|
b11c33b2d9 | ||
|
|
eb201003ee | ||
|
|
cf9bad03aa | ||
|
|
c5127d2eec | ||
|
|
0a35adbdba | ||
|
|
38d68d9d97 | ||
|
|
8494c6c5d4 | ||
|
|
cbfdb7df56 | ||
|
|
ea44923cce | ||
|
|
e75f8603b0 | ||
|
|
5437974b85 | ||
|
|
99abc21dab | ||
|
|
5156399c68 | ||
|
|
c8a5ef8c5d | ||
|
|
5b52835377 | ||
|
|
b8277614ec | ||
|
|
fb6bdbefd5 | ||
|
|
53c33317f9 | ||
|
|
d534973650 | ||
|
|
ed154d35ba | ||
|
|
ff7e5da6de | ||
|
|
d7fa5b6b6b | ||
|
|
d57bd62add | ||
|
|
0f6dff6315 | ||
|
|
97b4e4a3d3 | ||
|
|
84c84160fd | ||
|
|
60c9926834 | ||
|
|
fcde1ba09c | ||
|
|
8dcf326576 | ||
|
|
22b0ebb5a8 | ||
|
|
c5d99a12f3 | ||
|
|
240f5b6718 | ||
|
|
d184bd8c82 | ||
|
|
98a2dedb32 | ||
|
|
c405cb2f1c | ||
|
|
5ea100352e | ||
|
|
86c5a8df75 | ||
|
|
a05562cdc5 | ||
|
|
ee37f1db3d | ||
|
|
c9720cad81 | ||
|
|
2124ef261a | ||
|
|
aae6030064 | ||
|
|
b234fcec9c | ||
|
|
1a45145c1e | ||
|
|
c1a282aa7b | ||
|
|
e23c5614b6 | ||
|
|
f457937980 | ||
|
|
eac8838dc2 | ||
|
|
74d281526b | ||
|
|
7a8128eec4 | ||
|
|
a55be5e58f | ||
|
|
4c317f1e4a | ||
|
|
48c46dc79a | ||
|
|
b9339bb727 | ||
|
|
e1f8e6aa6f | ||
|
|
76c95d8c6c | ||
|
|
a7da714b13 | ||
|
|
916cfcdb03 | ||
|
|
b8fc415870 | ||
|
|
428cb9c986 | ||
|
|
99341409f4 | ||
|
|
f07333acc9 | ||
|
|
342f5f1a09 | ||
|
|
d74efd839f | ||
|
|
af898e9117 | ||
|
|
c0e48627ae | ||
|
|
534ed91d04 | ||
|
|
c58d0af88f | ||
|
|
ca5c1e8a15 | ||
|
|
4e96a1065e | ||
|
|
c9a8d19e6c | ||
|
|
81f5fdda15 | ||
|
|
a38730eb9e | ||
|
|
1a9e650936 | ||
|
|
ae5177b20f | ||
|
|
27090f0cfb | ||
|
|
433b5a46cf | ||
|
|
034d71dce3 | ||
|
|
c3de2310c5 | ||
|
|
b9478e0f00 | ||
|
|
94aeac992c | ||
|
|
4927d26877 | ||
|
|
ae1634623e | ||
|
|
296c7d3c13 | ||
|
|
22add258ae | ||
|
|
77f66be493 | ||
|
|
f41cb8089d | ||
|
|
32a686a037 | ||
|
|
236abcf3f1 | ||
|
|
325f9f629d | ||
|
|
88a771c9ff | ||
|
|
b960e41cfa | ||
|
|
9f461d0fe6 | ||
|
|
9db1f3baca | ||
|
|
af5a02d971 | ||
|
|
71bb6538db | ||
|
|
06ecc45d13 | ||
|
|
31607c4d18 | ||
|
|
84bb214642 | ||
|
|
d821bdc9f3 | ||
|
|
63461e0895 | ||
|
|
08755a211b | ||
|
|
a3c9c1c386 | ||
|
|
0de2f1776e | ||
|
|
da0db92b9f | ||
|
|
95bf63330e | ||
|
|
04cec39277 | ||
|
|
7b95785954 | ||
|
|
7d0342e366 | ||
|
|
21bc08d643 | ||
|
|
ffa6f7ea34 | ||
|
|
6b0449dde7 | ||
|
|
aa4107478e | ||
|
|
9f8e7917a8 | ||
|
|
1b652c882e | ||
|
|
601234e492 | ||
|
|
6c804edadf | ||
|
|
3a5c0d9818 | ||
|
|
2194a05e60 | ||
|
|
a89c1a8d9a | ||
|
|
86215f8483 | ||
|
|
a1b01c1b40 | ||
|
|
09cb95d3da | ||
|
|
48d7bdee0e | ||
|
|
5157fc201c | ||
|
|
492ea5bceb | ||
|
|
e8cf351b6a | ||
|
|
fc0628d35b | ||
|
|
1f7391737e | ||
|
|
acdb7a27dc | ||
|
|
1fed324f91 | ||
|
|
e4771ba508 | ||
|
|
6a36a3b1d9 | ||
|
|
2956b28a32 | ||
|
|
50471ec8c8 | ||
|
|
3aa9ff5fba | ||
|
|
b6be5afb89 | ||
|
|
157b809e21 | ||
|
|
f74e2b0130 | ||
|
|
c887a162ba | ||
|
|
52df71ad3a | ||
|
|
d6ddc90199 | ||
|
|
9600e7f5ad | ||
|
|
f3603d05e7 | ||
|
|
8cd243b06b | ||
|
|
1da3437a4a | ||
|
|
c72fb92318 | ||
|
|
954448863e | ||
|
|
eec6009398 | ||
|
|
ce362f0e5e | ||
|
|
4940a77d12 | ||
|
|
4e77e01a67 | ||
|
|
5acdcb6c09 | ||
|
|
8400d855de | ||
|
|
bd07cb91bb | ||
|
|
d7e0a9b1ad | ||
|
|
dc600d47ec | ||
|
|
0d3952eef5 | ||
|
|
30a4ce40b9 | ||
|
|
9d0ab0ae5f | ||
|
|
e78d8b9fcc | ||
|
|
f350977cb4 | ||
|
|
7a652c0a8c | ||
|
|
a652baadb5 | ||
|
|
66b86888fc | ||
|
|
e07501252c | ||
|
|
2977ba9ec2 | ||
|
|
db35bb54e1 | ||
|
|
19bb6f5fe0 | ||
|
|
aab752dd2e | ||
|
|
8c75fdcb4c | ||
|
|
df03b69151 | ||
|
|
aca7a851bb | ||
|
|
e9caefdfce | ||
|
|
16ac20b594 | ||
|
|
a3e071b734 | ||
|
|
5d3b9d2f22 | ||
|
|
27a7e86599 | ||
|
|
d93d0ab19e | ||
|
|
776627eee9 | ||
|
|
5185eeb7ef | ||
|
|
083bc71315 | ||
|
|
b1b931922e | ||
|
|
0717f0d60c | ||
|
|
525fdd6c2b | ||
|
|
f27e75e8fa | ||
|
|
0ad5290389 | ||
|
|
7895afb8e9 | ||
|
|
2626378dfd | ||
|
|
1378245a63 | ||
|
|
05c92e652c | ||
|
|
6c0dd81528 | ||
|
|
bd1d775ca9 | ||
|
|
b3207b8144 | ||
|
|
4c8dd0ca9d | ||
|
|
61d9fcd753 | ||
|
|
c5607f07c8 | ||
|
|
49802be7d4 | ||
|
|
3d932b1cce | ||
|
|
66a6674cbc | ||
|
|
2d12c126eb | ||
|
|
3ec992474d | ||
|
|
15babe97ea | ||
|
|
308fd3dcac | ||
|
|
e8250104c8 | ||
|
|
796cd674d7 | ||
|
|
1fe9272a8f | ||
|
|
c285de87d4 | ||
|
|
058062d586 | ||
|
|
3b4fd35dde | ||
|
|
2a6bd5de35 | ||
|
|
64e539fcfb | ||
|
|
de6ca29dcd | ||
|
|
ef63202be2 | ||
|
|
62493c672d | ||
|
|
8c58a69be6 | ||
|
|
2eb3ec1a6e | ||
|
|
e3da17caa8 | ||
|
|
c7e35a1801 | ||
|
|
83c6b22d30 | ||
|
|
fc5d49bf9a | ||
|
|
473ed45b3f | ||
|
|
c5ddbcfb5b | ||
|
|
72b0ba36ae | ||
|
|
b107c0671d | ||
|
|
b9e233601d | ||
|
|
8f16388915 | ||
|
|
d143929454 | ||
|
|
45a0c5558a | ||
|
|
b6596f9957 | ||
|
|
7059b947e8 | ||
|
|
4eafe7a2c8 | ||
|
|
d165da9c6c | ||
|
|
a341b793e4 | ||
|
|
a1d46a278b | ||
|
|
c6cf3a98a4 | ||
|
|
56887efdf5 | ||
|
|
4ec193042f | ||
|
|
6b33db3ae3 | ||
|
|
855772ae5a | ||
|
|
467ba380b2 | ||
|
|
93ed8e98c1 | ||
|
|
5c18db240c | ||
|
|
915ec81f83 | ||
|
|
8c545d2947 | ||
|
|
cbfbae1409 | ||
|
|
728b7dec3e | ||
|
|
7b5730723d | ||
|
|
71844e13af | ||
|
|
c6dfdf9135 | ||
|
|
4cd3a37b4a | ||
|
|
5efb4b522f | ||
|
|
64d5e329c0 | ||
|
|
ee9caa4305 | ||
|
|
39b56ac598 | ||
|
|
551ffb88ab | ||
|
|
698bd431e6 | ||
|
|
ccd3b305c2 | ||
|
|
b47c90f0e0 | ||
|
|
1afd5f70dd | ||
|
|
4cb304def8 | ||
|
|
f2af308e6d | ||
|
|
a6868e2b25 | ||
|
|
7a96ddccc6 | ||
|
|
bda5be8e4c | ||
|
|
93f5d4058d | ||
|
|
98dd2be673 | ||
|
|
ea7c1ace2a | ||
|
|
2da2054ccf | ||
|
|
3f5fa0025d | ||
|
|
f4be165767 | ||
|
|
55a1628a5e | ||
|
|
6c32f6beff | ||
|
|
21ec8fe53f | ||
|
|
4185209036 | ||
|
|
6150e0c56b | ||
|
|
42b811e578 | ||
|
|
ef1597e45b | ||
|
|
1e677c6728 | ||
|
|
9ef1e32327 | ||
|
|
173f6fd75d | ||
|
|
bbe7821483 | ||
|
|
65ca490b64 | ||
|
|
907f222a73 | ||
|
|
b649d61e8b | ||
|
|
ea793368a9 | ||
|
|
3331526865 | ||
|
|
cccb22f0e3 | ||
|
|
4f0d9605fe | ||
|
|
19fcd3dad6 | ||
|
|
eb8ff91c5d | ||
|
|
f98edcab5c | ||
|
|
e5ea3bd707 | ||
|
|
c87c1d2359 | ||
|
|
7bb9c69c08 | ||
|
|
25eb2edb86 | ||
|
|
c2a8970109 | ||
|
|
59c14801cc | ||
|
|
ea749bb052 | ||
|
|
1cb69c9b43 | ||
|
|
89d8a2fe72 | ||
|
|
4846b0ec28 | ||
|
|
771033a449 | ||
|
|
16d7301046 | ||
|
|
e2893fe68f | ||
|
|
8d913d77dd | ||
|
|
0522db3f19 | ||
|
|
50cea9d912 | ||
|
|
cff6a64e9f | ||
|
|
219a6b3ad1 | ||
|
|
798c230634 | ||
|
|
3801150a7a | ||
|
|
91b2b14ba5 | ||
|
|
1b8cda7924 | ||
|
|
31a4309077 | ||
|
|
db3fd24cea | ||
|
|
62b956946f | ||
|
|
04552f7921 | ||
|
|
9417105990 | ||
|
|
593c24e5bd | ||
|
|
7380bfa9e4 | ||
|
|
6f0d16bca5 | ||
|
|
78dafc9cbe | ||
|
|
2da5800665 | ||
|
|
6270433237 | ||
|
|
8214d25f9f | ||
|
|
df7565c9e2 | ||
|
|
d48218bfe9 | ||
|
|
db653cbdac | ||
|
|
766f70c81a | ||
|
|
3e9311b096 | ||
|
|
1bfb8d35cd | ||
|
|
07a85a1018 | ||
|
|
145641ac41 | ||
|
|
08aa827366 | ||
|
|
4d8a939291 | ||
|
|
e1f514042f | ||
|
|
7d78457fe0 | ||
|
|
f067b8b37c | ||
|
|
6043584305 | ||
|
|
bb02ccd574 | ||
|
|
64b250903f | ||
|
|
c5e73219bf | ||
|
|
5f47d3b021 | ||
|
|
d22b626a02 | ||
|
|
af9c0cca23 | ||
|
|
a641c0bb2f | ||
|
|
6c3ab99e3c |
18
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,14 +1,20 @@
|
||||
**Please provide the following information**
|
||||
|
||||
### qBittorrent version and Operating System:
|
||||
### qBittorrent version and Operating System
|
||||
(type here)
|
||||
|
||||
### If on linux, libtorrent and Qt version:
|
||||
### If on linux, libtorrent and Qt version
|
||||
(type here)
|
||||
|
||||
### What is the problem:
|
||||
### What is the problem
|
||||
(type here)
|
||||
|
||||
### What is the expected behavior:
|
||||
### What is the expected behavior
|
||||
(type here)
|
||||
|
||||
### Steps to reproduce:
|
||||
### Steps to reproduce
|
||||
(type here)
|
||||
|
||||
### Extra info(if any):
|
||||
### Extra info(if any)
|
||||
(type here)
|
||||
|
||||
|
||||
19
.travis.yml
@@ -76,10 +76,13 @@ before_install:
|
||||
|
||||
- shopt -s expand_aliases
|
||||
- alias make="colormake -j3" # Using nprocs/2 sometimes may fail (gcc is killed by system)
|
||||
#- libt_path="$HOME/libt_install"
|
||||
#- ltconf="$ltconf --prefix="$libt_path" --disable-geoip"
|
||||
- qbt_path="$HOME/qbt_install"
|
||||
- qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH="$libt_path/lib/pkgconfig":/opt/qt55/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
- |
|
||||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
|
||||
qbtconf="$qbtconf --prefix="$qbt_path" PKG_CONFIG_PATH=/opt/qt55/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
else
|
||||
qbtconf="$qbtconf --prefix="$qbt_path""
|
||||
fi
|
||||
|
||||
# options for specific branches
|
||||
- if [ "$gui" = false ]; then qbtconf="$qbtconf --disable-gui" ; fi
|
||||
@@ -131,13 +134,13 @@ install:
|
||||
cp "version" $HOME/hombebrew_cache
|
||||
cd "$HOME/hombebrew_cache"
|
||||
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar.rb
|
||||
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar-1.0.11+git20172003.8736a59adc.el_capitan.bottle.tar.gz
|
||||
wget https://builds.shiki.hu/homebrew/libtorrent-rasterbar-1.1.7+git20180422.3ede0b9c20+patched-configure.el_capitan.bottle.tar.gz
|
||||
fi
|
||||
|
||||
# Copy custom libtorrent bottle to homebrew's cache so it can find and install it
|
||||
# Also install our custom libtorrent formula by passing the local path to it
|
||||
# These 2 files are restored from Travis' cache.
|
||||
cp "$HOME/hombebrew_cache/libtorrent-rasterbar-1.0.11+git20172003.8736a59adc.el_capitan.bottle.tar.gz" "$(brew --cache)"
|
||||
cp "$HOME/hombebrew_cache/libtorrent-rasterbar-1.1.7+git20180422.3ede0b9c20+patched-configure.el_capitan.bottle.tar.gz" "$(brew --cache)"
|
||||
brew install "$HOME/hombebrew_cache/libtorrent-rasterbar.rb"
|
||||
|
||||
if [ "$build_system" = "cmake" ]; then
|
||||
@@ -168,11 +171,15 @@ script:
|
||||
BUILD_TOOL="ninja"
|
||||
fi
|
||||
if [ "$build_system" = "qmake" ]; then
|
||||
./bootstrap.sh && ./configure $qbtconf
|
||||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
|
||||
# For some reason for RC_1_1 we need to also specify the OpenSSL compiler/linker flags
|
||||
# Homebrew doesn't symlink OpenSSL for security reasons
|
||||
./bootstrap.sh && ./configure $qbtconf CXXFLAGS="$(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --cflags openssl)" LDFLAGS="$(PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" pkg-config --libs openssl)"
|
||||
sed -i "" -e "s/^\(CC.*&&\).*$/\1 $CC/" src/Makefile # workaround for Qt & ccache: https://bugreports.qt.io/browse/QTBUG-31034
|
||||
sed -i "" -e "s/^\(CXX.*&&\).*$/\1 $CXX/" src/Makefile
|
||||
sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile
|
||||
else
|
||||
./bootstrap.sh && ./configure $qbtconf
|
||||
fi
|
||||
BUILD_TOOL="make"
|
||||
fi
|
||||
|
||||
16
AUTHORS
@@ -34,6 +34,14 @@ Code from other projects:
|
||||
license: GPLv2/3
|
||||
|
||||
Images Authors:
|
||||
* files: src/icons/skin/qbittorrent-tray.svg (and related pngs)
|
||||
copyright: Provided by HVS <hvs linuxmail org> (raster first proposal) and Atif Afzal(@atfzl github) <atif5801@gmail.com> (vectorized and modified)
|
||||
license: GPLv2+
|
||||
|
||||
* files: src/qbittorrent_file.ico src/icons/fileicon.svg
|
||||
copyright: 'uknown.svg' (LGPLv3+) from Oxygen Icon Theme was used as base which was slightly modified and 'qbittorrent-tray.svg' (GPLv2+) was overlayed above it.
|
||||
license: GPLv3+
|
||||
|
||||
* files: src/icons/*.png
|
||||
copyright: Gnome Icon Theme
|
||||
license: GPLv2
|
||||
@@ -44,10 +52,10 @@ Images Authors:
|
||||
license: LGPL
|
||||
url: http://www.oxygen-icons.org
|
||||
|
||||
* files: src/icons/flags/*.png
|
||||
copyright: Mark James <mjames@gmail.com>
|
||||
license: Public Domain
|
||||
url: http://www.famfamfam.com
|
||||
* files: src/icons/flags/*.svg
|
||||
copyright: lipis/flag-icon-css
|
||||
license: MIT
|
||||
url: https://github.com/lipis/flag-icon-css/
|
||||
|
||||
* files: src/icons/skin/*.png
|
||||
files: src/menuicons/YYxYY/*.png
|
||||
|
||||
@@ -22,13 +22,8 @@ add_definitions(-DQBT_VERSION_MINOR=${VER_MINOR})
|
||||
add_definitions(-DQBT_VERSION_BUGFIX=${VER_BUGFIX})
|
||||
add_definitions(-DQBT_VERSION_BUILD=${VER_BUILD})
|
||||
|
||||
# os2 {
|
||||
# DEFINES += DQBT_VERSION=\'\"v$${PROJECT_VERSION}\"\'
|
||||
# DEFINES += DQBT_VERSION_2=\'\"$${PROJECT_VERSION}\"\'
|
||||
# } else {
|
||||
add_definitions(-DQBT_VERSION="v${PROJECT_VERSION}")
|
||||
add_definitions(-DQBT_VERSION_2="${PROJECT_VERSION}")
|
||||
# }
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
include(GNUInstallDirs)
|
||||
@@ -48,13 +43,13 @@ option(GUI "Allows to disable GUI for headless running. Disables QtDBus and the
|
||||
|
||||
option(WEBUI "Allows to disable the WebUI." ON)
|
||||
|
||||
if (WIN32)
|
||||
option(STACKTRACE_WIN "")
|
||||
else (WIN32)
|
||||
option(STACKTRACE "Enable stacktrace feature" ON)
|
||||
|
||||
if (UNIX)
|
||||
cmake_dependent_option(SYSTEMD "Install the systemd service file (headless only)" OFF
|
||||
"NOT GUI" OFF)
|
||||
cmake_dependent_option(DBUS "Enable use of QtDBus (GUI only)" ON "GUI" OFF)
|
||||
endif(WIN32)
|
||||
endif(UNIX)
|
||||
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
All new code must follow the following coding guidelines.
|
||||
If you make changes in a file that still uses another coding style, make sure that you follow these guidelines for your changes instead.
|
||||
All new code **must** follow the following coding guidelines.
|
||||
If you make changes in a file that still uses another coding style, make sure that you follow these guidelines for your changes.
|
||||
For programming languages other than C++ (e.g. JavaScript) used in this repository and submodules, unless otherwise specified, coding guidelines listed here applies as much as possible.
|
||||
|
||||
**Note 1:** I will not take your head if you forget and use another style. However, most probably the request will be delayed until you fix your coding style.
|
||||
**Note 2:** You can use the `uncrustify` program/tool to clean up any source file. Use it with the `uncrustify.cfg` configuration file found in the root folder.
|
||||
**Note 3:** There is also a style for QtCreator but it doesn't cover all cases. In QtCreator `Tools->Options...->C++->Code Style->Import...` and choose the `codingStyleQtCreator.xml` file found in the root folder.
|
||||
|
||||
### 1. Curly braces ###
|
||||
### 1. New lines & curly braces ###
|
||||
|
||||
#### a. Function blocks, class/struct definitions, namespaces ####
|
||||
```c++
|
||||
int myFunction(int a)
|
||||
{
|
||||
//code
|
||||
// code
|
||||
}
|
||||
|
||||
void myFunction() {} // empty body
|
||||
@@ -17,29 +20,29 @@ void myFunction() {} // empty body
|
||||
MyClass::MyClass(int *parent)
|
||||
: m_parent(parent)
|
||||
{
|
||||
//initialize
|
||||
// initialize
|
||||
}
|
||||
|
||||
int MyClass::myMethod(int a)
|
||||
{
|
||||
//code
|
||||
// code
|
||||
}
|
||||
|
||||
class MyOtherClass
|
||||
{
|
||||
public:
|
||||
//code
|
||||
|
||||
// code
|
||||
|
||||
protected:
|
||||
//code
|
||||
|
||||
// code
|
||||
|
||||
private:
|
||||
//code
|
||||
// code
|
||||
};
|
||||
|
||||
namespace Name
|
||||
{
|
||||
//code
|
||||
// code
|
||||
}
|
||||
|
||||
// Lambdas
|
||||
@@ -54,20 +57,20 @@ namespace Name
|
||||
#### b. Other code blocks ####
|
||||
```c++
|
||||
if (condition) {
|
||||
//code
|
||||
// code
|
||||
}
|
||||
|
||||
for (int a = 0; a < b; ++b) {
|
||||
//code
|
||||
// code
|
||||
}
|
||||
|
||||
switch (a) {
|
||||
case 1:
|
||||
//blah
|
||||
// blah
|
||||
case 2:
|
||||
//blah
|
||||
// blah
|
||||
default:
|
||||
//blah
|
||||
// blah
|
||||
}
|
||||
```
|
||||
|
||||
@@ -75,21 +78,81 @@ default:
|
||||
```c++
|
||||
switch (var) {
|
||||
case 1: {
|
||||
//declare local variables
|
||||
//code
|
||||
// declare local variables
|
||||
// code
|
||||
}
|
||||
break;
|
||||
case 2: {
|
||||
//declare local variables
|
||||
//code
|
||||
// declare local variables
|
||||
// code
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//code
|
||||
// code
|
||||
}
|
||||
```
|
||||
|
||||
#### d. Brace enclosed initializers ####
|
||||
#### d. If-else statements ####
|
||||
The `else if`/`else` must be on their own lines:
|
||||
```c++
|
||||
if (condition) {
|
||||
// code
|
||||
}
|
||||
else if (condition) {
|
||||
// code
|
||||
}
|
||||
else {
|
||||
// code
|
||||
}
|
||||
```
|
||||
|
||||
#### e. Single statement if blocks ####
|
||||
Most single statement if blocks should look like this:
|
||||
```c++
|
||||
if (condition)
|
||||
a = a + b;
|
||||
```
|
||||
|
||||
One acceptable exception to this can be `return`, `break` or `continue` statements,
|
||||
provided that the test condition isn't very long and its body statement occupies only one line.
|
||||
However you can still choose to use the first rule.
|
||||
```c++
|
||||
if (a > 0) return;
|
||||
|
||||
while (p) {
|
||||
// ...
|
||||
if (!b) continue;
|
||||
}
|
||||
```
|
||||
|
||||
#### f. Acceptable conditions to omit braces ####
|
||||
When the conditional statement in `if`/`else` has only one line and its body occupy only one line,
|
||||
this also applies to loops statements.
|
||||
Notice that for a series of `if - else` branches, if one branch needs braces then all branches must add braces.
|
||||
```c++
|
||||
if (a < b) // conditional statement
|
||||
do(a); // body
|
||||
|
||||
if (a < b)
|
||||
do(a);
|
||||
else if (a > b)
|
||||
do(b);
|
||||
else
|
||||
do(c);
|
||||
|
||||
if (a < b) {
|
||||
do(a);
|
||||
}
|
||||
else if (a > b) { // curly braces required here, then all branches should also add them
|
||||
do(b);
|
||||
do(d);
|
||||
}
|
||||
else {
|
||||
do(c);
|
||||
}
|
||||
```
|
||||
|
||||
#### g. Brace enclosed initializers ####
|
||||
Unlike single-line functions, you must not insert spaces between the brackets and concluded expressions.<br/>
|
||||
But you must insert a space between the variable name and initializer.
|
||||
```c++
|
||||
@@ -99,53 +162,14 @@ Class obj {expr1, /*...,*/ exprN};
|
||||
QVariantMap map {{"key1", 5}, {"key2", 10}};
|
||||
```
|
||||
|
||||
### 2. If blocks ###
|
||||
#### a. Multiple tests ####
|
||||
```c++
|
||||
if (condition) {
|
||||
//code
|
||||
}
|
||||
else if (condition) {
|
||||
//code
|
||||
}
|
||||
else {
|
||||
//code
|
||||
}
|
||||
```
|
||||
The `else if`/`else` must be on their own lines.
|
||||
|
||||
#### b. Single statement if blocks ####
|
||||
**Most** single statement if blocks should look like this:
|
||||
```c++
|
||||
if (condition)
|
||||
a = a + b;
|
||||
```
|
||||
|
||||
One acceptable exception to this **can be** `return`, `break` or `continue` statements, provided that the test condition isn't very long. However you can choose to use the first rule instead.
|
||||
```c++
|
||||
a = myFunction();
|
||||
b = a * 1500;
|
||||
|
||||
if (b > 0) return;
|
||||
c = 100 / b;
|
||||
```
|
||||
|
||||
#### c. Using curly braces for single statement if blocks ####
|
||||
|
||||
However, there are cases where curly braces for single statement if blocks **should** be used.
|
||||
* If some branch needs braces then all others should use them. Unless you have multiple `else if` in a row and the one needing the braces is only for a very small sub-block of code.
|
||||
* Another exception would be when we have nested if blocks or generally multiple levels of code that affect code readability.
|
||||
|
||||
Generally it will depend on the particular piece of code and would be determined on how readable that piece of code is. **If in doubt** always use braces if one of the above exceptions applies.
|
||||
|
||||
### 3. Indentation ###
|
||||
### 2. Indentation ###
|
||||
4 spaces.
|
||||
|
||||
### 4. File encoding and line endings. ###
|
||||
### 3. File encoding and line endings. ###
|
||||
|
||||
UTF-8 and Unix-like line ending (LF). Unless some platform specific files need other encodings/line endings.
|
||||
|
||||
### 5. Initialization lists. ###
|
||||
### 4. Initialization lists. ###
|
||||
Initialization lists should be vertical. This will allow for more easily readable diffs. The initialization colon should be indented and in its own line along with first argument. The rest of the arguments should be indented too and have the comma prepended.
|
||||
```c++
|
||||
myClass::myClass(int a, int b, int c, int d)
|
||||
@@ -154,11 +178,11 @@ myClass::myClass(int a, int b, int c, int d)
|
||||
, m_c(c)
|
||||
, m_d(d)
|
||||
{
|
||||
//code
|
||||
// code
|
||||
}
|
||||
```
|
||||
|
||||
### 6. Enums. ###
|
||||
### 5. Enums. ###
|
||||
Enums should be vertical. This will allow for more easily readable diffs. The members should be indented.
|
||||
```c++
|
||||
enum Days
|
||||
@@ -173,7 +197,7 @@ enum Days
|
||||
};
|
||||
```
|
||||
|
||||
### 7. Names. ###
|
||||
### 6. Names. ###
|
||||
All names should be camelCased.
|
||||
|
||||
#### a. Type names and namespaces ####
|
||||
@@ -207,36 +231,85 @@ class MyClass
|
||||
}
|
||||
```
|
||||
|
||||
### 8. Header inclusion order. ###
|
||||
The headers should be placed in the following order:
|
||||
1. Module header (in .cpp)
|
||||
2. System/Qt/Boost etc. headers (splitted in subcategories if you have many).
|
||||
3. Application headers, starting from *Base* headers.
|
||||
### 7. Header inclusion order. ###
|
||||
The headers should be placed in the following group order:
|
||||
1. Module header (in .cpp)
|
||||
2. C++ Standard Library headers
|
||||
3. System headers
|
||||
4. Boost library headers
|
||||
5. Libtorrent headers
|
||||
6. Qt headers
|
||||
7. qBittorrent own headers, starting from *base* headers.
|
||||
|
||||
The headers should be ordered alphabetically within each group.
|
||||
If there are conditionals for the same header group, then put them at the bottom of the respective group.
|
||||
If there are conditionals for the different header groups, then put them above of the "qBittorrent own headers" group.
|
||||
|
||||
One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order.
|
||||
|
||||
The headers should be ordered alphabetically within each group (subgroup).<br/>
|
||||
<br/>
|
||||
Example:
|
||||
```c++
|
||||
// examplewidget.cpp
|
||||
// file: examplewidget.cpp
|
||||
|
||||
// Module header
|
||||
#include "examplewidget.h"
|
||||
|
||||
#include <cmath>
|
||||
// exceptions, headers containing version number
|
||||
#include <boost/version.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
#include <QtGlobal>
|
||||
|
||||
// C++ Standard Library headers
|
||||
#include <cstdio>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QList>
|
||||
#ifdef Q_OS_WIN // conditional
|
||||
#include <cmath>
|
||||
#endif
|
||||
|
||||
// System headers
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
// Boost library headers
|
||||
#include <boost/circular_buffer.hpp>
|
||||
|
||||
// Libtorrent headers
|
||||
#include <libtorrent/session.hpp>
|
||||
|
||||
// Qt headers
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
#include <libtorrent/version.hpp>
|
||||
#ifdef Q_OS_MAC // conditional
|
||||
#include <QFont>
|
||||
#endif
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
// conditional for the different header groups
|
||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||
#include <memory>
|
||||
#include <QElapsedTimer>
|
||||
#endif
|
||||
|
||||
// qBittorrent own headers
|
||||
#include "base/bittorrent/infohash.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "anothermodule.h"
|
||||
#include "ui_examplewidget.h"
|
||||
```
|
||||
|
||||
### 8. Include guard. ###
|
||||
`#pragma once` should be used instead of "include guard" in new code:
|
||||
```c++
|
||||
// examplewidget.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class ExampleWidget : public QWidget
|
||||
{
|
||||
// (some code omitted)
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
@@ -282,20 +355,32 @@ auto spinBox = static_cast<QSpinBox*>(sender());
|
||||
// we know the variable type based on the right-hand expression
|
||||
```
|
||||
|
||||
* Space around operations eg `a = b + c` or `a=b+c`:
|
||||
|
||||
Before and after the assignment and other binary (and ternary) operators there should be a space.<br/>
|
||||
There should not be a space between increment/decrement and its operand.<br/>
|
||||
Some valid use cases:
|
||||
* Notice the spaces in the following specific situations:
|
||||
```c++
|
||||
// Before and after the assignment and other binary (and ternary) operators there should be a space
|
||||
// There should not be a space between increment/decrement and its operand
|
||||
a += 20;
|
||||
a = (b <= MAX_B ? b : MAX_B);
|
||||
++a;
|
||||
b--;
|
||||
--b;
|
||||
|
||||
for (int a = 0; a < b; ++b) {
|
||||
// code
|
||||
}
|
||||
|
||||
// Range-based for loop, spaces before and after the colon
|
||||
for (auto i : container) {
|
||||
}
|
||||
|
||||
// Derived class, spaces before and after the colon
|
||||
class Derived : public Base
|
||||
{
|
||||
};
|
||||
```
|
||||
|
||||
* Prefer pre-increment, pre-decrement operators
|
||||
```c++
|
||||
++i, --j; // Yes
|
||||
i++, j--; // No
|
||||
```
|
||||
|
||||
* private/public/protected must not be indented
|
||||
@@ -304,5 +389,16 @@ for (int a = 0; a < b; ++b) {
|
||||
|
||||
* Method definitions aren't allowed in header files
|
||||
|
||||
### 10. Not covered above ###
|
||||
If something isn't covered above, just follow the same style the file you are editing has. If that particular detail isn't present in the file you are editing, then use whatever the rest of the project uses.
|
||||
### 10. Git commit message ###
|
||||
1. Limit the subject line to 50 characters. Subject should contain only the very essence of the changes (you should avoid extra details and internals)
|
||||
2. Separate subject from body with a blank line
|
||||
3. Capitalize the subject line
|
||||
4. Do not end the subject line with a period
|
||||
5. Use the imperative mood in the subject line (it's like you're ordering the program to do something (e.g. "Don't create temporary substrings")
|
||||
6. Wrap the body at 72 characters
|
||||
7. Use the body to explain what and why vs. how
|
||||
8. If commit fixes a reported issue, mention it in the message body (e.g. `Closes #4134.`)
|
||||
|
||||
### 11. Not covered above ###
|
||||
If something isn't covered above, just follow the same style the file you are editing has.
|
||||
*This guide is not exhaustive and the style for a particular piece of code not specified here will be determined by project members on code review.*
|
||||
|
||||
238
CONTRIBUTING.md
@@ -1,35 +1,221 @@
|
||||
# Filing an issue
|
||||
# How to contribute to qBittorrent
|
||||
|
||||
### Must read
|
||||
* If you aren't sure, you can ask on the [**forum**](http://forum.qbittorrent.org) or read our [**wiki**](http://wiki.qbittorrent.org) first.
|
||||
* Do a quick **search**. Others might already reported the issue.
|
||||
* Write in **English**!
|
||||
* Provide **version** information: (You can find version numbers at menu `Help -> About -> Libraries`)
|
||||
```
|
||||
qBittorrent:
|
||||
Qt:
|
||||
libtorrent:
|
||||
boost:
|
||||
OS version:
|
||||
```
|
||||
* Provide **steps** to reproduce the problem, it will be easier to pinpoint the fault.
|
||||
* **Screenshots**! A screenshot is worth a thousand words. just upload it. [(How?)](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests)
|
||||
There are three main ways to contribute to the project.
|
||||
Read the respective section to find out more.
|
||||
|
||||
### Good to know
|
||||
* **Be patient**. The dev team is small and resource limited. Devs finding their free time, analyzing the problem and fixing the issue, it all takes time. :clock3:
|
||||
* If you can code, why not become a **contributor** by fixing the issue and open a pull request? :wink:
|
||||
* Harsh words or threats won't help your situation. What's worse, your complain will (very likely) to be **ignored**. :fearful:
|
||||
### Table Of Contents
|
||||
|
||||
* **[Bug reporting etiquette](#bug-reporting-etiquette)**
|
||||
|
||||
|
||||
* **[Submitting an issue/bug report](#submitting-an-issuebug-report)**
|
||||
* [What is an actual bug report?](#what-is-an-actual-bug-report)
|
||||
* [Before submitting a bug report](#before-submitting-a-bug-report)
|
||||
* [Steps to ensure a good bug report](#steps-to-ensure-a-good-bug-report)
|
||||
|
||||
|
||||
* **[Suggesting enhancements/feature requests](#suggesting-enhancementsfeature-requests)**
|
||||
* [Before submitting an enhancement/feature request](#before-submitting-an-enhancementfeature-request)
|
||||
* [Steps to ensure a good enhancement/feature suggestion](#steps-to-ensure-a-good-enhancementfeature-suggestion)
|
||||
|
||||
|
||||
* **[Opening a pull request](#opening-a-pull-request)**
|
||||
* [Must read](#must-read)
|
||||
* [Good to know](#good-to-know)
|
||||
|
||||
# Bug reporting etiquette
|
||||
|
||||
* Issues, pull requests, and comments must always be in **English.**
|
||||
|
||||
* This project is supported by volunteers, do not expect "customer support"-style interaction.
|
||||
|
||||
* **Be patient.** The development team is small and resource limited. Developers and contributors take from their free time to analyze the problem and fix the issue. :clock3:
|
||||
|
||||
* Harsh words or threats won't help your situation. What's worse, your complain will (very likely) be **ignored.** :fearful:
|
||||
|
||||
# Submitting an issue/bug report
|
||||
|
||||
This section guides you through submitting an issue/bug report for qBittorrent.
|
||||
|
||||
Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
|
||||
|
||||
Make sure to follow these rules carefully when submitting a bug report. Failure to do so will result in the issue being closed.
|
||||
|
||||
## What is an actual bug report?
|
||||
|
||||
Developers and contributors are not supposed to deal with issues for which little to no investigation to find the actual cause of a purported issue was made by the reporter.
|
||||
|
||||
Positive contributions are those which are reported with efforts to find the actual cause of an issue, or at the very least efforts were made to narrow it as much as possible.
|
||||
|
||||
Requiring people to investigate as much as possible before opening an issue will more than likely avoid burdening the project with invalid issues or issues unrelated to qBittorrent.
|
||||
|
||||
The following are _not_ bug reports. **Check the [wiki][wiki-url], [forum][forum-url] or other places for help and support for issues like these**:
|
||||
|
||||
- Explanation of qBittorrent options (see [wiki][wiki-url]).
|
||||
- Help with WebUI setup.
|
||||
- Help with embedded tracker setup.
|
||||
- Help about BitTorrent in general.
|
||||
- Issues with specific search plugins.
|
||||
- Asking for specific builds of qBittorrent other than the current one. You can install older releases at your own risk or for regression testing purposes. Previous Windows and macOS builds are available [here][builds-url].
|
||||
- If you want older Linux builds, you will have to compile them yourself from the corresponding commits, or ask someone on the [forum][forum-url] to do it for you.
|
||||
- Possibly others. Read on and use common sense.
|
||||
|
||||
The issue tracker is for provable issues only: You will have to make the case that the issue is really with qBittorrent and not something else on your side.
|
||||
|
||||
To make a case means to provide detailed steps so that anybody can reproduce the issue.
|
||||
Be sure to rule out that the issue is not caused by something specific on your side.
|
||||
|
||||
Issue reports for bugs that apparently aren't easily reproducible or that you can't figure out what triggers it even though you tried are OK.
|
||||
|
||||
Any issue opened without effort to provide the required details for developers, contributors or anybody else to reproduce the problem will be closed as invalid.
|
||||
For example:
|
||||
- Crash reports with just a stack trace.
|
||||
- Speculated performance issues that do not come with actual profiling data + analysis supporting the claim.
|
||||
|
||||
## Before submitting a bug report
|
||||
|
||||
- **Do some basic troubleshooting (examples)**:
|
||||
- Restart qBittorrent.
|
||||
- Restart your PC.
|
||||
- Update your OS (e.g. Windows updates).
|
||||
- Update your network card drivers.
|
||||
- Fully reinstall qBittorrent.
|
||||
- etc...
|
||||
- Make sure the problem is not caused by anti-virus or other program messing with your files.
|
||||
- Check if you can reproduce the problem in the latest version of qBittorrent.
|
||||
- **Check [forum][forum-url] and [wiki][wiki-url].** You might be able to find the cause of the problem and fix things yourself.
|
||||
- **Check if the issue exists already in the issue tracker.**
|
||||
- If it does and the issue is still open, add a comment to the existing issue instead of opening a new one.
|
||||
- If you find a Closed issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
|
||||
- If the issue is with the search functionality:
|
||||
- **Make sure you have [`python`][python-url] installed correctly (remember the search functionality requires a working python installation).**
|
||||
- Make sure it is in fact a problem with the search functionality itself, and not a problem with the plugins. If something does not work properly with the search functionality, the first step is to rule out search plugin-related issues.
|
||||
- For search plugin issues, report on the respective search plugin support page, or at [qbittorrent/search-plugins][search-plugins-url].
|
||||
|
||||
## Steps to ensure a good bug report
|
||||
|
||||
**Follow these guidelines** in order to provide as much useful information as possible right away. Not all of them are applicable to all issues, but you are expected to follow most of these steps (use common sense).
|
||||
Otherwise, we've noticed that a lot of your time (and the developers') gets thrown away on exchanging back and forth to get this information.
|
||||
|
||||
* Use a **clear and descriptive title** for the issue to identify the problem.
|
||||
|
||||
* Post only **one specific issue per submission.**
|
||||
|
||||
* **Fill out the issue template properly.**
|
||||
|
||||
- **Make sure you are using qBittorrent on a supported platform.** Do not submit issues which can only be reproduced on beta/unsupported releases of supported operating systems (e.g. Windows 10 Insider, Ubuntu 12.04 LTS, etc).
|
||||
These are unstable/unsupported platforms, and in all likelihood, whatever the issue is, it is not related to qBittorrent.
|
||||
|
||||
* **Specify the OS you're using, its version and architecture.**
|
||||
* Examples: Windows 8.1 32-bit, Linux Mint 17.1 64-bit, Windows 10 Fall creators Update 64-bit, etc.
|
||||
|
||||
|
||||
* **Report only if you run into the issue with an official stable release, a beta release, or with the most recent upstream changes (in this last case specify the specific commit you are on).** (beta testing is encouraged :smile:). We do not provide support for bugs on unofficial Windows builds.
|
||||
|
||||
* **Specify the version of qBittorrent** you are using, as well as its **architecture** (x86 or x64) and its **libraries' versions** (Help -> About -> Libraries).
|
||||
|
||||
* Specify **how you installed**:
|
||||
- Linux: either from the PPA, your distribution's repositories, or compiled from source, or even possibly third-party repositories.
|
||||
- Windows: either from the installer, or compiled from source, or even possibly third-party repositories.
|
||||
- macOS: either from the installer, or compiled from source, or even possibly third-party repositories.
|
||||
|
||||
|
||||
* **Describe the exact steps which reproduce the problem in as many details as possible.**
|
||||
- For example, start by explaining how you started qBittorrent, e.g. was it via the terminal? Desktop icon? Did you start it as root or normal user?
|
||||
- **When listing steps, don't just say what you did, but explain how you did it.**
|
||||
- For example, if you added a torrent for download, did you do so via a `.torrent` file or via a magnet link? If it was with a torrent file did you do so by dragging the torrent file from the file manager to the transfer list, or did you use the "Add Torrent File" in the Top Bar?
|
||||
- Describe the behavior you observed after following the steps and point out what exactly is the problem with that behavior; this is what we'll be looking for after executing the steps.
|
||||
|
||||
|
||||
* **Explain which behavior you expected to see instead** and why.
|
||||
|
||||
* Use **screenshots/animated GIFs to help describe the issue** whenever appropriate [(How?)][attachments-howto-url].
|
||||
|
||||
* If the problem wasn't triggered by a specific action, describe what you were doing before the problem happened.
|
||||
|
||||
* **If you are reporting that qBittorrent crashes**, include the stack trace in the report; include it in a code block, a file attachment, or put it in a gist and provide link to that gist.
|
||||
|
||||
* **For performance-related issues**, include as much profiling data as you can (resource usage graphs, etc).
|
||||
|
||||
* Paste the **qBittorrent log** (or put the contents of the log in a gist and provide a link to the gist). The log can be viewed in the GUI (View -> Log -> tick all boxes). If you can't do that, the file is at:
|
||||
- Linux: `~/.local/share/data/qBittorrent/logs/qBittorrent.log`
|
||||
- Windows: `%LocalAppData%\qBittorrent\logs`
|
||||
- macOS: `~/Library/Application Support/qBittorrent/qBittorrent.log`
|
||||
|
||||
|
||||
* **Do NOT post comments like "+1" or "me too!"** without providing new relevant info on the issue. Using the built-in reactions is OK though. Remember that you can use the "subscribe" button to receive notifications of that report without having to comment first.
|
||||
|
||||
* If there seems to be an **issue with specific torrent files/magnet links**:
|
||||
- Don't post private `.torrent` files/magnet links, or ones that point to copyrighted content. If you are willing, offer to email a link or the `.torrent` file itself to whoever developer is debugging it and requests it.
|
||||
- Make sure you can't reproduce the problem with another client, to rule out the possibility that the issue is with the `.torrent` file/magnet link itself.
|
||||
|
||||
|
||||
* A screenshot, transcription or file upload of any of **qBittorrent's preferences that differ from the defaults.** Please include everything different from the defaults whether or not it seems relevant to your issue.
|
||||
|
||||
* **Attachment rules**:
|
||||
- Short logs and error messages can be pasted as quotes/code whenever small enough; otherwise make a gist with the contents and post the link to the gist.
|
||||
- Avoid linking/attaching impractical file formats such as PDFs/Word documents with images. If you want to post an image, just post the image.
|
||||
|
||||
### Provide more context by answering these questions (if applicable):
|
||||
|
||||
- Can you **reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens (e.g. only happens with extremely large torrents/only happens after qBittorrent is open for more than 2 days/etc...)
|
||||
|
||||
- Did the problem start happening recently (e.g. after updating to a new version of qBittorrent) or was this always a problem?
|
||||
|
||||
- If the problem started happening recently, can you reproduce the problem in an older version of qBittorrent?
|
||||
|
||||
- Are you saving files locally (in a disk in your machine), or are you saving them remotely (e.g. network drives)?
|
||||
|
||||
- Are you using qBittorrent with multiple monitors? If so, can you reproduce the problem when you use a single monitor?
|
||||
|
||||
Good read: [How to Report Bugs Effectively][howto-report-bugs-url]
|
||||
|
||||
# Suggesting enhancements/feature requests
|
||||
|
||||
This section guides you through submitting an enhancement suggestion for qBittorrent, including completely new features and minor improvements to existing functionality.
|
||||
|
||||
Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
|
||||
|
||||
## Before submitting an enhancement/feature request
|
||||
|
||||
* Check the [wiki][wiki-url] and [forum][forum-url] for tips — you might discover that the enhancement is already available.
|
||||
* Most importantly, check if you're using the latest version of qBittorrent and if you can get the desired behavior by changing qBittorrent's settings.
|
||||
* Check in the [releases][releases-url] page or on the [forum][forum-url], see if there's already a alpha/beta version with that enhancement.
|
||||
* Perform a cursory search to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
||||
|
||||
## Steps to ensure a good enhancement/feature suggestion
|
||||
|
||||
- Specify which version of qBittorrent you're using.
|
||||
- Specify the name and version of the OS you're using.
|
||||
- Provide a step-by-step description of the suggested enhancement in as many details as possible.
|
||||
- Describe the current behavior and explain which behavior you expected to see instead and why.
|
||||
- Include screenshots and animated GIFs which help you demonstrate the steps or point out the part of qBittorrent which the suggestion is related to.
|
||||
- If this enhancement exists in other BitTorrent clients, list those clients.
|
||||
|
||||
# Opening a pull request
|
||||
|
||||
### Must read
|
||||
* Read our [**coding guidelines**](https://github.com/qbittorrent/qBittorrent/blob/master/CODING_GUIDELINES.md). There are some scripts to help you: [uncrustify script](https://raw.githubusercontent.com/qbittorrent/qBittorrent/master/uncrustify.cfg), [astyle script](https://gist.github.com/Chocobo1/539cee860d1eef0acfa6), [(related thread)](https://github.com/qbittorrent/qBittorrent/issues/2192).
|
||||
* Keep the title **short** and provide a **clear** description about what your pull request does.
|
||||
* Provide **screenshots** for UI related changes.
|
||||
* Keep your git commit history **clean** and **precise**. Commits like `xxx fixup` should not appear.
|
||||
* If your commit fix a reported issue (for example #4134), add the following message to the commit `Closes #4134.`. Example [here](https://github.com/qbittorrent/qBittorrent/commit/a74bac20c4e8de9776bf9bb77fdc7526135d1988).
|
||||
* Read our [**coding guidelines**][coding-guidelines-url]. There are some scripts to help you: [uncrustify script][uncrustify-script-url], [astyle script][astyle-script-url], [(related thread)][coding-guidelines-thread-url].
|
||||
* Keep the title **short** and provide a **clear** description about what your pull request does.
|
||||
* Provide **screenshots** for UI related changes.
|
||||
* Keep your git commit history **clean** and **precise.** Refer to the section about "Git commit messages" in the [**coding guidelines**][coding-guidelines-url].
|
||||
* If your commit fixes a reported issue (for example #4134), add the following message to the commit `Closes #4134.`. Example [here][commit-message-fix-issue-example-url].
|
||||
|
||||
### Good to know
|
||||
* **Search** pull request history! Others might already implemented your idea and is waiting to be merged (or got rejected already). Save your precious time by doing a search first.
|
||||
* When resolving merge conflicts, do `git rebase <target_branch_name>`, don't do `git pull`. Then you can start fixing the conflicts. Here is a good explanation: [link](https://www.atlassian.com/git/tutorials/merging-vs-rebasing).
|
||||
* **Search** pull request history! Others might have already implemented your idea and it is waiting to be merged (or got rejected already). Save your precious time by doing a search first.
|
||||
* When resolving merge conflicts, do `git rebase <target_branch_name>`, don't do `git pull`. Then you can start fixing the conflicts. Here is a good explanation: [link][merging-vs-rebasing-url].
|
||||
|
||||
[astyle-script-url]: https://gist.github.com/Chocobo1/539cee860d1eef0acfa6
|
||||
[attachments-howto-url]: https://help.github.com/articles/file-attachments-on-issues-and-pull-requests
|
||||
[coding-guidelines-url]: https://github.com/qbittorrent/qBittorrent/blob/master/CODING_GUIDELINES.md
|
||||
[coding-guidelines-thread-url]: https://github.com/qbittorrent/qBittorrent/issues/2192
|
||||
[commit-message-fix-issue-example-url]: https://github.com/qbittorrent/qBittorrent/commit/c07cd440cd46345297debb47cb260f8688975f50
|
||||
[forum-url]: http://forum.qbittorrent.org/
|
||||
[howto-report-bugs-url]: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
|
||||
[merging-vs-rebasing-url]: https://www.atlassian.com/git/tutorials/merging-vs-rebasing
|
||||
[python-url]: https://www.python.org/
|
||||
[releases-url]: https://github.com/qbittorrent/qBittorrent/releases
|
||||
[search-plugins-url]: https://github.com/qbittorrent/search-plugins
|
||||
[uncrustify-script-url]: https://raw.githubusercontent.com/qbittorrent/qBittorrent/master/uncrustify.cfg
|
||||
[wiki-url]: https://github.com/qbittorrent/qBittorrent/wiki
|
||||
[builds-url]: https://sourceforge.net/projects/qbittorrent/files/
|
||||
|
||||
245
Changelog
@@ -1,4 +1,142 @@
|
||||
Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
* Sat May 05 2018 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.0
|
||||
- FEATURE: Add "Coalesce reads & writes" checkbox in advanced options (Chocobo1)
|
||||
- FEATURE: Smart Filter for RSS (Stephen Dawkins)
|
||||
- FEATURE: Possibility to configure at which speed a torrent is considered slow (thalieht)
|
||||
- FEATURE: When creating a torrent you can choose to preserve the file order (toster, Chocobo1)
|
||||
- FEATURE: A new, redesigned and refactored WebAPI (glassez)
|
||||
- BUGFIX: Redefine CacheStatus.readRatio field. (Chocobo1)
|
||||
- BUGFIX: Clarify some terms in stats dialog (Chocobo1)
|
||||
- BUGFIX: Fix possible crash when using both share limits (thalieht)
|
||||
- BUGFIX: Disable options when `Disable connections not supported by proxies` is enabled (Thomas Piccirello)
|
||||
- BUGFIX: Add link to an explanation of `Disable connections not supported by proxies` (Thomas Piccirello)
|
||||
- BUGFIX: Fix typo in a log message (Andrei Stepanov)
|
||||
- BUGFIX: Fix loading very large torrents. Closes #8449. (Chocobo1)
|
||||
- BUGFIX: Fix reverting backslashes to slashes in run external program. Closes #7800 (Chocobo1)
|
||||
- BUGFIX: Use https for documentation links (Chocobo1)
|
||||
- BUGFIX: Use original scheme when downloading favicons (Chocobo1)
|
||||
- BUGFIX: Parse URL query string at application level (glassez)
|
||||
- BUGFIX: Properly reply to announce request (embedded tracker) (glassez)
|
||||
- BUGFIX: Add `Tags` parameter to "Run External Program" (Chocobo1)
|
||||
- BUGFIX: Fix various typos (Chocobo1)
|
||||
- BUGFIX: Refactor filesystem watcher. Delay before processing new files. (Chocobo1)
|
||||
- BUGFIX: Don't strip empty arguments passed to external program. Closes #8454. (Chocobo1)
|
||||
- BUGFIX: Stop creating Download folder on start (Chocobo1)
|
||||
- BUGFIX: Avoid data corruption when rechecking paused torrents (sledgehammer999)
|
||||
- BUGFIX: Fix crashes due to invalid iterator use (Luís Pereira)
|
||||
- BUGFIX: Fix renaming completed files (Chocobo1)
|
||||
- BUGFIX: Fix path separator in log messages (Chocobo1)
|
||||
- WEBUI: Switch built-in Web UI html to HTML5 (glassez)
|
||||
- WEBUI: WebUI Save user's resized window sizes (Thomas Piccirello)
|
||||
- WEBUI: Make download + upload windows resizable (Thomas Piccirello)
|
||||
- WEBUI: Add option to show/hide webui status bar (Thomas Piccirello)
|
||||
- WEBUI: Add "Use proxy only for torrents" option to webui (Thomas Piccirello)
|
||||
- WEBUI: Various fixes in the html code (Thomas Piccirello)
|
||||
- WEBUI: Don't unselect selected torrents after a few seconds (Thomas Piccirello)
|
||||
- WEBUI: Enable Http/1.1 persistence connection (Chocobo1)
|
||||
- WEBUI: Format Read cache hits as percentage (Thomas Piccirello)
|
||||
- WEBUI: Re-order and rename stats (Thomas Piccirello)
|
||||
- WEBUI: Right align stat values (Thomas Piccirello)
|
||||
- WEBUI: Enable Statistics window to be scrolled and resized (Tom Piccirello)
|
||||
- WEBUI: Save WebUI Statistics window size (Thomas Piccirello)
|
||||
- WEBUI: Make WebUI iframe windows scrollable on iOS (Thomas Piccirello)
|
||||
- WEBUI: Remove unused CSS from WebUI login page (Thomas Piccirello)
|
||||
- WEBUI: Consolidate CSS into style.css (Thomas Piccirello)
|
||||
- WEBUI: Resolve JavaScript errors (Thomas Piccirello)
|
||||
- WEBUI: Fix spacing in login form(Thomas Piccirello)
|
||||
- WEBUI: Update WebUI to be more compliant with HTML5 standard (Chocobo1)
|
||||
- WEBUI: Update clipboard.js to v2.0.0 (Chocobo1)
|
||||
- WEBUI: Remove unused JavaScript library (Chocobo1)
|
||||
- WEBUI: Fix setting preferences via WebAPI (glassez)
|
||||
- WEBUI: Rename property to match its definition (Thomas Piccirello)
|
||||
- WEBUI: Add Limit Share Ratio context menu option (Thomas Piccirello)
|
||||
- RSS: Disable Auto TMM when RSS rule has save path (glassez)
|
||||
- RSS: Process loaded RSS articles in case of error (glassez)
|
||||
- RSS: Resolve (X)HTML entities in RSS content (glassez)
|
||||
- SEARCH: Improve Search handling (glassez)
|
||||
- SEARCH: Calculate supported categories based on selected plugin (Thomas Piccirello)
|
||||
- SEARCH: Fix memory leak (Chocobo1)
|
||||
- COSMETIC: Use spinbox suffix to display rate/time units (thalieht)
|
||||
- COSMETIC: Avoid showing an empty row in AdvancedSettings (Chocobo1)
|
||||
- OTHER: Various code optimizations and fixes (Luís Pereira, Chocobo1)
|
||||
- OTHER: Fix build when using Clang under CMake (Luís Pereira)
|
||||
- OTHER: Allow to disable Stacktrace support (Nick Korotysh)
|
||||
- OTHER: Use RNG provided by OS (Chocobo1)
|
||||
|
||||
* Fri Feb 16 2018 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.0.4
|
||||
- FEATURE: Add source field in Torrent creator. Closes #7965. (Chocobo1)
|
||||
- FEATURE: Torrent creator: raise maximum piece size to 32 MiB (Chocobo1)
|
||||
- FEATURE: Add a force reannounce option in the transfer list context menu. Closes #6448. (Jesse Bryan)
|
||||
- BUGFIX: Fix sorting of country flags column in Peers tab. (sledgehammer999)
|
||||
- BUGFIX: Fix natural sorting when the common part of 2 strings ends partially in a number which continues in the uncommon part. Closes #8080 #6732. (sledgehammer999)
|
||||
- BUGFIX: Fix application of speed limits on LAN and μTP connections. Closes #7745. (sledgehammer999)
|
||||
- BUGFIX: Make peer information flags in peerlist more readable. (thalieht)
|
||||
- BUGFIX: Fix gui issues on high DPI monitor. (Chocobo1)
|
||||
- BUGFIX: Fix dialog and column size on high DPI monitors. (Chocobo1)
|
||||
- BUGFIX: Fix constant status of '[F] Downloading'. Closes #7628. (sledgehammer999)
|
||||
- BUGFIX: Fix translation context. Closes #8211. (sledgehammer999)
|
||||
- BUGFIX: Separate subnet whitelist options into two lines. (Thomas Piccirello)
|
||||
- BUGFIX: Don't set application name twice. (Luís Pereira)
|
||||
- BUGFIX: Set default file log size to 65 KiB and delete backup logs older than 1 month. (sledgehammer999)
|
||||
- WEBUI: Only prepend scheme when it is not present. Closes #8057. (Chocobo1)
|
||||
- WEBUI: Add "Remaining" and "Availability" columns to webui Content tab. (Thomas Piccirello)
|
||||
- WEBUI: Make value formatting consistent with GUI (Thomas Piccirello)
|
||||
- WEBUI: Reposition Total Size column to match gui (Thomas Piccirello)
|
||||
- WEBUI: Add Tags and Time Active columns (Thomas Piccirello)
|
||||
- WEBUI: Use https for www.qbittorrent.org (Thomas Piccirello)
|
||||
- WEBUI: Match webui statuses to gui, closes #7516 (Thomas Piccirello)
|
||||
- WEBUI: Right-align stat values (Thomas Piccirello)
|
||||
- WEBUI: Add missing units. (Thomas Piccirello)
|
||||
- RSS: Fix crash when deleting rule because it tries to update. Closes #8094 (glassez)
|
||||
- RSS: Don't process new/updated RSS rules when disabled (glassez)
|
||||
- RSS: Remove legacy and corrupted RSS settings (glassez)
|
||||
- SEARCH: Search only when category is supported by plugin. Closes #8053. (jan.karberg)
|
||||
- SEARCH: Only add search separators as needed. (Thomas Piccirello)
|
||||
- COSMETIC: Tweak spacing in torrent properties widget and speed widget. (Chocobo1)
|
||||
- WINDOWS: Use standard folder icon for open file behavior on Windows. Closes #7880. (Chocobo1)
|
||||
- WINDOWS: Revert "Run external program" function. Now you will not be able to directly run batch scripts. (Chocobo1)
|
||||
- MACOS: Fix torrent file selection in Finder on mac (vit9696)
|
||||
- MACOS: Fix Finder reveal in preview and torrent contents (vit9696)
|
||||
- MACOS: Fix cmd+w not closing the main window on macOS (vit9696)
|
||||
- OTHER: Fix splitting of compiler flags in configure. Autoconf removes a set of [] during script translation, resulting in a wrong sed command. (sledgehammer999)
|
||||
- OTHER: configure: Parse all compiler related flags together. (sledgehammer999)
|
||||
- OTHER: Update copyright year. (sledgehammer999)
|
||||
|
||||
* Sun Dec 17 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.0.3
|
||||
- BUGFIX: Add height padding to the transfer list icons. Closes #7951. (sledgehammer999)
|
||||
- BUGFIX: Allow to drag-n-drop URLs into mainwindow to initiate download. (Chocobo1)
|
||||
- BUGFIX: Fix crash when fitlering search results. Stable sorting is removed. Closes #7952.(Chocobo1)
|
||||
- WEBUI: Fix missing qbt logo on login page in webUI. Closes #7953. (Chocobo1)
|
||||
- WEBUI: Add check to avoid type error after logout. (Chocobo1)
|
||||
- WEBUI: Use POST for logout command. This is to avoid browser being smart to prefetch the link then logging out the user. (Chocobo1)
|
||||
- WEBUI: Fix WebUI is not reachable via IPv6. (glassez)
|
||||
- WINDOWS: Disable the "?" help button in all dialogs on Windows. Closes #7365. Requires Qt 5.10. (Chocobo1)
|
||||
|
||||
* Fri Dec 01 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.0.2
|
||||
- BUGFIX: Fix crash on some systems when creating address object for 255.255.255.255. Closes #7735. (sledgehammer999)
|
||||
- PERFORMANCE: Change MixedModeAlgorithm default to TCP. This was the v3_3_x default and should sustain higher speeds. Closes #7779. (Chocobo1)
|
||||
- PERFORMANCE: Stop logging IP filter parsing errors after a while, otherwise the GUI freezes or qBittorrent doesn't start. (sledgehammer999)
|
||||
- GUI: Implement stable sort. Rows in transfer list shouldn't flicker anymore. (Chocobo1)
|
||||
- WEBUI: Fix build when webui is disabled. (Heiko Becker)
|
||||
- RSS: Fix build because of missing header. Closes #7805. (thoradia)
|
||||
- RSS: Fix RSS parser. (glassez)
|
||||
- RSS: Implement Import/Export RSS rules in legacy(aka v3_3_x) format. (glassez)
|
||||
- RSS: Implement Import/Export RSS rules in JSON format. (glassez)
|
||||
- WINDOWS: Fixed blurry text under Windows by setting DPI awareness to default. (TheNicker)
|
||||
- LINUX: Fix i386 build. (Evgeny Lensky)
|
||||
|
||||
* Wed Nov 22 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.0.1
|
||||
- BUGFIX: Fix crash on opening torrent/magnet (uninitialized pointer). Closes #7739 #7723. (sledgehammer999)
|
||||
- BUGFIX: Enable preferences Apply button when ip banlist is modified (Thomas Piccirello)
|
||||
- BUGFIX: Allow drag-n-drop magnet links to mainwindow. Closes #7742. (Chocobo1)
|
||||
- BUGFIX: Fix crash when aborting a torrent creation process. Closes #7783. (Chocobo1)
|
||||
- BUGFIX: Correctly check if torrent passed during application start already exists. (sledgehammer999)
|
||||
- WEBUI: Add ip subnet whitelist for bypassing webui auth (Thomas Piccirello)
|
||||
- WEBUI: Fix logo missing in login page (Chocobo1)
|
||||
- COSMETIC: Fix english typo. (sledgehammer999)
|
||||
- OTHER: cmake: qtsingleapplication should always be built statically (luigino)
|
||||
|
||||
* Mon Nov 20 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.0.0
|
||||
- FEATURE: Change qbittorrent logo. Issue #6467. (HVS, Atif Afzal, sledgehammer999)
|
||||
- FEATURE: New icon theme with SVG source, so we can scale it appropriately in the future. (Bert Verhelst)
|
||||
- FEATURE: Drop Qt 4 support. Raise minimum Qt version to 5.5.1 (evsh)
|
||||
- FEATURE: UI for managing locally banned IP list (dzmat)
|
||||
@@ -18,20 +156,85 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- FEATURE: Fetch Favicons via google as a final fallback (KingLucius)
|
||||
- FEATURE: Add a Tags (multi-label) feature to the GUI. Closes #13. (tgregerson)
|
||||
- FEATURE: Use the system icons for each file type in the Content tab (evsh)
|
||||
- FEATURE: Use SVG files for monochrome tray icons. Closes #6085. (evsh)
|
||||
- FEATURE: Prefill torrent name when creating a new torrent. Closes #7229. (Chocobo1)
|
||||
- FEATURE: Expose more libtorrent options in advanced settings (Chocobo1)
|
||||
- FEATURE: Add comboBox for selecting BitTorrent protocol. Closes #6316. (Chocobo1)
|
||||
- FEATURE: Allow SMTP sender to be set. Closes #7575. (Chocobo1)
|
||||
- FEATURE: Allow to specify if announcing to all tiers is desired. (sledgehammer999)
|
||||
- FEATURE: Configurable number of history of paths in Add New Torrent dialog. (evsh)
|
||||
- BUGFIX: Adjust icons names to better fit FDO scheme (evsh)
|
||||
- BUGFIX: Optimized IP filter parsing, making blazingly fast (sledgehammer999, evsh)
|
||||
- BUGFIX: Fix dialogs didn't position on the correct screen which qBittorrent window is on. Closes #1690, #2474, #3538. (Chocobo1)
|
||||
- BUGFIX: Refactor and improve StatusBar (glassez)
|
||||
- BUGFIX: Set expiration date for newly added cookie to +2 years from now, instead of +99 years. (Chocobo1)
|
||||
- BUGFIX: Don't create subfolder inside temp folder (glassez)
|
||||
- BUGFIX: Don't replace existing files when relocating torrent (glassez)
|
||||
- BUGFIX: Fix explicit Torrent Management Mode in Add New Torrent dialog. Closes #5602. (sledgehammer999)
|
||||
- BUGFIX: Fix calculation of 'Average time in queue' stat under libtorrent 1.1.x (sledgehammer999)
|
||||
- BUGFIX: Don't disable bandwidth scheduler when manually switching speed limits. Closes #7306. (glassez)
|
||||
- BUGFIX: Fix dereferencing freed pointer. Closes #7420. (Chocobo1)
|
||||
- BUGFIX: Change the default cache size to 64MiB. (Chocobo1)
|
||||
- BUGFIX: The previous "Disk write cache size" is not accurate since it is also being used for read cache, so rename it to "Disk cache". (Chocobo1)
|
||||
- BUGFIX: Replace dialog ok-cancel buttons with QDialogButtonBox, which follows the platform specific button order. (Chocobo1)
|
||||
- BUGFIX: Better reporting of success/failure of torrent and file deletion. (sledgehammer999)
|
||||
- BUGFIX: Fix last activity calculation. Closes #7461. (Chocobo1)
|
||||
- BUGFIX: Save state of options windows on cancel too. (silverqx)
|
||||
- BUGFIX: Persist size and treeview header state in preview dialog. (silverqx)
|
||||
- BUGFIX: Show torrent name in "add new torrent" dialog on merging trackers (Chocobo1)
|
||||
- BUGFIX: Properly pre-select the selected torrent's current ratio limiting options in UpDownRatioDlg dialogs. Fixes #7352 (thalieht)
|
||||
- BUGFIX: Optimize code for SpeedWidget. (dzmat)
|
||||
- BUGFIX: Disable processing events when adding torrents(prevents crashes). Closes #7436. (Chocobo1)
|
||||
- BUGFIX: Open links in browser. Closes #7651. (Chocobo1)
|
||||
- BUGFIX: Change default settings for tracker/tier announces to mimic μTorrent behavior. (sledgehammer999)
|
||||
- BUGFIX: Explicitly set UPnP state on start-up. Closes #7338. (Chocobo1)
|
||||
- BUGFIX: Include/print caught signal in stackdump (Chocobo1)
|
||||
- COSMETIC: Trackerlist: Set text alignment of columns with numbers to the right (thalieht)
|
||||
- COSMETIC: Enable alternatingRowColors for "Manage Cookie" dialog (Chocobo1)
|
||||
- COSMETIC: Remove indentation for category/tag filter widgets in all platforms (thalieht)
|
||||
- COSMETIC: Add space between widgets in left side panel. Closes #7224. (Chocobo1, glassez)
|
||||
- COSMETIC: Unify preference window borders across the tabs (vit9696)
|
||||
- COSMETIC: Center Options dialog when showed. (silverqx)
|
||||
- COSMETIC: Show delete accelerator key in menu. closes #7508 (Nick Korotysh)
|
||||
- COSMETIC: Set QTextOption::NoWrap property in "Download from URLs" dialog (Chocobo1)
|
||||
- COSMETIC: Use SVG icons for the country flags. Closes #6223. (sledgehammer999)
|
||||
- WEBUI: Allow to load/use ECDSA certificate in webUI. (Chocobo1)
|
||||
- WEBUI: Add copy options to webui context menu (addresses #6815) (#7036) (Tom Piccirello)
|
||||
- WEBUI: Set torrent location from webui context menu (addresses #6815) (#7062) (Tom Piccirello)
|
||||
- WEBUI: Add option to rename torrent from WebUI (Thomas Piccirello)
|
||||
- WEBUI: Add auto torrent management to webui context menu (addresses #6815) (Thomas Piccirello)
|
||||
- WEBUI: Option for "Create subfolder" when adding new torrent. (thalieht)
|
||||
- WEBUI: Fix addPaused wrong default behavior. (Chocobo1)
|
||||
- WEBUI: Reposition "Priority" menu option in WebUI to match gui. Closes #7072. (Thomas Piccirello)
|
||||
- WEBUI: Report TCPServer errorString() if webui fails to listen to port. (Matthew Fioravante)
|
||||
- WEBUI: Exit gracefully when failed to initialize web server with qbt-nox (Chocobo1)
|
||||
- WEBUI: Add file-to-piece-index mappings in /query/propertiesFiles command (Chocobo1)
|
||||
- WEBUI: Add optional parameters for /command/download & /command/upload (Chocobo1)
|
||||
- WEBUI: Print error messages upon receiving invalid header fields. (Chocobo1)
|
||||
- WEBUI: Add WebUi\Address config option. (Matthew Fioravante)
|
||||
- WEBUI: Reinitialize webUI server when "IP address" setting changed. An app restart won't be necessary from now on. (Chocobo1)
|
||||
- WEBUI: Improve log and error messages (Chocobo1)
|
||||
- SEARCH: Use explicit class for search plugin versions (evsh)
|
||||
- SEARCH: Remove all search plugins from repo. There is another repo named 'search-plugins'. (sledgehammer999)
|
||||
- SEARCH: Update the backend when a new plugin favicon is downloaded. (sledgehammer999)
|
||||
- SEARCH: Allow search plugins sorting. Closes #7526. (Nick Korotysh)
|
||||
- RSS: Redesigned RSS subsystem (glassez)
|
||||
- RSS: Do not use hardcoded colors in RSS feed view (evsh)
|
||||
- RSS: Improve RSS events logging (glassez)
|
||||
- WINDOWS: Use dpiawareness=1 on Windows. Closes #5393. (sledgehammer999)
|
||||
- WINDOWS: Reformat Windows build configuration files. (glassez)
|
||||
- LINUX: Allow custom tray icons when system icon theme is used. Closes #7403. (evsh)
|
||||
- MACOS: Various macOS UI improvements (vit9696)
|
||||
- MACOS: Fix main menu item location on macOS (vit9696)
|
||||
- MACOS: Fix macOS window restoration after using hide icon (vit9696)
|
||||
- MACOS: Fix notification display on macOS (vit9696)
|
||||
- OTHER: Use new classes/methods from libtorrent and stop using deprecate ones. (glassez)
|
||||
- OTHER: Various string fixes (Allan Nordhøy, sledgehammer999)
|
||||
- OTHER: cmake: do not use Qt5Widgets when locating QtSingleApplication. Closes #7551. (evsh)
|
||||
- OTHER: Update BOOST m4 macros and simplify AX_BOOST_BASE usage (Chocobo1)
|
||||
- OTHER: Drop OS/2 support. (sledgehammer999)
|
||||
- OTHER: Optimize file size of PNG and SVG files. (sledgehammer999)
|
||||
- OTHER: Add new translators in the About page.
|
||||
|
||||
* Thu Jun 01 2017 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.13
|
||||
- BUGFIX: Fixed UI glitch about torrent numbers in the sidepanel. Fixes #6454. (evsh)
|
||||
@@ -114,7 +317,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- FEATURE: Use Ctrl+F to search torrents. Closes #5797. (Tim Delaney)
|
||||
- FEATURE: Transferlist: add hotkeys for double click and recheck selected torrents (thalieht)
|
||||
- FEATURE: Add hotkey for execution log tab, Trackerlist, Peerlist etc (thalieht)
|
||||
- FEATURE: Seperate seeds from peers for DHT, PeX and LSD (thalieht)
|
||||
- FEATURE: Separate seeds from peers for DHT, PeX and LSD (thalieht)
|
||||
- BUGFIX: Do not remove added files unconditionally. Closes #6248 (Eugene Shalygin)
|
||||
- BUGFIX: Ignore mouse wheel events in Advanced Settings. Closes #866. (Chocobo1)
|
||||
- BUGFIX: Add queue repair code. It should fix missing torrents after restarting. (Eugene Shalygin, nxd4)
|
||||
@@ -126,7 +329,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- BUGFIX: TransferListWidget: keep columns width even if they are hidden on qBittorrent startup (unless something goes wrong) (thalieht)
|
||||
- BUGFIX: fix index overflow for torrents with invalid meta data or empty progress (Falco)
|
||||
- BUGFIX: Immediately update torrent_status after manipulating super seeding mode. Partially fixes #6072. (sledgehammer999)
|
||||
- BUGFIX: Use case-insensitive comparsion for torrent content window. Closes #6327. (Chocobo1)
|
||||
- BUGFIX: Use case-insensitive comparison for torrent content window. Closes #6327. (Chocobo1)
|
||||
- BUGFIX: Fixed sort order for datetime columns with empty values (closes #2988) (Vladimir Sinenko)
|
||||
- BUGFIX: Disable proxy in WebUI HTTP server. Closes #6349. (Eugene Shalygin)
|
||||
- COSMETIC: Use a disabled progressbar's palette for unselected files. (sledgehammer999)
|
||||
@@ -254,12 +457,12 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- FEATURE: Add option to automatically remove .torrent files upon adding (Eugene Shalygin)
|
||||
- FEATURE: Add option to bind directly to an IP instead of using a network Interface (Sjoerd van der Berg, sledgehammer999)
|
||||
- FEATURE: Detailed tooltips on the progress and availability bars in the General button of each torrent. (Eugene Shalygin)
|
||||
- FEATURE: Let user able to specifiy a filter when choosing an IP filter file (Chocobo1)
|
||||
- FEATURE: Let user able to specify a filter when choosing an IP filter file (Chocobo1)
|
||||
- FEATURE: Improve usability of "Run External Program". Users can write (platform dependent) shell scripts now. (Chocobo1)
|
||||
- PERFORMANCE: Optimize drawing in speed graph (Anton Lashkov, Chocobo1)
|
||||
- BUGFIX: Fix memory leak. (sledgehammer999)
|
||||
- BUGFIX: Fix resizing bug in "add torrent dialog". Closes #5036. (Chocobo1)
|
||||
- BUGFIX: Fix qBittorrent doesn't exit immediately when "all donwloads are done -> exit" option enabled. (glassez, Chocobo1)
|
||||
- BUGFIX: Fix qBittorrent doesn't exit immediately when "all downloads are done -> exit" option enabled. (glassez, Chocobo1)
|
||||
- BUGFIX: Display the filepath when a torrent fails to load. Closes #100 and #805. (sledgehammer999)
|
||||
- BUGFIX: Fix Add tracker dialog empty trackers (ngosang)
|
||||
- BUGFIX: Fix Add tracker dialog URL download (ngosang)
|
||||
@@ -312,7 +515,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- OTHER: Enable access to shutdown functions when configured with `--disable-gui` option (Chocobo1)
|
||||
- OTHER: Delete Import Torrent Dialog. Just use the "add new torrent" dialog. (glassez)
|
||||
- OTHER: Optimize code for natural sorting (Chocobo1)
|
||||
- OTHER: Use new alert dispathing API for libtorrent 1.1.x (glassez)
|
||||
- OTHER: Use new alert dispatching API for libtorrent 1.1.x (glassez)
|
||||
- OTHER: Fix gcc 6 compilation with qmake. See #5237. (sledgehammer999)
|
||||
|
||||
* Tue Mar 29 2016 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.3.4
|
||||
@@ -636,7 +839,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- SEARCH: Fix thepiratebay. Closes #3012 (ngosang)
|
||||
- SEARCH: Improve torrentz engine to return more results (ngosang)
|
||||
- SEARCH: Change width of columns in search tab. Closes #764 (ngosang)
|
||||
- SEARCH: Make strings translatable in seach engine (ngosang)
|
||||
- SEARCH: Make strings translatable in search engine (ngosang)
|
||||
- SEARCH: Aborting search engine process during closure. Close #2671 (DoumanAsh)
|
||||
- SEARCH: Perform searches in parallel (DoumanAsh)
|
||||
- SEARCH: Add Demonoid search engine (ngosang)
|
||||
@@ -803,7 +1006,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- WEBUI: Removed broken 'Documentation'. Improves fix for #1343 (Benjamin Hutchins)
|
||||
- WEBUI: Removed essentially useless 'Visit website' iframe and changed it to a regular link. Improves fix for #1343 (Benjamin Hutchins)
|
||||
- BUGFIX: Fix RSS feed icon. The tmp file gets deleted in the feed destructor. Closes #1639 (sledgehammer999)
|
||||
- BUGFIX: fix issue #1674: AddNewTorrentDialog is shown again and again even if checkbox "dont ask me again" is set (Ivan Sorokin)
|
||||
- BUGFIX: fix issue #1674: AddNewTorrentDialog is shown again and again even if checkbox "don't ask me again" is set (Ivan Sorokin)
|
||||
- BUGFIX: Don't show availability bar for magnet links (Ivan Sorokin)
|
||||
- BUGFIX: Fix crash when the selected torrent disappears from the transfer list. Closes #1661 (sledgehammer999)
|
||||
- BUGFIX: Fix tracker announcing problem(hit-and-run) when many torrents are being active. Closes #1571 (sledgehammer999)
|
||||
@@ -937,7 +1140,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- FEATURE: Show external IP in the log. Closes #968. (sledgehammer999)
|
||||
- FEATURE: Enable gzip compression in the webui. It should be faster now. (sledgehammer999)
|
||||
- FEATURE: Torrents show more states(queued for checking, downloading metadata, allocating, checking resume). (sledgehammer999)
|
||||
- FEATURE: Reenable "force reannounce" to all trackers. (sledgehammer999)
|
||||
- FEATURE: Re-enable "force reannounce" to all trackers. (sledgehammer999)
|
||||
- FEATURE: Allow to clear the UI lock password. Closes #973. (sledgehammer999)
|
||||
- FEATURE: New translations: English(Australia) and English(United Kingdom)
|
||||
- BUGFIX: Expose all available translation in the WebUI. Closes #976. (sledgehammer999)
|
||||
@@ -986,8 +1189,8 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- OTHER: Make peer tab sortable by ip too (Gelmir)
|
||||
- OTHER: Translations moved to Transifex(https://www.transifex.com/projects/p/qbittorrent/)
|
||||
- OTHER: New Translation - Vietnamese (Anh Phan)
|
||||
- PERFORMANCE: Impove drawing speed of tranferlist when there are many torrents(>100)
|
||||
- PERFORMANCE: Impove drawing speed of peers list when there are many peers
|
||||
- PERFORMANCE: Improve drawing speed of tranferlist when there are many torrents(>100)
|
||||
- PERFORMANCE: Improve drawing speed of peers list when there are many peers
|
||||
|
||||
* Mon Jul 29 2013 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.0.11
|
||||
- FEATURE: Allow more fine tuning of upload slots. It should improve speed (sledgehammer999)
|
||||
@@ -1027,8 +1230,8 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- LIBTORRENT: SOCKS5 fixes (0.16.10)
|
||||
- LIBTORRENT: Fix hanging issue on Windows when closing files (0.16.10)
|
||||
- LIBTORRENT: Cache can now be returned to the OS (0.16.10)
|
||||
- PERFORMANCE: Impove drawing speed of tranferlist when there are many torrents(>100) (sledgehammer999)
|
||||
- PERFORMANCE: Impove drawing speed of peers list when there are many peers (sledgehammer999)
|
||||
- PERFORMANCE: Improve drawing speed of tranferlist when there are many torrents(>100) (sledgehammer999)
|
||||
- PERFORMANCE: Improve drawing speed of peers list when there are many peers (sledgehammer999)
|
||||
|
||||
* Sat Mar 16 2013 - Christophe Dumez <chris@qbittorrent.org> - v3.0.9
|
||||
- BUGFIX: Raise qBittorrent windows when another instance is launched
|
||||
@@ -1052,7 +1255,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- BUGFIX: Fix "Couldn't set environment variable..." message on start up (closes #245)
|
||||
- BUGFIX: Use right path separator in torrent addition dialog on Windows
|
||||
- BUGFIX: Fix "Set as default save path" setting (closes #254)
|
||||
- BUGFIX: Reenable disk cache on Windows since the memory issue seems to be gone
|
||||
- BUGFIX: Re-enable disk cache on Windows since the memory issue seems to be gone
|
||||
- BUGFIX: Fixed several search engine plugins and removed the dead ones
|
||||
- BUGFIX: Use https links in search plugins when possible
|
||||
- BUGFIX: Bump Mootools to v1.4.5 (Web UI)
|
||||
@@ -1188,7 +1391,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- I18N: Add Georgian translation
|
||||
|
||||
* Sat Oct 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.2
|
||||
- BUGFIX: Fix mimimum dimensions for torrent addition dialog
|
||||
- BUGFIX: Fix minimum dimensions for torrent addition dialog
|
||||
- BUGFIX: Remove dependency on boost-datetime
|
||||
- BUGFIX: Remove dependency on boost-filesystem (libtorrent v0.16.x)
|
||||
|
||||
@@ -1399,7 +1602,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- BUGFIX: Update RSS feed as soon as feed downloader is enabled
|
||||
- BUGFIX: RSS Feed downloader ignores articles above maximum number of articles
|
||||
- BUGFIX: Fix possible bug when deleting a RSS folder
|
||||
- BUGFIX: Remove persistant data when a RSS feed is deleted
|
||||
- BUGFIX: Remove persistent data when a RSS feed is deleted
|
||||
- BUGFIX: RSS filters are now alphabetically sorted
|
||||
- BUGFIX: Fix crash when renaming currently displayed RSS filter
|
||||
- BUGFIX: Remove overwriting confirmation when exporting RSS filters since Qt takes care of it
|
||||
@@ -1435,7 +1638,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- BUGFIX: Use the save path set in program preferences as a default in torrent addition dialog
|
||||
|
||||
* Fri Dec 18 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.2
|
||||
- BUGFIX: Fix .qbittorrent folder not being created (critical bug introduced in v2.0.1 that makes qBittorrent unusuable for new users)
|
||||
- BUGFIX: Fix .qbittorrent folder not being created (critical bug introduced in v2.0.1 that makes qBittorrent unusable for new users)
|
||||
- BUGFIX: Fix RSS Feed downloader for some feeds
|
||||
- BUGFIX: Do not use home folder as a fallback when the save path is not accessible
|
||||
- BUGFIX: Fix Mininova, ThePirateBay search engine plugins
|
||||
@@ -1525,7 +1728,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- BUGFIX: Fix trackers addition to torrents (bug introduced in v1.5.4)
|
||||
- BUGFIX: Suppress compilation warning regarding sortNewsList() not being used
|
||||
- BUGFIX: Make sure scan folder is different than qBittorrent backup directory to avoid torrents deletion
|
||||
- BUGFIX: Added safety mecanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted.
|
||||
- BUGFIX: Added safety mechanism which adds the torrents back to the list in case qbittorrent-resume.conf gets deleted or corrupted.
|
||||
|
||||
* Sun Oct 25 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.5.4
|
||||
- BUGFIX: Updated man page
|
||||
@@ -1592,7 +1795,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- FEATURE: Added right click menu in search engine to clear completion history
|
||||
- FEATURE: Allow to set a different port for DHT (UDP) than the one used for Bittorrent
|
||||
- FEATURE: Updated spoofing code to avoid trackers ban
|
||||
- BUGFIX: Provide more helpful explanation when an I/O error occured
|
||||
- BUGFIX: Provide more helpful explanation when an I/O error occurred
|
||||
- BUGFIX: Stop enforcing UTF-8 and use system locale instead
|
||||
- COSMETIC: Redesigned program preferences
|
||||
- COSMETIC: Updated icons set
|
||||
@@ -1610,7 +1813,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- BUGFIX: Suppressed QLayout: Attempting to add QLayout "" to properties "properties" warning message when opening a properties dialog
|
||||
- BUGFIX: Fixed a little bug in search engine plugins helper file
|
||||
- BUGFIX: Fixed compilation problems with Qt 4.3
|
||||
- BUGFIX: Percentages no longer disapear with default cleanlooks style
|
||||
- BUGFIX: Percentages no longer disappear with default cleanlooks style
|
||||
- BUGFIX: Cleanly fixed popup menus position in lists (no more workarounds)
|
||||
- BUGFIX: Fixed memory leak in search engine
|
||||
- BUGFIX: Torrents with an infinite ratio are no longer affected by ratio_limit set in program preferences
|
||||
@@ -1855,7 +2058,7 @@ Unreleased - sledgehammer999 <sledgehammer999@qbittorrent.org> - v3.4.0
|
||||
- FEATURE: Number of complete/incomplete sources are now displayed in download list for each torrent
|
||||
- FEATURE: Implemented close to systray
|
||||
- FEATURE: Added Autocompletion to search engine
|
||||
- FEATURE: Splitted BT & GUI parts (huge code rewriting & optimization)
|
||||
- FEATURE: Split BT & GUI parts (huge code rewriting & optimization)
|
||||
- FEATURE: New parameters for configure file to point to custom locations for libtorrent/libcurl
|
||||
- FEATURE: Update application style according to the system (WindowsXP, MacOS, X11)
|
||||
- BUGFIX: Two torrents can now have the same name although they are different (use their hash)
|
||||
|
||||
@@ -35,7 +35,7 @@ You can also download it from [here](https://github.com/qbittorrent/qBittorrent/
|
||||
|
||||
### Misc:
|
||||
For more information please visit:
|
||||
http://www.qbittorrent.org
|
||||
https://www.qbittorrent.org
|
||||
|
||||
or our wiki here:
|
||||
http://wiki.qbittorrent.org
|
||||
|
||||
74
README.os2
@@ -1,74 +0,0 @@
|
||||
qBittorrent - A BitTorrent client in Qt4
|
||||
------------------------------------------
|
||||
|
||||
This is the eComStation (OS/2) qBittorrent part of the readme. See also README for more general information.
|
||||
|
||||
|
||||
Building qBittorrent
|
||||
********************
|
||||
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
||||
- gcc based build env (recommended gcc v4.4.2 or greater)
|
||||
|
||||
- Qt4 for eCS (OS/2) dev package (see http://svn.netlabs.org/qt4 for more information)
|
||||
|
||||
- libtorrent-rasterbar for eCS (OS/2) port (see http://svn.netlabs.org/ports for more information)
|
||||
|
||||
- boost for eCS (OS/2) port (see http://svn.netlabs.org/ports for more information)
|
||||
|
||||
|
||||
How to build
|
||||
============
|
||||
|
||||
First you need to create the conf.pri file in the same dir as this readme.os2 is.
|
||||
the conf.pri file has the following content:
|
||||
|
||||
##### conf.pri content begin #####
|
||||
BINDIR = ./bin
|
||||
INCDIR = ./include
|
||||
LIBDIR = ./lib
|
||||
DATADIR = ./share
|
||||
|
||||
CONFIG += staticlib
|
||||
INCLUDEPATH += x:/trees/libtorrent/trunk/include
|
||||
LIBS += -Lx:/trees/libtorrent/trunk/src/.libs \
|
||||
-Lx:/trees/boost/trunk/stage/lib \
|
||||
-Lx:/trees/openssl \
|
||||
-Lx:/extras/lib
|
||||
##### conf.pri content end #####
|
||||
|
||||
Of course all the above path references have to be adjusted to your build env.
|
||||
|
||||
Now you can either do a normal build or a shadow build. A shadow build has the
|
||||
advantage that no created files are in the same dir as the sources are.
|
||||
|
||||
For a normal build do the following:
|
||||
|
||||
Simply type:
|
||||
$ qmake
|
||||
|
||||
Followed by:
|
||||
$ make
|
||||
|
||||
For a shadow build do the following:
|
||||
given your sources are in x:\trees\qbittorrent\trunk create a
|
||||
x:\trees\qbittorrent\build directory
|
||||
|
||||
Now switch to the created directory and type:
|
||||
$ qmake ..\trunk
|
||||
|
||||
Followed by:
|
||||
$ make
|
||||
|
||||
If all works fine you should get a working qbittorrent executable.
|
||||
|
||||
If you have any question regarding the eCS (OS/2) port of qBittorrent you can meet me (_diver) on IRC:
|
||||
#netlabs on irc.freenode.net
|
||||
|
||||
------------------------------------------
|
||||
Silvan Scherrer <silvan.scherrer@aroa.ch>
|
||||
|
||||
|
||||
@@ -30,9 +30,9 @@ IF(QT4_FOUND)
|
||||
NAMES ${QTSINGLEAPPLICATION_NAMES}
|
||||
PATHS ${QT_LIBRARY_DIR}
|
||||
)
|
||||
ELSEIF(Qt5Widgets_FOUND)
|
||||
ELSEIF(Qt5Core_FOUND)
|
||||
message(STATUS "Looking for Qt5 single application library")
|
||||
FOREACH(TOP_INCLUDE_PATH in ${Qt5Widgets_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR})
|
||||
FOREACH(TOP_INCLUDE_PATH in ${Qt5Core_INCLUDE_DIRS} ${FRAMEWORK_INCLUDE_DIR})
|
||||
FIND_PATH(QTSINGLEAPPLICATION_INCLUDE_DIR QtSingleApplication ${TOP_INCLUDE_PATH}/QtSolutions)
|
||||
|
||||
IF(QTSINGLEAPPLICATION_INCLUDE_DIR)
|
||||
@@ -43,12 +43,12 @@ ELSEIF(Qt5Widgets_FOUND)
|
||||
SET(QTSINGLEAPPLICATION_NAMES ${QTSINGLEAPPLICATION_NAMES}
|
||||
Qt5Solutions_SingleApplication-2.6 libQt5Solutions_SingleApplication-2.6
|
||||
QtSolutions_SingleApplication-2.6 libQtSolutions_SingleApplication-2.6)
|
||||
GET_TARGET_PROPERTY(QT5_WIDGETSLIBRARY Qt5::Widgets LOCATION)
|
||||
GET_FILENAME_COMPONENT(QT5_WIDGETSLIBRARYPATH ${QT5_WIDGETSLIBRARY} PATH)
|
||||
GET_TARGET_PROPERTY(_QT5_CORELIBRARY Qt5::Core LOCATION)
|
||||
GET_FILENAME_COMPONENT(_QT5_CORELIBRARYPATH ${_QT5_CORELIBRARY} PATH)
|
||||
|
||||
FIND_LIBRARY(QTSINGLEAPPLICATION_LIBRARY
|
||||
NAMES ${QTSINGLEAPPLICATION_NAMES}
|
||||
PATHS ${QT5_WIDGETSLIBRARYPATH}
|
||||
PATHS ${_QT5_CORELIBRARYPATH}
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# - macro similar to target_link_libraries, which links Qt components
|
||||
# names of the components are pased in Qt4/Qt5 agnostic way (Core, DBus, Xml...)
|
||||
# names of the components are passed in Qt4/Qt5 agnostic way (Core, DBus, Xml...)
|
||||
# and the macro links Qt4 ones if QT4_FOUND is set or Qt5 ones if not
|
||||
|
||||
macro (target_link_qt_components target)
|
||||
|
||||
@@ -16,7 +16,7 @@ macro(qbt_set_compiler_options)
|
||||
"-Werror -Wno-error=deprecated-declarations"
|
||||
)
|
||||
set (_GCC_COMMON_CXX_FLAGS "-fexceptions -frtti"
|
||||
"-Woverloaded-virtual -Wold-style-cast -Wstrict-null-sentinel"
|
||||
"-Woverloaded-virtual -Wold-style-cast"
|
||||
"-Wnon-virtual-dtor -Wfloat-equal -Wcast-qual -Wcast-align"
|
||||
"-Werror=overloaded-virtual"
|
||||
# "-Weffc++"
|
||||
@@ -54,6 +54,20 @@ macro(qbt_set_compiler_options)
|
||||
endif(${GLIBC_VERSION})
|
||||
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# Clang 5.0 still doesn't support -Wstrict-null-sentinel
|
||||
check_cxx_compiler_flag(-Wstrict-null-sentinel _STRICT_NULL_SENTINEL_IS_SUPPORTED)
|
||||
if (_STRICT_NULL_SENTINEL_IS_SUPPORTED)
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wstrict-null-sentinel")
|
||||
endif (_STRICT_NULL_SENTINEL_IS_SUPPORTED)
|
||||
|
||||
# Code should be improved to render this not needed
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wno-error=unused-function -Wno-error=inconsistent-missing-override")
|
||||
else ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
# GCC supports it
|
||||
list(APPEND _GCC_COMMON_CXX_FLAGS "-Wstrict-null-sentinel")
|
||||
endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
|
||||
string(REPLACE ";" " " _GCC_COMMON_C_AND_CXX_FLAGS_STRING "${_GCC_COMMON_C_AND_CXX_FLAGS}")
|
||||
string(REPLACE ";" " " _GCC_COMMON_CXX_FLAGS_STRING "${_GCC_COMMON_CXX_FLAGS}")
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ add_definitions(-DUNICODE
|
||||
-D_WIN32_IE=0x0501
|
||||
-D_CRT_SECURE_NO_DEPRECATE
|
||||
-D_SCL_SECURE_NO_DEPRECATE
|
||||
-DNOMINMAX
|
||||
)
|
||||
# and boost
|
||||
set(Boost_USE_STATIC_LIBS True)
|
||||
|
||||
61
conf.pri.windows
Normal file
@@ -0,0 +1,61 @@
|
||||
# Adapt these paths
|
||||
# Point these to the include folders
|
||||
INCLUDEPATH += $$quote(C:/qBittorrent/boost)
|
||||
INCLUDEPATH += $$quote(C:/qBittorrent/libtorrent/include)
|
||||
INCLUDEPATH += $$quote(C:/qBittorrent/zlib/include)
|
||||
INCLUDEPATH += $$quote(C:/qBittorrent/openssl/include)
|
||||
# Point these to the lib folders
|
||||
LIBS += $$quote(-LC:/qBittorrent/boost/stage/lib)
|
||||
LIBS += $$quote(-LC:/qBittorrent/libtorrent/lib)
|
||||
LIBS += $$quote(-LC:/qBittorrent/zlib/lib)
|
||||
LIBS += $$quote(-LC:/qBittorrent/openssl/lib)
|
||||
|
||||
# Adapt the lib names/versions accordingly
|
||||
# If you want to use Boost auto-linking then disable
|
||||
# BOOST_ALL_NO_LIB below and omit Boost libraries here
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += libtorrentd.lib \
|
||||
libboost_system-vc140-mt-sgd-1_64.lib
|
||||
}
|
||||
else {
|
||||
LIBS += libtorrent.lib \
|
||||
libboost_system-vc140-mt-s-1_64.lib
|
||||
}
|
||||
LIBS += libeay32.lib ssleay32.lib
|
||||
LIBS += zlib.lib
|
||||
# ...or if you use MinGW
|
||||
#CONFIG(debug, debug|release) {
|
||||
# LIBS += libtorrent-rasterbar \
|
||||
# libboost_system-mt
|
||||
#}
|
||||
#else {
|
||||
# LIBS += libtorrent-rasterbar \
|
||||
# libboost_system-mt
|
||||
#}
|
||||
#LIBS += libcrypto libssl
|
||||
#LIBS += libz
|
||||
|
||||
DEFINES += NTDDI_VERSION=0x05010000
|
||||
DEFINES += _WIN32_WINNT=0x0501
|
||||
DEFINES += _WIN32_IE=0x0501
|
||||
|
||||
# Disable to use Boost auto-linking
|
||||
DEFINES += BOOST_ALL_NO_LIB
|
||||
# Use one of the following options
|
||||
DEFINES += BOOST_SYSTEM_STATIC_LINK
|
||||
#DEFINES += BOOST_SYSTEM_DYN_LINK
|
||||
# Boost 1.60+ defaults to Vista+ support. The define below enables XP support again.
|
||||
DEFINES += BOOST_USE_WINAPI_VERSION=0x0501
|
||||
# Enable if building against libtorrent 1.0.x (RC_1_0) (static linking)
|
||||
#DEFINES += BOOST_ASIO_SEPARATE_COMPILATION
|
||||
# Enable if building against libtorrent 1.0.x (RC_1_0) (dynamic linking)
|
||||
#DEFINES += BOOST_ASIO_DYN_LINK
|
||||
|
||||
# Enable if building against libtorrent 1.1.x (RC_1_1)
|
||||
# built with this flag defined
|
||||
#DEFINES += TORRENT_NO_DEPRECATE
|
||||
# Enable if linking dynamically against libtorrent
|
||||
#DEFINES += TORRENT_LINKING_SHARED
|
||||
|
||||
# Enable stack trace support
|
||||
CONFIG += strace_win
|
||||
479
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for qbittorrent v3.2.0alpha.
|
||||
# Generated by GNU Autoconf 2.69 for qbittorrent v4.1.0.
|
||||
#
|
||||
# Report bugs to <bugs.qbittorrent.org>.
|
||||
#
|
||||
@@ -580,10 +580,10 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='qbittorrent'
|
||||
PACKAGE_TARNAME='qbittorrent'
|
||||
PACKAGE_VERSION='v3.2.0alpha'
|
||||
PACKAGE_STRING='qbittorrent v3.2.0alpha'
|
||||
PACKAGE_VERSION='v4.1.0'
|
||||
PACKAGE_STRING='qbittorrent v4.1.0'
|
||||
PACKAGE_BUGREPORT='bugs.qbittorrent.org'
|
||||
PACKAGE_URL='http://www.qbittorrent.org/'
|
||||
PACKAGE_URL='https://www.qbittorrent.org/'
|
||||
|
||||
ac_subst_vars='am__EXEEXT_FALSE
|
||||
am__EXEEXT_TRUE
|
||||
@@ -606,6 +606,8 @@ libtorrent_CFLAGS
|
||||
BOOST_SYSTEM_LIB
|
||||
BOOST_LDFLAGS
|
||||
BOOST_CPPFLAGS
|
||||
Qt5Svg_LIBS
|
||||
Qt5Svg_CFLAGS
|
||||
QT_QMAKE
|
||||
PKG_CONFIG_LIBDIR
|
||||
PKG_CONFIG_PATH
|
||||
@@ -688,6 +690,7 @@ infodir
|
||||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
@@ -714,6 +717,7 @@ enable_dependency_tracking
|
||||
enable_silent_rules
|
||||
with_qtsingleapplication
|
||||
enable_debug
|
||||
enable_stacktrace
|
||||
enable_gui
|
||||
enable_systemd
|
||||
enable_webui
|
||||
@@ -737,6 +741,8 @@ PKG_CONFIG
|
||||
PKG_CONFIG_PATH
|
||||
PKG_CONFIG_LIBDIR
|
||||
QT_QMAKE
|
||||
Qt5Svg_CFLAGS
|
||||
Qt5Svg_LIBS
|
||||
libtorrent_CFLAGS
|
||||
libtorrent_LIBS
|
||||
zlib_CFLAGS
|
||||
@@ -779,6 +785,7 @@ datadir='${datarootdir}'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
@@ -1031,6 +1038,15 @@ do
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||
| --run | --ru | --r)
|
||||
ac_prev=runstatedir ;;
|
||||
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
| --run=* | --ru=* | --r=*)
|
||||
runstatedir=$ac_optarg ;;
|
||||
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
@@ -1168,7 +1184,7 @@ fi
|
||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
libdir localedir mandir
|
||||
libdir localedir mandir runstatedir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
@@ -1281,7 +1297,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures qbittorrent v3.2.0alpha to adapt to many kinds of systems.
|
||||
\`configure' configures qbittorrent v4.1.0 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1321,6 +1337,7 @@ Fine tuning of the installation directories:
|
||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
@@ -1351,7 +1368,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of qbittorrent v3.2.0alpha:";;
|
||||
short | recursive ) echo "Configuration of qbittorrent v4.1.0:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1366,6 +1383,7 @@ Optional Features:
|
||||
--enable-silent-rules less verbose build output (undo: "make V=1")
|
||||
--disable-silent-rules verbose build output (undo: "make V=0")
|
||||
--enable-debug Enable debug build
|
||||
--enable-stacktrace Enable stacktrace feature (default=auto)
|
||||
--disable-gui Disable the GUI for headless running. Disables
|
||||
QtDBus and the GeoIP Database.
|
||||
--enable-systemd Install the systemd service file (headless only).
|
||||
@@ -1408,6 +1426,9 @@ Some influential environment variables:
|
||||
PKG_CONFIG_LIBDIR
|
||||
path overriding pkg-config's built-in search path
|
||||
QT_QMAKE value of host_bins for Qt5Core >= 5.5.1, overriding pkg-config
|
||||
Qt5Svg_CFLAGS
|
||||
C compiler flags for Qt5Svg, overriding pkg-config
|
||||
Qt5Svg_LIBS linker flags for Qt5Svg, overriding pkg-config
|
||||
libtorrent_CFLAGS
|
||||
C compiler flags for libtorrent, overriding pkg-config
|
||||
libtorrent_LIBS
|
||||
@@ -1419,7 +1440,7 @@ Use these variables to override the choices made by `configure' or to help
|
||||
it to find libraries and programs with nonstandard names/locations.
|
||||
|
||||
Report bugs to <bugs.qbittorrent.org>.
|
||||
qbittorrent home page: <http://www.qbittorrent.org/>.
|
||||
qbittorrent home page: <https://www.qbittorrent.org/>.
|
||||
_ACEOF
|
||||
ac_status=$?
|
||||
fi
|
||||
@@ -1482,7 +1503,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
qbittorrent configure v3.2.0alpha
|
||||
qbittorrent configure v4.1.0
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -1621,7 +1642,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by qbittorrent $as_me v3.2.0alpha, which was
|
||||
It was created by qbittorrent $as_me v4.1.0, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -3799,7 +3820,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='qbittorrent'
|
||||
VERSION='v3.2.0alpha'
|
||||
VERSION='v4.1.0'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -4170,6 +4191,14 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-stacktrace was given.
|
||||
if test "${enable_stacktrace+set}" = set; then :
|
||||
enableval=$enable_stacktrace;
|
||||
else
|
||||
enable_stacktrace=auto
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-gui was given.
|
||||
if test "${enable_gui+set}" = set; then :
|
||||
enableval=$enable_gui;
|
||||
@@ -4370,6 +4399,39 @@ $as_echo "$enable_debug" >&6; }
|
||||
as_fn_error $? "Unknown option \"$enable_debug\". Use either \"yes\" or \"no\"." "$LINENO" 5 ;;
|
||||
esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the stacktrace feature" >&5
|
||||
$as_echo_n "checking whether to enable the stacktrace feature... " >&6; }
|
||||
|
||||
case "x$enable_stacktrace" in #(
|
||||
"xno") :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG stacktrace" ;; #(
|
||||
"xyes") :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
QBT_ADD_CONFIG="$QBT_ADD_CONFIG stacktrace" ;; #(
|
||||
"xauto") :
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <execinfo.h>
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
QBT_ADD_CONFIG="$QBT_ADD_CONFIG stacktrace"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG stacktrace"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; #(
|
||||
*) :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_stacktrace" >&5
|
||||
$as_echo "$enable_stacktrace" >&6; }
|
||||
as_fn_error $? "Unknown option \"$enable_stacktrace\". Use either \"yes\" or \"no\"." "$LINENO" 5 ;;
|
||||
esac
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the GUI" >&5
|
||||
$as_echo_n "checking whether to enable the GUI... " >&6; }
|
||||
case "x$enable_gui" in #(
|
||||
@@ -4477,6 +4539,104 @@ $as_echo "not found" >&6; }
|
||||
|
||||
fi
|
||||
|
||||
if test "x$QT_QMAKE" = "x"; then :
|
||||
as_fn_error $? "Could not find qmake" "$LINENO" 5
|
||||
|
||||
fi
|
||||
if test "x$enable_gui" = "xyes"; then :
|
||||
|
||||
pkg_failed=no
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt5Svg" >&5
|
||||
$as_echo_n "checking for Qt5Svg... " >&6; }
|
||||
|
||||
if test -n "$Qt5Svg_CFLAGS"; then
|
||||
pkg_cv_Qt5Svg_CFLAGS="$Qt5Svg_CFLAGS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Svg >= 5.5.1\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "Qt5Svg >= 5.5.1") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_Qt5Svg_CFLAGS=`$PKG_CONFIG --cflags "Qt5Svg >= 5.5.1" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
if test -n "$Qt5Svg_LIBS"; then
|
||||
pkg_cv_Qt5Svg_LIBS="$Qt5Svg_LIBS"
|
||||
elif test -n "$PKG_CONFIG"; then
|
||||
if test -n "$PKG_CONFIG" && \
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Svg >= 5.5.1\""; } >&5
|
||||
($PKG_CONFIG --exists --print-errors "Qt5Svg >= 5.5.1") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; then
|
||||
pkg_cv_Qt5Svg_LIBS=`$PKG_CONFIG --libs "Qt5Svg >= 5.5.1" 2>/dev/null`
|
||||
test "x$?" != "x0" && pkg_failed=yes
|
||||
else
|
||||
pkg_failed=yes
|
||||
fi
|
||||
else
|
||||
pkg_failed=untried
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test $pkg_failed = yes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
_pkg_short_errors_supported=yes
|
||||
else
|
||||
_pkg_short_errors_supported=no
|
||||
fi
|
||||
if test $_pkg_short_errors_supported = yes; then
|
||||
Qt5Svg_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "Qt5Svg >= 5.5.1" 2>&1`
|
||||
else
|
||||
Qt5Svg_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "Qt5Svg >= 5.5.1" 2>&1`
|
||||
fi
|
||||
# Put the nasty error message in config.log where it belongs
|
||||
echo "$Qt5Svg_PKG_ERRORS" >&5
|
||||
|
||||
as_fn_error $? "Package requirements (Qt5Svg >= 5.5.1) were not met:
|
||||
|
||||
$Qt5Svg_PKG_ERRORS
|
||||
|
||||
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
installed software in a non-standard prefix.
|
||||
|
||||
Alternatively, you may set the environment variables Qt5Svg_CFLAGS
|
||||
and Qt5Svg_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details." "$LINENO" 5
|
||||
elif test $pkg_failed = untried; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
|
||||
is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
path to pkg-config.
|
||||
|
||||
Alternatively, you may set the environment variables Qt5Svg_CFLAGS
|
||||
and Qt5Svg_LIBS to avoid the need to call pkg-config.
|
||||
See the pkg-config man page for more details.
|
||||
|
||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
Qt5Svg_CFLAGS=$pkg_cv_Qt5Svg_CFLAGS
|
||||
Qt5Svg_LIBS=$pkg_cv_Qt5Svg_LIBS
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether QtDBus should be enabled" >&5
|
||||
$as_echo_n "checking whether QtDBus should be enabled... " >&6; }
|
||||
case "x$enable_qt_dbus" in #(
|
||||
@@ -4519,19 +4679,17 @@ esac
|
||||
|
||||
|
||||
|
||||
|
||||
# Check whether --with-boost was given.
|
||||
if test "${with_boost+set}" = set; then :
|
||||
withval=$with_boost;
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ac_boost_path=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ac_boost_path="$withval"
|
||||
fi
|
||||
case $withval in #(
|
||||
no) :
|
||||
want_boost="no";_AX_BOOST_BASE_boost_path="" ;; #(
|
||||
yes) :
|
||||
want_boost="yes";_AX_BOOST_BASE_boost_path="" ;; #(
|
||||
*) :
|
||||
want_boost="yes";_AX_BOOST_BASE_boost_path="$withval" ;;
|
||||
esac
|
||||
|
||||
else
|
||||
want_boost="yes"
|
||||
@@ -4543,78 +4701,121 @@ fi
|
||||
# Check whether --with-boost-libdir was given.
|
||||
if test "${with_boost_libdir+set}" = set; then :
|
||||
withval=$with_boost_libdir;
|
||||
if test -d "$withval"
|
||||
then
|
||||
ac_boost_lib_path="$withval"
|
||||
else
|
||||
as_fn_error $? "--with-boost-libdir expected directory name" "$LINENO" 5
|
||||
fi
|
||||
if test -d "$withval"; then :
|
||||
_AX_BOOST_BASE_boost_lib_path="$withval"
|
||||
else
|
||||
as_fn_error $? "--with-boost-libdir expected directory name" "$LINENO" 5
|
||||
fi
|
||||
|
||||
else
|
||||
ac_boost_lib_path=""
|
||||
|
||||
_AX_BOOST_BASE_boost_lib_path=""
|
||||
fi
|
||||
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
boost_lib_version_req=1.35
|
||||
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([0-9]*\.[0-9]*\)'`
|
||||
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([0-9]*\)'`
|
||||
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[0-9]*\.\([0-9]*\)'`
|
||||
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
|
||||
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
|
||||
boost_lib_version_req_sub_minor="0"
|
||||
fi
|
||||
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= $boost_lib_version_req" >&5
|
||||
$as_echo_n "checking for boostlib >= $boost_lib_version_req... " >&6; }
|
||||
BOOST_LDFLAGS=""
|
||||
BOOST_CPPFLAGS=""
|
||||
if test "x$want_boost" = "xyes"; then :
|
||||
|
||||
|
||||
if test "x1.35" = "x"; then :
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"
|
||||
else
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req="1.35"
|
||||
fi
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\.[0-9]*\)'`
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([0-9]*\)'`
|
||||
if test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"; then :
|
||||
as_fn_error $? "You should at least specify libboost major version" "$LINENO" 5
|
||||
fi
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[0-9]*\.\([0-9]*\)'`
|
||||
if test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"; then :
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"
|
||||
fi
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
|
||||
if test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"; then :
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"
|
||||
fi
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor`
|
||||
WANT_BOOST_VERSION=$_AX_BOOST_BASE_TONUMERICVERSION_RET
|
||||
|
||||
succeeded=no
|
||||
|
||||
libsubdirs="lib"
|
||||
ax_arch=`uname -m`
|
||||
case $ax_arch in
|
||||
x86_64)
|
||||
libsubdirs="lib64 libx32 lib lib64"
|
||||
;;
|
||||
ppc64|s390x|sparc64|aarch64|ppc64le)
|
||||
libsubdirs="lib64 lib lib64 ppc64le"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
|
||||
case ${host_cpu} in #(
|
||||
x86_64) :
|
||||
libsubdirs="lib64 libx32 lib lib64" ;; #(
|
||||
ppc64|s390x|sparc64|aarch64|ppc64le) :
|
||||
libsubdirs="lib64 lib lib64" ;; #(
|
||||
*) :
|
||||
libsubdirs="lib"
|
||||
;;
|
||||
esac
|
||||
|
||||
case ${host_cpu} in
|
||||
i?86)
|
||||
libsubdirs="lib/i386-${host_os} $libsubdirs"
|
||||
;;
|
||||
esac
|
||||
case ${host_cpu} in #(
|
||||
i?86) :
|
||||
multiarch_libsubdir="lib/i386-${host_os}" ;; #(
|
||||
*) :
|
||||
multiarch_libsubdir="lib/${host_cpu}-${host_os}"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$ac_boost_path" != ""; then
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path/include"
|
||||
for ac_boost_path_tmp in $libsubdirs; do
|
||||
if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
|
||||
BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
|
||||
break
|
||||
fi
|
||||
done
|
||||
elif test "$cross_compiling" != yes; then
|
||||
for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
if test "x$_AX_BOOST_BASE_boost_path" != "x"; then :
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"" >&5
|
||||
$as_echo_n "checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) includes in \"$_AX_BOOST_BASE_boost_path/include\"... " >&6; }
|
||||
if test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"; then :
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
|
||||
for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"" >&5
|
||||
$as_echo_n "checking for boostlib >= 1.35 ($WANT_BOOST_VERSION) lib path in \"$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp\"... " >&6; }
|
||||
if test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ; then :
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
|
||||
break;
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
done
|
||||
else
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
if test X"$cross_compiling" = Xyes; then
|
||||
search_libsubdirs=$multiarch_libsubdir
|
||||
else
|
||||
search_libsubdirs="$multiarch_libsubdir $libsubdirs"
|
||||
fi
|
||||
for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then
|
||||
for libsubdir in $search_libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$ac_boost_lib_path" != ""; then
|
||||
BOOST_LDFLAGS="-L$ac_boost_lib_path"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$_AX_BOOST_BASE_boost_lib_path" != "x"; then :
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= 1.35 ($WANT_BOOST_VERSION)" >&5
|
||||
$as_echo_n "checking for boostlib >= 1.35 ($WANT_BOOST_VERSION)... " >&6; }
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
@@ -4633,17 +4834,13 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/version.hpp>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
#if BOOST_VERSION >= $WANT_BOOST_VERSION
|
||||
// Everything is okay
|
||||
#else
|
||||
# error Boost version is too old
|
||||
#endif
|
||||
(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($WANT_BOOST_VERSION))]));
|
||||
|
||||
;
|
||||
return 0;
|
||||
@@ -4667,39 +4864,47 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
|
||||
|
||||
if test "x$succeeded" != "xyes"; then
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
BOOST_CPPFLAGS=
|
||||
BOOST_LDFLAGS=
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
BOOST_LDFLAGS=
|
||||
fi
|
||||
_version=0
|
||||
if test "$ac_boost_path" != ""; then
|
||||
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
||||
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
if test -n "$_AX_BOOST_BASE_boost_path" ; then
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "$V_CHECK" = "1" ; then
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
fi
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
done
|
||||
if test -z "$BOOST_CPPFLAGS"; then
|
||||
if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path"
|
||||
if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
|
||||
fi
|
||||
fi
|
||||
if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test "$cross_compiling" != yes; then
|
||||
for ac_boost_path in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
||||
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
if test "x$cross_compiling" != "xyes" ; then
|
||||
for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "$V_CHECK" = "1" ; then
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
best_path=$ac_boost_path
|
||||
best_path=$_AX_BOOST_BASE_boost_path
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -4707,7 +4912,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
|
||||
if test "$ac_boost_lib_path" = ""; then
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
@@ -4715,7 +4920,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$BOOST_ROOT" != "x"; then
|
||||
if test -n "$BOOST_ROOT" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
@@ -4724,7 +4929,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
|
||||
stage_version_shorten=`expr $stage_version : '\([0-9]*\.[0-9]*\)'`
|
||||
V_CHECK=`expr $stage_version_shorten \>\= $_version`
|
||||
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
|
||||
if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: We will use a staged boost library from $BOOST_ROOT" >&5
|
||||
$as_echo "$as_me: We will use a staged boost library from $BOOST_ROOT" >&6;}
|
||||
BOOST_CPPFLAGS="-I$BOOST_ROOT"
|
||||
@@ -4748,17 +4953,13 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/version.hpp>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
#if BOOST_VERSION >= $WANT_BOOST_VERSION
|
||||
// Everything is okay
|
||||
#else
|
||||
# error Boost version is too old
|
||||
#endif
|
||||
(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($WANT_BOOST_VERSION))]));
|
||||
|
||||
;
|
||||
return 0;
|
||||
@@ -4781,41 +4982,37 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
fi
|
||||
|
||||
if test "$succeeded" != "yes" ; then
|
||||
if test "$_version" = "0" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&5
|
||||
$as_echo "$as_me: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&6;}
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
if test "x$_version" = "x0" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version 1.35 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&5
|
||||
$as_echo "$as_me: We could not detect the boost libraries (version 1.35 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&6;}
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5
|
||||
$as_echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;}
|
||||
fi
|
||||
# execute ACTION-IF-NOT-FOUND (if present):
|
||||
:
|
||||
as_fn_error $? "Could not find Boost" "$LINENO" 5
|
||||
else
|
||||
|
||||
|
||||
|
||||
$as_echo "#define HAVE_BOOST /**/" >>confdefs.h
|
||||
|
||||
# execute ACTION-IF-FOUND (if present):
|
||||
:
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Boost CPPFLAGS: \"$BOOST_CPPFLAGS\"
|
||||
Boost LDFLAGS: \"$BOOST_LDFLAGS\"" >&5
|
||||
$as_echo "$as_me: Boost CPPFLAGS: \"$BOOST_CPPFLAGS\"
|
||||
Boost LDFLAGS: \"$BOOST_LDFLAGS\"" >&6;}
|
||||
fi
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# HAVE_BOOST is set to an empty value when Boost is found. I don't know
|
||||
# how to test for a set vs unset variable.
|
||||
if test "x$BOOST_CPPFLAGS" = "x"; then :
|
||||
as_fn_error $? "Could not find Boost" "$LINENO" 5
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Boost CPPFLAGS: $BOOST_CPPFLAGS" >&5
|
||||
$as_echo "$as_me: Boost CPPFLAGS: $BOOST_CPPFLAGS" >&6;}
|
||||
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
|
||||
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
|
||||
fi
|
||||
|
||||
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
|
||||
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
|
||||
|
||||
|
||||
|
||||
@@ -5059,15 +5256,9 @@ fi
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
|
||||
# HAVE_BOOST_SYSTEM is set to an empty value when Boost.System is found.
|
||||
# I don't know how to test for a set vs unset variable.
|
||||
if test "x$BOOST_SYSTEM_LIB" = "x"; then :
|
||||
as_fn_error $? "Could not find Boost.System" "$LINENO" 5
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Boost.System LIB: $BOOST_SYSTEM_LIB" >&5
|
||||
$as_echo "$as_me: Boost.System LIB: $BOOST_SYSTEM_LIB" >&6;}
|
||||
LIBS="$BOOST_SYSTEM_LIB $LIBS"
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Boost.System LIB: \"$BOOST_SYSTEM_LIB\"" >&5
|
||||
$as_echo "$as_me: Boost.System LIB: \"$BOOST_SYSTEM_LIB\"" >&6;}
|
||||
LIBS="$BOOST_SYSTEM_LIB $LIBS"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which qtsingleapplication to use" >&5
|
||||
$as_echo_n "checking which qtsingleapplication to use... " >&6; }
|
||||
@@ -5352,7 +5543,7 @@ extract() {
|
||||
new_line='
|
||||
'
|
||||
# Convert " -" to "\n" if not between quotes and remove possible leading white spaces
|
||||
string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[:space:]*//')
|
||||
string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[:space:]]*//')
|
||||
SAVEIFS=$IFS
|
||||
IFS=$(printf "\n\b")
|
||||
for i in $string; do
|
||||
@@ -5366,9 +5557,8 @@ extract() {
|
||||
IFS=$SAVEIFS
|
||||
}
|
||||
|
||||
extract $CPPFLAGS
|
||||
extract "$CFLAGS $CPPFLAGS $CXXFLAGS"
|
||||
QBT_ADD_DEFINES="$QBT_ADD_DEFINES $QBT_CONF_DEFINES"
|
||||
QBT_CONF_EXTRA_CFLAGS="$QBT_CONF_EXTRA_CFLAGS $CXXFLAGS"
|
||||
|
||||
# Substitute the values of these vars in conf.pri.in
|
||||
|
||||
@@ -5950,7 +6140,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by qbittorrent $as_me v3.2.0alpha, which was
|
||||
This file was extended by qbittorrent $as_me v4.1.0, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -6002,13 +6192,13 @@ Configuration commands:
|
||||
$config_commands
|
||||
|
||||
Report bugs to <bugs.qbittorrent.org>.
|
||||
qbittorrent home page: <http://www.qbittorrent.org/>."
|
||||
qbittorrent home page: <https://www.qbittorrent.org/>."
|
||||
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
qbittorrent config.status v3.2.0alpha
|
||||
qbittorrent config.status v4.1.0
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
@@ -7265,7 +7455,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by qbittorrent $as_me v3.2.0alpha, which was
|
||||
This file was extended by qbittorrent $as_me v4.1.0, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -7317,13 +7507,13 @@ Configuration commands:
|
||||
$config_commands
|
||||
|
||||
Report bugs to <bugs.qbittorrent.org>.
|
||||
qbittorrent home page: <http://www.qbittorrent.org/>."
|
||||
qbittorrent home page: <https://www.qbittorrent.org/>."
|
||||
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
qbittorrent config.status v3.2.0alpha
|
||||
qbittorrent config.status v4.1.0
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
@@ -8024,4 +8214,3 @@ else
|
||||
as_fn_error $? "Failed running $QT_QMAKE to generate the makefile" "$LINENO" 5
|
||||
fi
|
||||
$as_echo
|
||||
|
||||
|
||||
59
configure.ac
@@ -1,4 +1,4 @@
|
||||
AC_INIT([qbittorrent], [v3.2.0alpha], [bugs.qbittorrent.org], [], [http://www.qbittorrent.org/])
|
||||
AC_INIT([qbittorrent], [v4.1.0], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_PROG_CC
|
||||
@@ -24,6 +24,12 @@ AC_ARG_ENABLE(debug,
|
||||
[],
|
||||
[enable_debug=no])
|
||||
|
||||
AC_ARG_ENABLE(stacktrace,
|
||||
[AS_HELP_STRING([--enable-stacktrace],
|
||||
[Enable stacktrace feature (default=auto)])],
|
||||
[],
|
||||
[enable_stacktrace=auto])
|
||||
|
||||
AC_ARG_ENABLE(gui,
|
||||
[AS_HELP_STRING([--disable-gui],
|
||||
[Disable the GUI for headless running. Disables QtDBus and the GeoIP Database.])],
|
||||
@@ -80,6 +86,23 @@ AS_CASE(["x$enable_debug"],
|
||||
[AC_MSG_RESULT([$enable_debug])
|
||||
AC_MSG_ERROR([Unknown option "$enable_debug". Use either "yes" or "no".])])
|
||||
|
||||
AC_MSG_CHECKING([whether to enable the stacktrace feature])
|
||||
AS_CASE(["x$enable_stacktrace"],
|
||||
["xno"],
|
||||
[AC_MSG_RESULT([no])
|
||||
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG stacktrace"],
|
||||
["xyes"],
|
||||
[AC_MSG_RESULT([yes])
|
||||
QBT_ADD_CONFIG="$QBT_ADD_CONFIG stacktrace"],
|
||||
["xauto"],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <execinfo.h>]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
QBT_ADD_CONFIG="$QBT_ADD_CONFIG stacktrace"],
|
||||
[AC_MSG_RESULT([no])
|
||||
QBT_REMOVE_CONFIG="$QBT_REMOVE_CONFIG stacktrace"])],
|
||||
[AC_MSG_RESULT([$enable_stacktrace])
|
||||
AC_MSG_ERROR([Unknown option "$enable_stacktrace". Use either "yes" or "no".])])
|
||||
|
||||
AC_MSG_CHECKING([whether to enable the GUI])
|
||||
AS_CASE(["x$enable_gui"],
|
||||
["xyes"],
|
||||
@@ -116,6 +139,12 @@ AS_CASE(["x$enable_webui"],
|
||||
AC_MSG_ERROR([Unknown option "$enable_webui". Use either "yes" or "no".])])
|
||||
|
||||
FIND_QT5()
|
||||
AS_IF([test "x$QT_QMAKE" = "x"],
|
||||
[AC_MSG_ERROR([Could not find qmake])
|
||||
])
|
||||
AS_IF([test "x$enable_gui" = "xyes"],
|
||||
[PKG_CHECK_MODULES(Qt5Svg, [Qt5Svg >= 5.5.1])
|
||||
])
|
||||
AC_MSG_CHECKING([whether QtDBus should be enabled])
|
||||
AS_CASE(["x$enable_qt_dbus"],
|
||||
["xyes"],
|
||||
@@ -132,22 +161,16 @@ AS_CASE(["x$enable_qt_dbus"],
|
||||
AC_MSG_ERROR([Unknown option "$enable_qt_dbus". Use either "yes" or "no".])])
|
||||
|
||||
|
||||
AX_BOOST_BASE([1.35])
|
||||
# HAVE_BOOST is set to an empty value when Boost is found. I don't know
|
||||
# how to test for a set vs unset variable.
|
||||
AS_IF([test "x$BOOST_CPPFLAGS" = "x"],
|
||||
[AC_MSG_ERROR([Could not find Boost])],
|
||||
[AC_MSG_NOTICE([Boost CPPFLAGS: $BOOST_CPPFLAGS])
|
||||
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
|
||||
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"])
|
||||
AX_BOOST_BASE([1.35],
|
||||
[AC_MSG_NOTICE([Boost CPPFLAGS: "$BOOST_CPPFLAGS"
|
||||
Boost LDFLAGS: "$BOOST_LDFLAGS"])],
|
||||
[AC_MSG_ERROR([Could not find Boost])])
|
||||
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
|
||||
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
|
||||
|
||||
AX_BOOST_SYSTEM()
|
||||
# HAVE_BOOST_SYSTEM is set to an empty value when Boost.System is found.
|
||||
# I don't know how to test for a set vs unset variable.
|
||||
AS_IF([test "x$BOOST_SYSTEM_LIB" = "x"],
|
||||
[AC_MSG_ERROR([Could not find Boost.System])],
|
||||
[AC_MSG_NOTICE([Boost.System LIB: $BOOST_SYSTEM_LIB])
|
||||
LIBS="$BOOST_SYSTEM_LIB $LIBS"])
|
||||
AC_MSG_NOTICE([Boost.System LIB: "$BOOST_SYSTEM_LIB"])
|
||||
LIBS="$BOOST_SYSTEM_LIB $LIBS"
|
||||
|
||||
AC_MSG_CHECKING([which qtsingleapplication to use])
|
||||
AS_CASE(["x$with_qtsingleapplication"],
|
||||
@@ -190,7 +213,7 @@ extract() {
|
||||
new_line='
|
||||
'
|
||||
# Convert " -" to "\n" if not between quotes and remove possible leading white spaces
|
||||
string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[:space:]]*//')
|
||||
string=$(echo " $*" | $SED -e "s: -:\\${new_line}:g" -e 's:"\(.*\)\n\(.*\)":\"\1 -\2":g' -e "s:'\(.*\)\n\(.*\)':\'\1 -\2':g" -e 's/^[[[:space:]]]*//')
|
||||
SAVEIFS=$IFS
|
||||
IFS=$(printf "\n\b")
|
||||
for i in $string; do
|
||||
@@ -204,9 +227,8 @@ extract() {
|
||||
IFS=$SAVEIFS
|
||||
}
|
||||
|
||||
extract $CPPFLAGS
|
||||
extract "$CFLAGS $CPPFLAGS $CXXFLAGS"
|
||||
QBT_ADD_DEFINES="$QBT_ADD_DEFINES $QBT_CONF_DEFINES"
|
||||
QBT_CONF_EXTRA_CFLAGS="$QBT_CONF_EXTRA_CFLAGS $CXXFLAGS"
|
||||
|
||||
# Substitute the values of these vars in conf.pri.in
|
||||
AC_SUBST(QBT_CONF_INCLUDES)
|
||||
@@ -234,4 +256,3 @@ AS_IF([test "x$ret" = "x0"],
|
||||
[AC_MSG_NOTICE([Good, your configure finished.])],
|
||||
[AC_MSG_ERROR([Failed running $QT_QMAKE to generate the makefile])])
|
||||
AS_ECHO()
|
||||
|
||||
|
||||
4
dist/mac/Info.plist
vendored
@@ -45,7 +45,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>3.4.0</string>
|
||||
<string>4.1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>qBit</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
@@ -59,7 +59,7 @@
|
||||
<key>NSAppleScriptEnabled</key>
|
||||
<string>YES</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2006-2017 The qBittorrent project</string>
|
||||
<string>Copyright © 2006-2018 The qBittorrent project</string>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
||||
BIN
dist/mac/qBitTorrentDocument.icns
vendored
BIN
dist/mac/qbittorrent_mac.icns
vendored
5
dist/unix/CMakeLists.txt
vendored
@@ -25,10 +25,6 @@ if (GUI)
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor
|
||||
FILES_MATCHING PATTERN "*.png")
|
||||
|
||||
install(FILES ${qBittorrent_SOURCE_DIR}/src/icons/qbittorrent.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps/
|
||||
COMPONENT data)
|
||||
|
||||
install(FILES ${qBittorrent_SOURCE_DIR}/src/icons/qbittorrent.desktop
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/
|
||||
COMPONENT data)
|
||||
@@ -38,6 +34,7 @@ if (GUI)
|
||||
COMPONENT data)
|
||||
|
||||
install(FILES
|
||||
${qBittorrent_SOURCE_DIR}/src/icons/skin/qbittorrent-tray.svg
|
||||
${qBittorrent_SOURCE_DIR}/src/icons/skin/qbittorrent-tray-dark.svg
|
||||
${qBittorrent_SOURCE_DIR}/src/icons/skin/qbittorrent-tray-light.svg
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status
|
||||
|
||||
BIN
dist/unix/menuicons/128x128/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 7.6 KiB |
BIN
dist/unix/menuicons/16x16/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 893 B After Width: | Height: | Size: 986 B |
|
Before Width: | Height: | Size: 893 B After Width: | Height: | Size: 986 B |
BIN
dist/unix/menuicons/192x192/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 11 KiB |
BIN
dist/unix/menuicons/22x22/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
dist/unix/menuicons/24x24/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
dist/unix/menuicons/32x32/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
dist/unix/menuicons/36x36/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
dist/unix/menuicons/48x48/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 2.9 KiB |
BIN
dist/unix/menuicons/64x64/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
dist/unix/menuicons/72x72/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 4.2 KiB |
BIN
dist/unix/menuicons/96x96/apps/qbittorrent.png
vendored
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 5.6 KiB |
4
dist/unix/qbittorrent.appdata.xml
vendored
@@ -11,7 +11,7 @@
|
||||
Aiming to be a good alternative to all other bittorrent clients out
|
||||
there, qBittorrent is fast, stable and provides unicode support as well
|
||||
as many other features. Additionally, qBittorrent runs and provides those
|
||||
same features on all major platforms (Linux, Mac OS X, Windows, OS/2, FreeBSD).
|
||||
same features on all major platforms (Linux, Mac OS X, Windows, FreeBSD).
|
||||
</p>
|
||||
<p>
|
||||
It is programmed in C++ / Qt and uses libtorrent (sometimes called
|
||||
@@ -56,7 +56,7 @@
|
||||
</image>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<url type="homepage">http://www.qbittorrent.org/</url>
|
||||
<url type="homepage">https://www.qbittorrent.org/</url>
|
||||
<update_contact>sledgehammer999@qbittorrent.org</update_contact>
|
||||
<developer_name>The qBittorrent Project</developer_name>
|
||||
<url type="bugtracker">http://bugs.qbittorrent.org/</url>
|
||||
|
||||
2
dist/windows/installer.nsi
vendored
@@ -86,7 +86,7 @@ Section $(inst_qbt_req) ;"qBittorrent (required)"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "UninstallString" '"$INSTDIR\uninst.exe"'
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "DisplayIcon" '"$INSTDIR\qbittorrent.exe",0'
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "Publisher" "The qBittorrent project"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "URLInfoAbout" "http://www.qbittorrent.org"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "URLInfoAbout" "https://www.qbittorrent.org"
|
||||
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "DisplayVersion" "${PROG_VERSION}"
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "NoModify" 1
|
||||
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\qBittorrent" "NoRepair" 1
|
||||
|
||||
BIN
dist/windows/nsis plugins/FindProcDLL_mod_by_hnedka.7z
vendored
Normal file
4
dist/windows/options.nsi
vendored
@@ -27,7 +27,7 @@ XPStyle on
|
||||
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
|
||||
|
||||
; Program specific
|
||||
!define PROG_VERSION "3.4.0"
|
||||
!define PROG_VERSION "4.1.0"
|
||||
|
||||
!define MUI_FINISHPAGE_RUN
|
||||
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
|
||||
@@ -50,7 +50,7 @@ XPStyle on
|
||||
;Installer Version Information
|
||||
VIAddVersionKey "ProductName" "qBittorrent"
|
||||
VIAddVersionKey "CompanyName" "The qBittorrent project"
|
||||
VIAddVersionKey "LegalCopyright" "Copyright ©2006-2017 The qBittorrent project"
|
||||
VIAddVersionKey "LegalCopyright" "Copyright ©2006-2018 The qBittorrent project"
|
||||
VIAddVersionKey "FileDescription" "qBittorrent - A Bittorrent Client"
|
||||
VIAddVersionKey "FileVersion" "${PROG_VERSION}"
|
||||
|
||||
|
||||
2
dist/windows/qt.conf
vendored
@@ -2,4 +2,4 @@
|
||||
Translations = translations
|
||||
|
||||
[Platforms]
|
||||
WindowsArguments = dpiawareness=0
|
||||
;WindowsArguments = dpiawareness=1
|
||||
|
||||
187
install.os2
@@ -1,187 +0,0 @@
|
||||
QBittorrent installation
|
||||
|
||||
|
||||
|
||||
0. CONTENTS OF THIS FILE
|
||||
========================
|
||||
|
||||
1. INTRODUCTION
|
||||
|
||||
2. REQUIREMENTS
|
||||
|
||||
3. INSTALLATION
|
||||
|
||||
4. BUGREPORTS
|
||||
|
||||
5. CREDITS
|
||||
|
||||
6. SUPPORT AND DONATIONS
|
||||
|
||||
7. HISTORY
|
||||
|
||||
|
||||
1. INTRODUCTION
|
||||
===============
|
||||
|
||||
Welcome to QBittorrent port for OS/2 and eComStation.
|
||||
|
||||
|
||||
2. REQUIREMENTS
|
||||
===============
|
||||
|
||||
The following requirements can be installed either by rpm or by zip files.
|
||||
|
||||
RPM Installation:
|
||||
|
||||
klibc
|
||||
-----
|
||||
|
||||
1. yum install libc
|
||||
|
||||
openssl 1.0
|
||||
-----------
|
||||
|
||||
1. yum install openssl
|
||||
|
||||
pthread
|
||||
-------
|
||||
|
||||
1. yum install pthread
|
||||
|
||||
GCC4Core
|
||||
--------
|
||||
|
||||
1. yum install libgcc
|
||||
2. yum install gcc-stack-protector
|
||||
3. yum install gcc-stdc++-shared-library
|
||||
4. yum install gcc-supc++-shared-library
|
||||
|
||||
Qt4 dll
|
||||
-------
|
||||
|
||||
1. yum install libqt4
|
||||
|
||||
|
||||
ZIP Installation:
|
||||
|
||||
klibc
|
||||
-----
|
||||
|
||||
1. Download klibc 0.6.5 or better (see http://svn.netlabs.org/libc for more information)
|
||||
2. Install the files to your libpath eg x:\ecs\dll
|
||||
|
||||
openssl 1.0
|
||||
-----------
|
||||
|
||||
1. Download the zip file from http://rpm.netlabs.org/release/00/zip
|
||||
2. Install the files to your libpath eg. x:\ecs\dll
|
||||
|
||||
pthread
|
||||
-------
|
||||
|
||||
1. Download pthread 2012-03-13 or better from http://rpm.netlabs.org/release/00/zip
|
||||
2. Install the files to your libpath eg. x:\ecs\dll
|
||||
|
||||
GCC4Core
|
||||
--------
|
||||
|
||||
1. Download GCC4Core 1.2.1 or better from http://ftp.netlabs.org/pub/gcc
|
||||
2. Install the files to your libpath eg. x:\ecs\dll
|
||||
|
||||
Qt4 dll
|
||||
-------
|
||||
|
||||
1. Download Qt4 4.7.3 or better (see http://svn.netlabs.org/qt4 for more information)
|
||||
2. Install the files according to the readme
|
||||
|
||||
|
||||
3. INSTALLATION
|
||||
===============
|
||||
|
||||
To install QBittorrent, do the following:
|
||||
|
||||
1. Create a directory for QBittorrent.
|
||||
2. Extract the QBittorrent package to the new directory.
|
||||
3. Create a WPS object for QBittorrent.exe.
|
||||
4. Start QBittorrent
|
||||
5. Happy torrenting
|
||||
|
||||
|
||||
4. BUGREPORTS
|
||||
=============
|
||||
|
||||
Please create bugreports at http://svn.netlabs.org/qtapps
|
||||
Only bug reports with a reproducible bug are accepted. :-)
|
||||
|
||||
|
||||
5. CREDITS
|
||||
==========
|
||||
|
||||
The port was done by:
|
||||
|
||||
Silvan Scherrer aka _diver
|
||||
|
||||
Thanks go to:
|
||||
|
||||
* Dmitry A. Kuminov
|
||||
|
||||
They either helped me when I had some nasty questions or did some testing for
|
||||
me.
|
||||
|
||||
|
||||
6. SUPPORT AND DONATIONS
|
||||
========================
|
||||
|
||||
QBittorrent port is based on volunteer work. If you would like to support further
|
||||
development, you can do so in one of the following ways:
|
||||
|
||||
|
||||
* Donate to the Qt4 project: see qt.netlabs.org for more information
|
||||
|
||||
* Contribute to the project: Besides actual development, this also includes
|
||||
maintaining the documentation and the project web site as well as help
|
||||
for users.
|
||||
|
||||
|
||||
7. HISTORY
|
||||
==========
|
||||
|
||||
2012-09-19
|
||||
|
||||
* updated to 3.0.4 code level of QBittorrent
|
||||
* updated libtorrent to 0.16.3 level
|
||||
|
||||
2012-09-06
|
||||
|
||||
* updated to 3.0.2 code level of QBittorrent
|
||||
|
||||
2012-05-14
|
||||
|
||||
* updated to 2.9.8 code level of QBittorrent
|
||||
|
||||
2012-03-15
|
||||
|
||||
* updated to 2.9.5 code level of QBittorrent
|
||||
|
||||
2011-09-26
|
||||
|
||||
* updated to 2.8.5 code level of QBittorrent
|
||||
* updated to Qt 4.7.3
|
||||
|
||||
2011-06-20
|
||||
|
||||
* updated to 2.7.3 code level of QBittorrent
|
||||
* updated libtorrent to 0.15.6 level
|
||||
|
||||
2010-12-23
|
||||
|
||||
* updated to 2.5.2 code level of QBittorrent
|
||||
|
||||
2010-11-22
|
||||
|
||||
* updated to 2.4.11 code level of QBittorrent
|
||||
|
||||
2010-xx-xx
|
||||
|
||||
* initial port
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_base.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
@@ -33,7 +33,15 @@
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 26
|
||||
#serial 42
|
||||
|
||||
# example boost program (need to pass version)
|
||||
m4_define([_AX_BOOST_BASE_PROGRAM],
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <boost/version.hpp>
|
||||
]],[[
|
||||
(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))]));
|
||||
]])])
|
||||
|
||||
AC_DEFUN([AX_BOOST_BASE],
|
||||
[
|
||||
@@ -44,104 +52,121 @@ AC_ARG_WITH([boost],
|
||||
or disable it (ARG=no)
|
||||
@<:@ARG=yes@:>@ ])],
|
||||
[
|
||||
if test "$withval" = "no"; then
|
||||
want_boost="no"
|
||||
elif test "$withval" = "yes"; then
|
||||
want_boost="yes"
|
||||
ac_boost_path=""
|
||||
else
|
||||
want_boost="yes"
|
||||
ac_boost_path="$withval"
|
||||
fi
|
||||
AS_CASE([$withval],
|
||||
[no],[want_boost="no";_AX_BOOST_BASE_boost_path=""],
|
||||
[yes],[want_boost="yes";_AX_BOOST_BASE_boost_path=""],
|
||||
[want_boost="yes";_AX_BOOST_BASE_boost_path="$withval"])
|
||||
],
|
||||
[want_boost="yes"])
|
||||
|
||||
|
||||
AC_ARG_WITH([boost-libdir],
|
||||
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
|
||||
[Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
|
||||
[
|
||||
if test -d "$withval"
|
||||
then
|
||||
ac_boost_lib_path="$withval"
|
||||
else
|
||||
AC_MSG_ERROR(--with-boost-libdir expected directory name)
|
||||
fi
|
||||
],
|
||||
[ac_boost_lib_path=""]
|
||||
)
|
||||
[AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
|
||||
[Force given directory for boost libraries.
|
||||
Note that this will override library path detection,
|
||||
so use this parameter only if default library detection fails
|
||||
and you know exactly where your boost libraries are located.])],
|
||||
[
|
||||
AS_IF([test -d "$withval"],
|
||||
[_AX_BOOST_BASE_boost_lib_path="$withval"],
|
||||
[AC_MSG_ERROR([--with-boost-libdir expected directory name])])
|
||||
],
|
||||
[_AX_BOOST_BASE_boost_lib_path=""])
|
||||
|
||||
if test "x$want_boost" = "xyes"; then
|
||||
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
|
||||
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
|
||||
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
|
||||
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
|
||||
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
|
||||
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
|
||||
boost_lib_version_req_sub_minor="0"
|
||||
fi
|
||||
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
|
||||
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
|
||||
BOOST_LDFLAGS=""
|
||||
BOOST_CPPFLAGS=""
|
||||
AS_IF([test "x$want_boost" = "xyes"],
|
||||
[_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])])
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
AC_SUBST(BOOST_LDFLAGS)
|
||||
])
|
||||
|
||||
|
||||
# convert a version string in $2 to numeric and affect to polymorphic var $1
|
||||
AC_DEFUN([_AX_BOOST_BASE_TONUMERICVERSION],[
|
||||
AS_IF([test "x$2" = "x"],[_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"],[_AX_BOOST_BASE_TONUMERICVERSION_req="$2"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\.[[0-9]]*\)'`
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\)'`
|
||||
AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"],
|
||||
[AC_MSG_ERROR([You should at least specify libboost major version])])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.\([[0-9]]*\)'`
|
||||
AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"],
|
||||
[_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
|
||||
AS_IF([test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"],
|
||||
[_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"])
|
||||
_AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor`
|
||||
AS_VAR_SET($1,$_AX_BOOST_BASE_TONUMERICVERSION_RET)
|
||||
])
|
||||
|
||||
dnl Run the detection of boost should be run only if $want_boost
|
||||
AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
|
||||
_AX_BOOST_BASE_TONUMERICVERSION(WANT_BOOST_VERSION,[$1])
|
||||
succeeded=no
|
||||
|
||||
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
dnl On 64-bit systems check for system libraries in both lib64 and lib.
|
||||
dnl The former is specified by FHS, but e.g. Debian does not adhere to
|
||||
dnl this (as it rises problems for generic multi-arch support).
|
||||
dnl The last entry in the list is chosen by default when no libraries
|
||||
dnl are found, e.g. when only header-only libraries are installed!
|
||||
libsubdirs="lib"
|
||||
ax_arch=`uname -m`
|
||||
case $ax_arch in
|
||||
x86_64)
|
||||
libsubdirs="lib64 libx32 lib lib64"
|
||||
;;
|
||||
ppc64|s390x|sparc64|aarch64|ppc64le)
|
||||
libsubdirs="lib64 lib lib64 ppc64le"
|
||||
;;
|
||||
esac
|
||||
AS_CASE([${host_cpu}],
|
||||
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
|
||||
[ppc64|s390x|sparc64|aarch64|ppc64le],[libsubdirs="lib64 lib lib64"],
|
||||
[libsubdirs="lib"]
|
||||
)
|
||||
|
||||
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
|
||||
dnl them priority over the other paths since, if libs are found there, they
|
||||
dnl are almost assuredly the ones desired.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
|
||||
|
||||
case ${host_cpu} in
|
||||
i?86)
|
||||
libsubdirs="lib/i386-${host_os} $libsubdirs"
|
||||
;;
|
||||
esac
|
||||
AS_CASE([${host_cpu}],
|
||||
[i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
|
||||
[multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
|
||||
)
|
||||
|
||||
dnl first we check the system location for boost libraries
|
||||
dnl this location ist chosen if boost libraries are installed with the --layout=system option
|
||||
dnl or if you install boost with RPM
|
||||
if test "$ac_boost_path" != ""; then
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path/include"
|
||||
for ac_boost_path_tmp in $libsubdirs; do
|
||||
if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
|
||||
BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
|
||||
break
|
||||
fi
|
||||
done
|
||||
elif test "$cross_compiling" != yes; then
|
||||
for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"])
|
||||
AS_IF([test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"],[
|
||||
AC_MSG_RESULT([yes])
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
|
||||
for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"])
|
||||
AS_IF([test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ],[
|
||||
AC_MSG_RESULT([yes])
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
|
||||
break;
|
||||
],
|
||||
[AC_MSG_RESULT([no])])
|
||||
done],[
|
||||
AC_MSG_RESULT([no])])
|
||||
],[
|
||||
if test X"$cross_compiling" = Xyes; then
|
||||
search_libsubdirs=$multiarch_libsubdir
|
||||
else
|
||||
search_libsubdirs="$multiarch_libsubdir $libsubdirs"
|
||||
fi
|
||||
for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then
|
||||
for libsubdir in $search_libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
fi
|
||||
])
|
||||
|
||||
dnl overwrite ld flags if we have required special directory with
|
||||
dnl --with-boost-libdir parameter
|
||||
if test "$ac_boost_lib_path" != ""; then
|
||||
BOOST_LDFLAGS="-L$ac_boost_lib_path"
|
||||
fi
|
||||
AS_IF([test "x$_AX_BOOST_BASE_boost_lib_path" != "x"],
|
||||
[BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"])
|
||||
|
||||
AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION)])
|
||||
CPPFLAGS_SAVED="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
|
||||
export CPPFLAGS
|
||||
@@ -152,15 +177,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
@%:@include <boost/version.hpp>
|
||||
]], [[
|
||||
#if BOOST_VERSION >= $WANT_BOOST_VERSION
|
||||
// Everything is okay
|
||||
#else
|
||||
# error Boost version is too old
|
||||
#endif
|
||||
]])],[
|
||||
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
found_system=yes
|
||||
@@ -172,40 +189,50 @@ if test "x$want_boost" = "xyes"; then
|
||||
|
||||
dnl if we found no boost with system layout we search for boost libraries
|
||||
dnl built and installed without the --layout=system option or for a staged(not installed) version
|
||||
if test "x$succeeded" != "xyes"; then
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
BOOST_CPPFLAGS=
|
||||
BOOST_LDFLAGS=
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
BOOST_LDFLAGS=
|
||||
fi
|
||||
_version=0
|
||||
if test "$ac_boost_path" != ""; then
|
||||
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
||||
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
if test -n "$_AX_BOOST_BASE_boost_path" ; then
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "$V_CHECK" = "1" ; then
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
fi
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
done
|
||||
dnl if nothing found search for layout used in Windows distributions
|
||||
if test -z "$BOOST_CPPFLAGS"; then
|
||||
if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path"
|
||||
if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then
|
||||
BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
|
||||
fi
|
||||
fi
|
||||
dnl if we found something and BOOST_LDFLAGS was unset before
|
||||
dnl (because "$_AX_BOOST_BASE_boost_lib_path" = ""), set it here.
|
||||
if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if test "$cross_compiling" != yes; then
|
||||
for ac_boost_path in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
|
||||
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
if test "x$cross_compiling" != "xyes" ; then
|
||||
for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do
|
||||
if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then
|
||||
for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
|
||||
_version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
|
||||
V_CHECK=`expr $_version_tmp \> $_version`
|
||||
if test "$V_CHECK" = "1" ; then
|
||||
if test "x$V_CHECK" = "x1" ; then
|
||||
_version=$_version_tmp
|
||||
best_path=$ac_boost_path
|
||||
best_path=$_AX_BOOST_BASE_boost_path
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -213,7 +240,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
|
||||
if test "$ac_boost_lib_path" = ""; then
|
||||
if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
@@ -221,7 +248,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$BOOST_ROOT" != "x"; then
|
||||
if test -n "$BOOST_ROOT" ; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
@@ -230,7 +257,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
|
||||
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
|
||||
V_CHECK=`expr $stage_version_shorten \>\= $_version`
|
||||
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
|
||||
if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
|
||||
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
|
||||
BOOST_CPPFLAGS="-I$BOOST_ROOT"
|
||||
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
|
||||
@@ -245,15 +272,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
export LDFLAGS
|
||||
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
@%:@include <boost/version.hpp>
|
||||
]], [[
|
||||
#if BOOST_VERSION >= $WANT_BOOST_VERSION
|
||||
// Everything is okay
|
||||
#else
|
||||
# error Boost version is too old
|
||||
#endif
|
||||
]])],[
|
||||
AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
|
||||
AC_MSG_RESULT(yes)
|
||||
succeeded=yes
|
||||
found_system=yes
|
||||
@@ -262,17 +281,15 @@ if test "x$want_boost" = "xyes"; then
|
||||
AC_LANG_POP([C++])
|
||||
fi
|
||||
|
||||
if test "$succeeded" != "yes" ; then
|
||||
if test "$_version" = "0" ; then
|
||||
AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
|
||||
if test "x$succeeded" != "xyes" ; then
|
||||
if test "x$_version" = "x0" ; then
|
||||
AC_MSG_NOTICE([[We could not detect the boost libraries (version $1 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
|
||||
else
|
||||
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
|
||||
fi
|
||||
# execute ACTION-IF-NOT-FOUND (if present):
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
AC_SUBST(BOOST_CPPFLAGS)
|
||||
AC_SUBST(BOOST_LDFLAGS)
|
||||
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
|
||||
# execute ACTION-IF-FOUND (if present):
|
||||
ifelse([$2], , :, [$2])
|
||||
@@ -280,6 +297,5 @@ if test "x$want_boost" = "xyes"; then
|
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED"
|
||||
LDFLAGS="$LDFLAGS_SAVED"
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# ===========================================================================
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_boost_system.html
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_system.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
@@ -31,7 +31,7 @@
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 18
|
||||
#serial 19
|
||||
|
||||
AC_DEFUN([AX_BOOST_SYSTEM],
|
||||
[
|
||||
|
||||
@@ -9,7 +9,7 @@ exists($$OUT_PWD/../conf.pri) {
|
||||
include(conf.pri)
|
||||
}
|
||||
|
||||
LIBS += -framework Carbon -framework IOKit
|
||||
LIBS += -framework Carbon -framework IOKit -framework AppKit
|
||||
|
||||
QT_LANG_PATH = ../dist/qt-translations
|
||||
DIST_PATH = ../dist/mac
|
||||
|
||||
16
os2conf.pri
@@ -1,16 +0,0 @@
|
||||
exists(conf.pri) {
|
||||
# to the conf.pri goes all system dependent stuff
|
||||
include(conf.pri)
|
||||
}
|
||||
|
||||
LIBS += \
|
||||
-ltorrent-rasterbar \
|
||||
-lboost_thread \
|
||||
-lboost_system \
|
||||
-lboost_filesystem \
|
||||
-lssl -lcrypto -lidn -lpthread -lz
|
||||
|
||||
RC_FILE = qbittorrent_os2.rc
|
||||
|
||||
# LIBTORRENT DEFINES
|
||||
DEFINES += BOOST_ASIO_DYN_LINK
|
||||
@@ -17,3 +17,7 @@ tarball.commands += xz -f $${PROJECT_NAME}-$${PROJECT_VERSION}.tar &&
|
||||
tarball.commands += rm -fR $${PROJECT_NAME}-$${PROJECT_VERSION}
|
||||
|
||||
QMAKE_EXTRA_TARGETS += tarball
|
||||
|
||||
# For Qt Creator beautifier
|
||||
DISTFILES += \
|
||||
uncrustify.cfg
|
||||
|
||||
@@ -2,7 +2,7 @@ TS_IN = $$fromfile(src/src.pro,TRANSLATIONS)
|
||||
TS_IN_NOEXT = $$replace(TS_IN,".ts","")
|
||||
|
||||
isEmpty(QMAKE_LRELEASE) {
|
||||
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
|
||||
win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe
|
||||
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
|
||||
unix {
|
||||
equals(QT_MAJOR_VERSION, 5) {
|
||||
|
||||
@@ -13,7 +13,7 @@ find_package(LibtorrentRasterbar REQUIRED)
|
||||
# Qt
|
||||
list(APPEND QBT_QT_COMPONENTS Core Network Xml)
|
||||
if (GUI)
|
||||
list (APPEND QBT_QT_COMPONENTS Concurrent Gui Svg Widgets)
|
||||
list (APPEND QBT_QT_COMPONENTS Gui Svg Widgets)
|
||||
if (WIN32)
|
||||
list (APPEND QBT_QT_COMPONENTS WinExtras)
|
||||
endif(WIN32)
|
||||
@@ -40,11 +40,8 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# defines
|
||||
add_definitions(-DQT_NO_CAST_TO_ASCII)
|
||||
# Fast concatenation (Qt >= 4.6)
|
||||
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
|
||||
if (WIN32)
|
||||
add_definitions(-DNOMINMAX)
|
||||
endif (WIN32)
|
||||
# Efficient construction for QString & QByteArray (Qt >= 4.8)
|
||||
add_definitions(-DQT_USE_QSTRINGBUILDER)
|
||||
|
||||
if (NOT GUI)
|
||||
add_definitions(-DDISABLE_GUI -DDISABLE_COUNTRIES_RESOLUTION)
|
||||
@@ -54,9 +51,9 @@ if (NOT WEBUI)
|
||||
add_definitions(-DDISABLE_WEBUI)
|
||||
endif (NOT WEBUI)
|
||||
|
||||
if (STACKTRACE_WIN)
|
||||
add_definitions(-DSTACKTRACE_WIN)
|
||||
endif(STACKTRACE_WIN)
|
||||
if (STACKTRACE)
|
||||
add_definitions(-DSTACKTRACE)
|
||||
endif(STACKTRACE)
|
||||
# nogui {
|
||||
# TARGET = qbittorrent-nox
|
||||
# } else {
|
||||
|
||||
@@ -53,16 +53,16 @@ if (WIN32)
|
||||
list(APPEND QBT_APP_SOURCES ../qbittorrent.exe.manifest)
|
||||
endif (WIN32)
|
||||
|
||||
if (UNIX)
|
||||
list(APPEND QBT_APP_HEADERS stacktrace.h)
|
||||
endif (UNIX)
|
||||
|
||||
if (STACKTRACE_WIN)
|
||||
list(APPEND QBT_APP_HEADERS stacktrace_win.h)
|
||||
if (GUI)
|
||||
list(APPEND QBT_APP_HEADERS stacktrace_win_dlg.h)
|
||||
endif (GUI)
|
||||
endif (STACKTRACE_WIN)
|
||||
if (STACKTRACE)
|
||||
if (UNIX)
|
||||
list(APPEND QBT_APP_HEADERS stacktrace.h)
|
||||
else (UNIX)
|
||||
list(APPEND QBT_APP_HEADERS stacktrace_win.h)
|
||||
if (GUI)
|
||||
list(APPEND QBT_APP_HEADERS stacktrace_win_dlg.h)
|
||||
endif (GUI)
|
||||
endif (UNIX)
|
||||
endif (STACKTRACE)
|
||||
|
||||
# usesystemqtsingleapplication {
|
||||
# nogui {
|
||||
|
||||
@@ -25,12 +25,16 @@ SOURCES += \
|
||||
$$PWD/filelogger.cpp \
|
||||
$$PWD/main.cpp
|
||||
|
||||
unix: HEADERS += $$PWD/stacktrace.h
|
||||
strace_win {
|
||||
HEADERS += $$PWD/stacktrace_win.h
|
||||
!nogui {
|
||||
HEADERS += $$PWD/stacktrace_win_dlg.h
|
||||
FORMS += $$PWD/stacktrace_win_dlg.ui
|
||||
stacktrace {
|
||||
unix {
|
||||
HEADERS += $$PWD/stacktrace.h
|
||||
}
|
||||
else {
|
||||
HEADERS += $$PWD/stacktrace_win.h
|
||||
!nogui {
|
||||
HEADERS += $$PWD/stacktrace_win_dlg.h
|
||||
FORMS += $$PWD/stacktrace_win_dlg.ui
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,56 +27,67 @@
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include "application.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
#include <QAtomicInt>
|
||||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
#include <QLocale>
|
||||
#include <QLibraryInfo>
|
||||
#include <QSysInfo>
|
||||
#include <QLocale>
|
||||
#include <QProcess>
|
||||
#include <QAtomicInt>
|
||||
#include <QSysInfo>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/iconprovider.h"
|
||||
#include "base/logger.h"
|
||||
#include "base/net/downloadmanager.h"
|
||||
#include "base/net/geoipmanager.h"
|
||||
#include "base/net/proxyconfigurationmanager.h"
|
||||
#include "base/net/smtp.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/profile.h"
|
||||
#include "base/rss/rss_autodownloader.h"
|
||||
#include "base/rss/rss_session.h"
|
||||
#include "base/scanfoldersmodel.h"
|
||||
#include "base/settingsstorage.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "filelogger.h"
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
#include "gui/guiiconprovider.h"
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
#include <QSharedMemory>
|
||||
#include <QSessionManager>
|
||||
#include <QSharedMemory>
|
||||
#endif // Q_OS_WIN
|
||||
#ifdef Q_OS_MAC
|
||||
#include <QFileOpenEvent>
|
||||
#include <QFont>
|
||||
#include <QUrl>
|
||||
#endif // Q_OS_MAC
|
||||
#include "mainwindow.h"
|
||||
#include "addnewtorrentdialog.h"
|
||||
#include "gui/guiiconprovider.h"
|
||||
#include "mainwindow.h"
|
||||
#include "shutdownconfirmdlg.h"
|
||||
#else // DISABLE_GUI
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <Shellapi.h>
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
#include "webui/webui.h"
|
||||
#endif
|
||||
|
||||
#include "application.h"
|
||||
#include "filelogger.h"
|
||||
#include "base/logger.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/settingsstorage.h"
|
||||
#include "base/profile.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/iconprovider.h"
|
||||
#include "base/scanfoldersmodel.h"
|
||||
#include "base/net/smtp.h"
|
||||
#include "base/net/downloadmanager.h"
|
||||
#include "base/net/geoipmanager.h"
|
||||
#include "base/net/proxyconfigurationmanager.h"
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/rss/rss_autodownloader.h"
|
||||
#include "base/rss/rss_session.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
#define SETTINGS_KEY(name) "Application/" name
|
||||
@@ -87,7 +98,7 @@ namespace
|
||||
const QString KEY_FILELOGGER_PATH = FILELOGGER_SETTINGS_KEY("Path");
|
||||
const QString KEY_FILELOGGER_BACKUP = FILELOGGER_SETTINGS_KEY("Backup");
|
||||
const QString KEY_FILELOGGER_DELETEOLD = FILELOGGER_SETTINGS_KEY("DeleteOld");
|
||||
const QString KEY_FILELOGGER_MAXSIZE = FILELOGGER_SETTINGS_KEY("MaxSize");
|
||||
const QString KEY_FILELOGGER_MAXSIZEBYTES = FILELOGGER_SETTINGS_KEY("MaxSizeBytes");
|
||||
const QString KEY_FILELOGGER_AGE = FILELOGGER_SETTINGS_KEY("Age");
|
||||
const QString KEY_FILELOGGER_AGETYPE = FILELOGGER_SETTINGS_KEY("AgeType");
|
||||
|
||||
@@ -98,6 +109,10 @@ namespace
|
||||
const char PARAMS_SEPARATOR[] = "|";
|
||||
|
||||
const QString DEFAULT_PORTABLE_MODE_PROFILE_DIR = QLatin1String("profile");
|
||||
|
||||
const int MIN_FILELOG_SIZE = 1024; // 1KiB
|
||||
const int MAX_FILELOG_SIZE = 1000 * 1024 * 1024; // 1000MiB
|
||||
const int DEFAULT_FILELOG_SIZE = 65 * 1024; // 65KiB
|
||||
}
|
||||
|
||||
Application::Application(const QString &id, int &argc, char **argv)
|
||||
@@ -105,6 +120,9 @@ Application::Application(const QString &id, int &argc, char **argv)
|
||||
, m_running(false)
|
||||
, m_shutdownAct(ShutdownDialogAction::Exit)
|
||||
, m_commandLineArgs(parseCommandLine(this->arguments()))
|
||||
#ifndef DISABLE_WEBUI
|
||||
, m_webui(nullptr)
|
||||
#endif
|
||||
{
|
||||
qRegisterMetaType<Log::Msg>("Log::Msg");
|
||||
|
||||
@@ -125,7 +143,6 @@ Application::Application(const QString &id, int &argc, char **argv)
|
||||
if (m_commandLineArgs.webUiPort > 0) // it will be -1 when user did not set any value
|
||||
Preferences::instance()->setWebUiPort(m_commandLineArgs.webUiPort);
|
||||
|
||||
setApplicationName("qBittorrent");
|
||||
initializeTranslation();
|
||||
|
||||
#if !defined(DISABLE_GUI)
|
||||
@@ -146,6 +163,13 @@ Application::Application(const QString &id, int &argc, char **argv)
|
||||
Logger::instance()->addMessage(tr("qBittorrent %1 started", "qBittorrent v3.2.0alpha started").arg(QBT_VERSION));
|
||||
}
|
||||
|
||||
Application::~Application()
|
||||
{
|
||||
// we still need to call cleanup()
|
||||
// in case the App failed to start
|
||||
cleanup();
|
||||
}
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
QPointer<MainWindow> Application::mainWindow()
|
||||
{
|
||||
@@ -211,29 +235,22 @@ void Application::setFileLoggerDeleteOld(bool value)
|
||||
|
||||
int Application::fileLoggerMaxSize() const
|
||||
{
|
||||
int val = settings()->loadValue(KEY_FILELOGGER_MAXSIZE, 10).toInt();
|
||||
if (val < 1)
|
||||
return 1;
|
||||
if (val > 1000)
|
||||
return 1000;
|
||||
return val;
|
||||
int val = settings()->loadValue(KEY_FILELOGGER_MAXSIZEBYTES, DEFAULT_FILELOG_SIZE).toInt();
|
||||
return std::min(std::max(val, MIN_FILELOG_SIZE), MAX_FILELOG_SIZE);
|
||||
}
|
||||
|
||||
void Application::setFileLoggerMaxSize(const int value)
|
||||
void Application::setFileLoggerMaxSize(const int bytes)
|
||||
{
|
||||
int clampedValue = std::min(std::max(bytes, MIN_FILELOG_SIZE), MAX_FILELOG_SIZE);
|
||||
if (m_fileLogger)
|
||||
m_fileLogger->setMaxSize(value);
|
||||
settings()->storeValue(KEY_FILELOGGER_MAXSIZE, std::min(std::max(value, 1), 1000));
|
||||
m_fileLogger->setMaxSize(clampedValue);
|
||||
settings()->storeValue(KEY_FILELOGGER_MAXSIZEBYTES, clampedValue);
|
||||
}
|
||||
|
||||
int Application::fileLoggerAge() const
|
||||
{
|
||||
int val = settings()->loadValue(KEY_FILELOGGER_AGE, 6).toInt();
|
||||
if (val < 1)
|
||||
return 1;
|
||||
if (val > 365)
|
||||
return 365;
|
||||
return val;
|
||||
int val = settings()->loadValue(KEY_FILELOGGER_AGE, 1).toInt();
|
||||
return std::min(std::max(val, 1), 365);
|
||||
}
|
||||
|
||||
void Application::setFileLoggerAge(const int value)
|
||||
@@ -263,11 +280,16 @@ void Application::processMessage(const QString &message)
|
||||
m_paramsQueue.append(params);
|
||||
}
|
||||
|
||||
void Application::runExternalProgram(BitTorrent::TorrentHandle *const torrent) const
|
||||
void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) const
|
||||
{
|
||||
QString program = Preferences::instance()->getAutoRunProgram();
|
||||
QString program = Preferences::instance()->getAutoRunProgram().trimmed();
|
||||
program.replace("%N", torrent->name());
|
||||
program.replace("%L", torrent->category());
|
||||
|
||||
QStringList tags = torrent->tags().toList();
|
||||
std::sort(tags.begin(), tags.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
|
||||
program.replace("%G", tags.join(','));
|
||||
|
||||
program.replace("%F", Utils::Fs::toNativePath(torrent->contentPath()));
|
||||
program.replace("%R", Utils::Fs::toNativePath(torrent->rootPath()));
|
||||
program.replace("%D", Utils::Fs::toNativePath(torrent->savePath()));
|
||||
@@ -277,52 +299,46 @@ void Application::runExternalProgram(BitTorrent::TorrentHandle *const torrent) c
|
||||
program.replace("%I", torrent->hash());
|
||||
|
||||
Logger *logger = Logger::instance();
|
||||
logger->addMessage(tr("Torrent: %1, running external program, command: %2").arg(torrent->name()).arg(program));
|
||||
logger->addMessage(tr("Torrent: %1, running external program, command: %2").arg(torrent->name(), program));
|
||||
|
||||
#if defined(Q_OS_UNIX)
|
||||
QProcess::startDetached(QLatin1String("/bin/sh"), {QLatin1String("-c"), program});
|
||||
#elif defined(Q_OS_WIN) // test cmd: `echo "%F" > "c:\ab ba.txt"`
|
||||
program.prepend(QLatin1String("\"")).append(QLatin1String("\""));
|
||||
program.prepend(Utils::Misc::windowsSystemPath() + QLatin1String("\\cmd.exe /C "));
|
||||
const int cmdMaxLength = 32768; // max length (incl. terminate char) for `lpCommandLine` in `CreateProcessW()`
|
||||
if ((program.size() + 1) > cmdMaxLength) {
|
||||
logger->addMessage(tr("Torrent: %1, run external program command too long (length > %2), execution failed.").arg(torrent->name()).arg(cmdMaxLength), Log::CRITICAL);
|
||||
return;
|
||||
}
|
||||
|
||||
STARTUPINFOW si = {0};
|
||||
si.cb = sizeof(si);
|
||||
PROCESS_INFORMATION pi = {0};
|
||||
|
||||
WCHAR *arg = new WCHAR[program.size() + 1];
|
||||
program.toWCharArray(arg);
|
||||
arg[program.size()] = L'\0';
|
||||
if (CreateProcessW(NULL, arg, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)) {
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
delete[] arg;
|
||||
#else
|
||||
QProcess::startDetached(program);
|
||||
std::unique_ptr<wchar_t[]> programWchar(new wchar_t[program.length() + 1] {});
|
||||
program.toWCharArray(programWchar.get());
|
||||
|
||||
// Need to split arguments manually because QProcess::startDetached(QString)
|
||||
// will strip off empty parameters.
|
||||
// E.g. `python.exe "1" "" "3"` will become `python.exe "1" "3"`
|
||||
int argCount = 0;
|
||||
LPWSTR *args = ::CommandLineToArgvW(programWchar.get(), &argCount);
|
||||
|
||||
QStringList argList;
|
||||
for (int i = 1; i < argCount; ++i)
|
||||
argList += QString::fromWCharArray(args[i]);
|
||||
|
||||
QProcess::startDetached(QString::fromWCharArray(args[0]), argList);
|
||||
|
||||
::LocalFree(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::sendNotificationEmail(BitTorrent::TorrentHandle *const torrent)
|
||||
void Application::sendNotificationEmail(const BitTorrent::TorrentHandle *torrent)
|
||||
{
|
||||
// Prepare mail content
|
||||
QString content = QObject::tr("Torrent name: %1").arg(torrent->name()) + "\n";
|
||||
content += QObject::tr("Torrent size: %1").arg(Utils::Misc::friendlyUnit(torrent->wantedSize())) + "\n";
|
||||
content += QObject::tr("Save path: %1").arg(torrent->savePath()) + "\n\n";
|
||||
content += QObject::tr("The torrent was downloaded in %1.",
|
||||
"The torrent was downloaded in 1 hour and 20 seconds")
|
||||
.arg(Utils::Misc::userFriendlyDuration(torrent->activeTime())) + "\n\n\n";
|
||||
content += QObject::tr("Thank you for using qBittorrent.") + "\n";
|
||||
const QString content = tr("Torrent name: %1").arg(torrent->name()) + "\n"
|
||||
+ tr("Torrent size: %1").arg(Utils::Misc::friendlyUnit(torrent->wantedSize())) + "\n"
|
||||
+ tr("Save path: %1").arg(torrent->savePath()) + "\n\n"
|
||||
+ tr("The torrent was downloaded in %1.", "The torrent was downloaded in 1 hour and 20 seconds")
|
||||
.arg(Utils::Misc::userFriendlyDuration(torrent->activeTime())) + "\n\n\n"
|
||||
+ tr("Thank you for using qBittorrent.") + "\n";
|
||||
|
||||
// Send the notification email
|
||||
Net::Smtp *sender = new Net::Smtp;
|
||||
sender->sendMail("notification@qbittorrent.org",
|
||||
Preferences::instance()->getMailNotificationEmail(),
|
||||
QObject::tr("[qBittorrent] '%1' has finished downloading").arg(torrent->name()),
|
||||
const Preferences *pref = Preferences::instance();
|
||||
Net::Smtp *smtp = new Net::Smtp(this);
|
||||
smtp->sendMail(pref->getMailNotificationSender(),
|
||||
pref->getMailNotificationEmail(),
|
||||
tr("[qBittorrent] '%1' has finished downloading").arg(torrent->name()),
|
||||
content);
|
||||
}
|
||||
|
||||
@@ -416,7 +432,7 @@ void Application::processParams(const QStringList ¶ms)
|
||||
}
|
||||
|
||||
if (param.startsWith(QLatin1String("@addPaused="))) {
|
||||
torrentParams.addPaused = param.mid(11).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
torrentParams.addPaused = param.midRef(11).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -441,7 +457,7 @@ void Application::processParams(const QStringList ¶ms)
|
||||
}
|
||||
|
||||
if (param.startsWith(QLatin1String("@skipDialog="))) {
|
||||
skipTorrentDialog = param.mid(12).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
skipTorrentDialog = param.midRef(12).toInt() ? TriStateBool::True : TriStateBool::False;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -483,7 +499,12 @@ int Application::exec(const QStringList ¶ms)
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
m_webui = new WebUI;
|
||||
#endif
|
||||
#ifdef DISABLE_GUI
|
||||
if (m_webui->isErrored())
|
||||
return 1;
|
||||
connect(m_webui, &WebUI::fatalError, this, []() { QCoreApplication::exit(1); });
|
||||
#endif // DISABLE_GUI
|
||||
#endif // DISABLE_WEBUI
|
||||
|
||||
new RSS::Session; // create RSS::Session singleton
|
||||
new RSS::AutoDownloader; // create RSS::AutoDownloader singleton
|
||||
@@ -492,13 +513,16 @@ int Application::exec(const QStringList ¶ms)
|
||||
#ifndef DISABLE_WEBUI
|
||||
Preferences* const pref = Preferences::instance();
|
||||
// Display some information to the user
|
||||
std::cout << std::endl << "******** " << qPrintable(tr("Information")) << " ********" << std::endl;
|
||||
std::cout << qPrintable(tr("To control qBittorrent, access the Web UI at http://localhost:%1").arg(QString::number(pref->getWebUiPort()))) << std::endl;
|
||||
std::cout << qPrintable(tr("The Web UI administrator user name is: %1").arg(pref->getWebUiUsername())) << std::endl;
|
||||
const QString mesg = QString("\n******** %1 ********\n").arg(tr("Information"))
|
||||
+ tr("To control qBittorrent, access the Web UI at %1")
|
||||
.arg(QString("http://localhost:") + QString::number(pref->getWebUiPort())) + '\n'
|
||||
+ tr("The Web UI administrator user name is: %1").arg(pref->getWebUiUsername()) + '\n';
|
||||
printf("%s", qUtf8Printable(mesg));
|
||||
qDebug() << "Password:" << pref->getWebUiPassword();
|
||||
if (pref->getWebUiPassword() == "f6fdffe48c908deb0f4c3bd36c032e72") {
|
||||
std::cout << qPrintable(tr("The Web UI administrator password is still the default one: %1").arg("adminadmin")) << std::endl;
|
||||
std::cout << qPrintable(tr("This is a security risk, please consider changing your password from program preferences.")) << std::endl;
|
||||
const QString warning = tr("The Web UI administrator password is still the default one: %1").arg("adminadmin") + '\n'
|
||||
+ tr("This is a security risk, please consider changing your password from program preferences.") + '\n';
|
||||
printf("%s", qUtf8Printable(warning));
|
||||
}
|
||||
#endif // DISABLE_WEBUI
|
||||
#else
|
||||
@@ -506,15 +530,15 @@ int Application::exec(const QStringList ¶ms)
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
m_running = true;
|
||||
|
||||
// Now UI is ready to process signals from Session
|
||||
BitTorrent::Session::instance()->startUpTorrents();
|
||||
|
||||
m_paramsQueue = params + m_paramsQueue;
|
||||
if (!m_paramsQueue.isEmpty()) {
|
||||
processParams(m_paramsQueue);
|
||||
m_paramsQueue.clear();
|
||||
}
|
||||
|
||||
// Now UI is ready to process signals from Session
|
||||
BitTorrent::Session::instance()->startUpTorrents();
|
||||
|
||||
return BaseApplication::exec();
|
||||
}
|
||||
|
||||
@@ -554,7 +578,7 @@ bool Application::event(QEvent *ev)
|
||||
if (path.isEmpty())
|
||||
// Get the url instead
|
||||
path = static_cast<QFileOpenEvent *>(ev)->url().toString();
|
||||
qDebug("Received a mac file open event: %s", qPrintable(path));
|
||||
qDebug("Received a mac file open event: %s", qUtf8Printable(path));
|
||||
if (m_running)
|
||||
processParams(QStringList(path));
|
||||
else
|
||||
@@ -587,18 +611,18 @@ void Application::initializeTranslation()
|
||||
// Load translation
|
||||
QString localeStr = pref->getLocale();
|
||||
|
||||
if (m_qtTranslator.load(QString::fromUtf8("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ||
|
||||
m_qtTranslator.load(QString::fromUtf8("qt_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
qDebug("Qt %s locale recognized, using translation.", qPrintable(localeStr));
|
||||
if (m_qtTranslator.load(QLatin1String("qtbase_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)) ||
|
||||
m_qtTranslator.load(QLatin1String("qt_") + localeStr, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
qDebug("Qt %s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("Qt %s locale unrecognized, using default (en).", qPrintable(localeStr));
|
||||
qDebug("Qt %s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
|
||||
installTranslator(&m_qtTranslator);
|
||||
|
||||
if (m_translator.load(QString::fromUtf8(":/lang/qbittorrent_") + localeStr))
|
||||
qDebug("%s locale recognized, using translation.", qPrintable(localeStr));
|
||||
if (m_translator.load(QLatin1String(":/lang/qbittorrent_") + localeStr))
|
||||
qDebug("%s locale recognized, using translation.", qUtf8Printable(localeStr));
|
||||
else
|
||||
qDebug("%s locale unrecognized, using default (en).", qPrintable(localeStr));
|
||||
qDebug("%s locale unrecognized, using default (en).", qUtf8Printable(localeStr));
|
||||
installTranslator(&m_translator);
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
@@ -642,37 +666,36 @@ void Application::shutdownCleanup(QSessionManager &manager)
|
||||
|
||||
void Application::cleanup()
|
||||
{
|
||||
#ifndef DISABLE_GUI
|
||||
#ifdef Q_OS_WIN
|
||||
// cleanup() can be called multiple times during shutdown. We only need it once.
|
||||
static QAtomicInt alreadyDone;
|
||||
if (!alreadyDone.testAndSetAcquire(0, 1))
|
||||
return;
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
// Hide the window and not leave it on screen as
|
||||
// unresponsive. Also for Windows take the WinId
|
||||
// after it's hidden, because hide() may cause a
|
||||
// WinId change.
|
||||
m_window->hide();
|
||||
#ifndef DISABLE_GUI
|
||||
if (m_window) {
|
||||
// Hide the window and not leave it on screen as
|
||||
// unresponsive. Also for Windows take the WinId
|
||||
// after it's hidden, because hide() may cause a
|
||||
// WinId change.
|
||||
m_window->hide();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
typedef BOOL (WINAPI *PSHUTDOWNBRCREATE)(HWND, LPCWSTR);
|
||||
PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)::GetProcAddress(::GetModuleHandleW(L"User32.dll"), "ShutdownBlockReasonCreate");
|
||||
// Only available on Vista+
|
||||
if (shutdownBRCreate)
|
||||
shutdownBRCreate((HWND)m_window->effectiveWinId(), tr("Saving torrent progress...").toStdWString().c_str());
|
||||
typedef BOOL (WINAPI *PSHUTDOWNBRCREATE)(HWND, LPCWSTR);
|
||||
const auto shutdownBRCreate = Utils::Misc::loadWinAPI<PSHUTDOWNBRCREATE>("User32.dll", "ShutdownBlockReasonCreate");
|
||||
// Only available on Vista+
|
||||
if (shutdownBRCreate)
|
||||
shutdownBRCreate((HWND)m_window->effectiveWinId(), tr("Saving torrent progress...").toStdWString().c_str());
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
// Do manual cleanup in MainWindow to force widgets
|
||||
// to save their Preferences, stop all timers and
|
||||
// delete as many widgets as possible to leave only
|
||||
// a 'shell' MainWindow.
|
||||
// We need a valid window handle for Windows Vista+
|
||||
// otherwise the system shutdown will continue even
|
||||
// though we created a ShutdownBlockReason
|
||||
m_window->cleanup();
|
||||
|
||||
// Do manual cleanup in MainWindow to force widgets
|
||||
// to save their Preferences, stop all timers and
|
||||
// delete as many widgets as possible to leave only
|
||||
// a 'shell' MainWindow.
|
||||
// We need a valid window handle for Windows Vista+
|
||||
// otherwise the system shutdown will continue even
|
||||
// though we created a ShutdownBlockReason
|
||||
m_window->cleanup();
|
||||
}
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
@@ -697,14 +720,16 @@ void Application::cleanup()
|
||||
Utils::Fs::removeDirRecursive(Utils::Fs::tempPath());
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
if (m_window) {
|
||||
#ifdef Q_OS_WIN
|
||||
typedef BOOL (WINAPI *PSHUTDOWNBRDESTROY)(HWND);
|
||||
PSHUTDOWNBRDESTROY shutdownBRDestroy = (PSHUTDOWNBRDESTROY)::GetProcAddress(::GetModuleHandleW(L"User32.dll"), "ShutdownBlockReasonDestroy");
|
||||
// Only available on Vista+
|
||||
if (shutdownBRDestroy)
|
||||
shutdownBRDestroy((HWND)m_window->effectiveWinId());
|
||||
typedef BOOL (WINAPI *PSHUTDOWNBRDESTROY)(HWND);
|
||||
const auto shutdownBRDestroy = Utils::Misc::loadWinAPI<PSHUTDOWNBRDESTROY>("User32.dll", "ShutdownBlockReasonDestroy");
|
||||
// Only available on Vista+
|
||||
if (shutdownBRDestroy)
|
||||
shutdownBRDestroy((HWND)m_window->effectiveWinId());
|
||||
#endif // Q_OS_WIN
|
||||
delete m_window;
|
||||
delete m_window;
|
||||
}
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
if (m_shutdownAct != ShutdownDialogAction::Exit) {
|
||||
|
||||
@@ -73,9 +73,11 @@ namespace RSS
|
||||
class Application : public BaseApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(Application)
|
||||
|
||||
public:
|
||||
Application(const QString &id, int &argc, char **argv);
|
||||
~Application() override;
|
||||
|
||||
#if (defined(Q_OS_WIN) && !defined(DISABLE_GUI))
|
||||
bool isRunning();
|
||||
@@ -99,7 +101,7 @@ public:
|
||||
bool isFileLoggerDeleteOld() const;
|
||||
void setFileLoggerDeleteOld(bool value);
|
||||
int fileLoggerMaxSize() const;
|
||||
void setFileLoggerMaxSize(const int value);
|
||||
void setFileLoggerMaxSize(const int bytes);
|
||||
int fileLoggerAge() const;
|
||||
void setFileLoggerAge(const int value);
|
||||
int fileLoggerAgeType() const;
|
||||
@@ -110,7 +112,7 @@ protected:
|
||||
#ifdef Q_OS_MAC
|
||||
bool event(QEvent *);
|
||||
#endif
|
||||
bool notify(QObject* receiver, QEvent* event);
|
||||
bool notify(QObject* receiver, QEvent* event) override;
|
||||
#endif
|
||||
|
||||
private slots:
|
||||
@@ -132,7 +134,7 @@ private:
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_WEBUI
|
||||
QPointer<WebUI> m_webui;
|
||||
WebUI *m_webui;
|
||||
#endif
|
||||
|
||||
// FileLog
|
||||
@@ -144,8 +146,8 @@ private:
|
||||
|
||||
void initializeTranslation();
|
||||
void processParams(const QStringList ¶ms);
|
||||
void runExternalProgram(BitTorrent::TorrentHandle *const torrent) const;
|
||||
void sendNotificationEmail(BitTorrent::TorrentHandle *const torrent);
|
||||
void runExternalProgram(const BitTorrent::TorrentHandle *torrent) const;
|
||||
void sendNotificationEmail(const BitTorrent::TorrentHandle *torrent);
|
||||
void validateCommandLineParameters();
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "cmdoptions.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
@@ -216,7 +216,7 @@ namespace
|
||||
int res = val.toInt(&ok);
|
||||
if (!ok) {
|
||||
qDebug() << QObject::tr("Expected integer number in environment variable '%1', but got '%2'")
|
||||
.arg(envVarName()).arg(val);
|
||||
.arg(envVarName(), val);
|
||||
return defaultValue;
|
||||
}
|
||||
return res;
|
||||
@@ -293,7 +293,7 @@ namespace
|
||||
}
|
||||
else {
|
||||
qDebug() << QObject::tr("Expected %1 in environment variable '%2', but got '%3'")
|
||||
.arg(QLatin1String("true|false")).arg(envVarName()).arg(val);
|
||||
.arg(QLatin1String("true|false"), envVarName(), val);
|
||||
return TriStateBool::Undefined;
|
||||
}
|
||||
}
|
||||
@@ -417,7 +417,7 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args)
|
||||
else if (arg == WEBUI_PORT_OPTION) {
|
||||
result.webUiPort = WEBUI_PORT_OPTION.value(arg);
|
||||
if ((result.webUiPort < 1) || (result.webUiPort > 65535))
|
||||
throw CommandLineParameterError(QObject::tr("%1 must specify the correct port (1 to 65535).")
|
||||
throw CommandLineParameterError(QObject::tr("%1 must specify a valid port (1 to 65535).")
|
||||
.arg(QLatin1String("--webui-port")));
|
||||
}
|
||||
#ifndef DISABLE_GUI
|
||||
@@ -523,11 +523,11 @@ QString makeUsage(const QString &prgName)
|
||||
|
||||
stream << QObject::tr("Options:") << '\n';
|
||||
#ifndef Q_OS_WIN
|
||||
stream << SHOW_VERSION_OPTION.usage() << wrapText(QObject::tr("Displays program version and exit")) << '\n';
|
||||
stream << SHOW_VERSION_OPTION.usage() << wrapText(QObject::tr("Display program version and exit")) << '\n';
|
||||
#endif
|
||||
stream << SHOW_HELP_OPTION.usage() << wrapText(QObject::tr("Displays this help message and exit")) << '\n';
|
||||
stream << SHOW_HELP_OPTION.usage() << wrapText(QObject::tr("Display this help message and exit")) << '\n';
|
||||
stream << WEBUI_PORT_OPTION.usage(QObject::tr("port"))
|
||||
<< wrapText(QObject::tr("Changes the Web UI port"))
|
||||
<< wrapText(QObject::tr("Change the Web UI port"))
|
||||
<< '\n';
|
||||
#ifndef DISABLE_GUI
|
||||
stream << NO_SPLASH_OPTION.usage() << wrapText(QObject::tr("Disable splash screen")) << '\n';
|
||||
@@ -543,9 +543,10 @@ QString makeUsage(const QString &prgName)
|
||||
<< wrapText(QObject::tr("Hack into libtorrent fastresume files and make file paths relative "
|
||||
"to the profile directory")) << '\n';
|
||||
stream << PORTABLE_OPTION.usage()
|
||||
<< wrapText(QObject::tr("Shortcut for --profile=<exe dir>/profile --relative-fastresume")) << '\n';
|
||||
stream << Option::padUsageText(QObject::tr("files or urls"))
|
||||
<< wrapText(QObject::tr("Downloads the torrents passed by the user")) << '\n'
|
||||
<< wrapText(QObject::tr("Shortcut for %1", "Shortcut for --profile=<exe dir>/profile --relative-fastresume")
|
||||
.arg(QLatin1String("--profile=<exe dir>/profile --relative-fastresume"))) << '\n';
|
||||
stream << Option::padUsageText(QObject::tr("files or URLs"))
|
||||
<< wrapText(QObject::tr("Download the torrents passed by the user")) << '\n'
|
||||
<< '\n';
|
||||
|
||||
stream << wrapText(QObject::tr("Options when adding new torrents:"), 0) << '\n';
|
||||
@@ -559,7 +560,7 @@ QString makeUsage(const QString &prgName)
|
||||
stream << FIRST_AND_LAST_OPTION.usage()
|
||||
<< wrapText(QObject::tr("Download first and last pieces first")) << '\n';
|
||||
stream << SKIP_DIALOG_OPTION.usage()
|
||||
<< wrapText(QObject::tr("Specifies whether the \"Add New Torrent\" dialog opens when adding a "
|
||||
<< wrapText(QObject::tr("Specify whether the \"Add New Torrent\" dialog opens when adding a "
|
||||
"torrent.")) << '\n';
|
||||
stream << '\n';
|
||||
|
||||
@@ -577,7 +578,7 @@ QString makeUsage(const QString &prgName)
|
||||
void displayUsage(const QString &prgName)
|
||||
{
|
||||
#ifndef Q_OS_WIN
|
||||
std::cout << qPrintable(makeUsage(prgName)) << std::endl;
|
||||
printf("%s\n", qUtf8Printable(makeUsage(prgName)));
|
||||
#else
|
||||
QMessageBox msgBox(QMessageBox::Information, QObject::tr("Help"), makeUsage(prgName), QMessageBox::Ok);
|
||||
msgBox.show(); // Need to be shown or to moveToCenter does not work
|
||||
|
||||
@@ -135,7 +135,7 @@ void FileLogger::addLogMessage(const Log::Msg &msg)
|
||||
|
||||
str << QDateTime::fromMSecsSinceEpoch(msg.timestamp).toString(Qt::ISODate) << " - " << msg.message << endl;
|
||||
|
||||
if (m_backup && (m_logFile->size() >= (m_maxSize * 1024 * 1024))) {
|
||||
if (m_backup && (m_logFile->size() >= m_maxSize)) {
|
||||
closeLogFile();
|
||||
int counter = 0;
|
||||
QString backupLogFilename = m_path + ".bak";
|
||||
@@ -165,7 +165,7 @@ void FileLogger::openLogFile()
|
||||
|| !m_logFile->setPermissions(QFile::ReadOwner | QFile::WriteOwner)) {
|
||||
delete m_logFile;
|
||||
m_logFile = nullptr;
|
||||
Logger::instance()->addMessage(tr("An error occured while trying to open the log file. Logging to file is disabled."), Log::CRITICAL);
|
||||
Logger::instance()->addMessage(tr("An error occurred while trying to open the log file. Logging to file is disabled."), Log::CRITICAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QScopedPointer>
|
||||
#include <QThread>
|
||||
@@ -55,41 +57,42 @@ Q_IMPORT_PLUGIN(QICOPlugin)
|
||||
#endif
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#include <signal.h>
|
||||
#ifdef STACKTRACE
|
||||
#ifdef Q_OS_UNIX
|
||||
#include <signal.h>
|
||||
#include <execinfo.h>
|
||||
#include "stacktrace.h"
|
||||
#endif // Q_OS_UNIX
|
||||
|
||||
#ifdef STACKTRACE_WIN
|
||||
#include <signal.h>
|
||||
#else
|
||||
#include "stacktrace_win.h"
|
||||
#include "stacktrace_win_dlg.h"
|
||||
#endif //STACKTRACE_WIN
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#endif // Q_OS_UNIX
|
||||
#endif //STACKTRACE
|
||||
|
||||
#include "application.h"
|
||||
#include "base/profile.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/preferences.h"
|
||||
#include "cmdoptions.h"
|
||||
|
||||
#include "upgrade.h"
|
||||
|
||||
// Signal handlers
|
||||
#if defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
||||
void sigNormalHandler(int signum);
|
||||
#ifdef STACKTRACE
|
||||
void sigAbnormalHandler(int signum);
|
||||
#endif
|
||||
// sys_signame[] is only defined in BSD
|
||||
const char *sysSigName[] = {
|
||||
#if defined(Q_OS_WIN)
|
||||
"", "", "SIGINT", "", "SIGILL", "", "SIGABRT_COMPAT", "", "SIGFPE", "",
|
||||
"", "SIGSEGV", "", "", "", "SIGTERM", "", "", "", "",
|
||||
"", "SIGBREAK", "SIGABRT", "", "", "", "", "", "", "",
|
||||
"", ""
|
||||
#else
|
||||
"", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL",
|
||||
"SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP",
|
||||
"SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO",
|
||||
"SIGPWR", "SIGUNUSED"
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
void reportToUser(const char* str);
|
||||
@@ -162,7 +165,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Set environment variable
|
||||
if (!qputenv("QBITTORRENT", QBT_VERSION))
|
||||
std::cerr << "Couldn't set environment variable...\n";
|
||||
fprintf(stderr, "Couldn't set environment variable...\n");
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
if (!userAgreesWithLegalNotice())
|
||||
@@ -205,6 +208,10 @@ int main(int argc, char *argv[])
|
||||
// 3. https://bugreports.qt.io/browse/QTBUG-46015
|
||||
|
||||
qputenv("QT_BEARER_POLL_TIMEOUT", QByteArray::number(-1));
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
// this is the default in Qt6
|
||||
app->setAttribute(Qt::AA_DisableWindowContextHelpButton);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
@@ -214,7 +221,7 @@ int main(int argc, char *argv[])
|
||||
QByteArray path = "/usr/local/bin:";
|
||||
path += qgetenv("PATH");
|
||||
qputenv("PATH", path.constData());
|
||||
|
||||
|
||||
// On OS X the standard is to not show icons in the menus
|
||||
app->setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||
#endif
|
||||
@@ -246,9 +253,9 @@ int main(int argc, char *argv[])
|
||||
showSplashScreen();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
||||
signal(SIGINT, sigNormalHandler);
|
||||
signal(SIGTERM, sigNormalHandler);
|
||||
#ifdef STACKTRACE
|
||||
signal(SIGABRT, sigAbnormalHandler);
|
||||
signal(SIGSEGV, sigAbnormalHandler);
|
||||
#endif
|
||||
@@ -272,42 +279,44 @@ void reportToUser(const char* str)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
||||
void sigNormalHandler(int signum)
|
||||
{
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
const char str1[] = "Catching signal: ";
|
||||
const char *sigName = sysSigName[signum];
|
||||
const char str2[] = "\nExiting cleanly\n";
|
||||
reportToUser(str1);
|
||||
reportToUser(sigName);
|
||||
reportToUser(str2);
|
||||
const char msg1[] = "Catching signal: ";
|
||||
const char msg2[] = "\nExiting cleanly\n";
|
||||
reportToUser(msg1);
|
||||
reportToUser(sysSigName[signum]);
|
||||
reportToUser(msg2);
|
||||
#endif // !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
signal(signum, SIG_DFL);
|
||||
qApp->exit(); // unsafe, but exit anyway
|
||||
}
|
||||
|
||||
#ifdef STACKTRACE
|
||||
void sigAbnormalHandler(int signum)
|
||||
{
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
const char str1[] = "\n\n*************************************************************\nCatching signal: ";
|
||||
const char *sigName = sysSigName[signum];
|
||||
const char str2[] = "\nPlease file a bug report at http://bug.qbittorrent.org and provide the following information:\n\n"
|
||||
"qBittorrent version: " QBT_VERSION "\n";
|
||||
reportToUser(str1);
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
const char msg[] = "\n\n*************************************************************\n"
|
||||
"Please file a bug report at http://bug.qbittorrent.org and provide the following information:\n\n"
|
||||
"qBittorrent version: " QBT_VERSION "\n\n"
|
||||
"Caught signal: ";
|
||||
reportToUser(msg);
|
||||
reportToUser(sigName);
|
||||
reportToUser(str2);
|
||||
reportToUser("\n");
|
||||
print_stacktrace(); // unsafe
|
||||
#endif // !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
#ifdef STACKTRACE_WIN
|
||||
#endif
|
||||
|
||||
#if defined Q_OS_WIN
|
||||
StraceDlg dlg; // unsafe
|
||||
dlg.setStacktraceString(straceWin::getBacktrace());
|
||||
dlg.setStacktraceString(QLatin1String(sigName), straceWin::getBacktrace());
|
||||
dlg.exec();
|
||||
#endif // STACKTRACE_WIN
|
||||
#endif
|
||||
|
||||
signal(signum, SIG_DFL);
|
||||
raise(signum);
|
||||
}
|
||||
#endif // defined(Q_OS_UNIX) || defined(STACKTRACE_WIN)
|
||||
#endif // STACKTRACE
|
||||
|
||||
#if !defined(DISABLE_GUI)
|
||||
void showSplashScreen()
|
||||
@@ -327,7 +336,7 @@ void showSplashScreen()
|
||||
#if defined(Q_OS_UNIX)
|
||||
void setupDpi()
|
||||
{
|
||||
if (qgetenv("QT_AUTO_SCREEN_SCALE_FACTOR").isEmpty())
|
||||
if (qEnvironmentVariableIsEmpty("QT_AUTO_SCREEN_SCALE_FACTOR"))
|
||||
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
||||
}
|
||||
#endif // Q_OS_UNIX
|
||||
@@ -335,7 +344,7 @@ void setupDpi()
|
||||
|
||||
void displayVersion()
|
||||
{
|
||||
std::cout << qPrintable(qApp->applicationName()) << " " << QBT_VERSION << std::endl;
|
||||
printf("%s %s\n", qUtf8Printable(qApp->applicationName()), QBT_VERSION);
|
||||
}
|
||||
|
||||
void displayBadArgMessage(const QString& message)
|
||||
@@ -348,9 +357,10 @@ void displayBadArgMessage(const QString& message)
|
||||
msgBox.move(Utils::Misc::screenCenter(&msgBox));
|
||||
msgBox.exec();
|
||||
#else
|
||||
std::cerr << qPrintable(QObject::tr("Bad command line: "));
|
||||
std::cerr << qPrintable(message) << std::endl;
|
||||
std::cerr << qPrintable(help) << std::endl;
|
||||
const QString errMsg = QObject::tr("Bad command line: ") + '\n'
|
||||
+ message + '\n'
|
||||
+ help + '\n';
|
||||
fprintf(stderr, "%s", qUtf8Printable(errMsg));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -361,9 +371,12 @@ bool userAgreesWithLegalNotice()
|
||||
return true;
|
||||
|
||||
#ifdef DISABLE_GUI
|
||||
std::cout << std::endl << "*** " << qPrintable(QObject::tr("Legal Notice")) << " ***" << std::endl;
|
||||
std::cout << qPrintable(QObject::tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued.")) << std::endl << std::endl;
|
||||
std::cout << qPrintable(QObject::tr("Press %1 key to accept and continue...").arg("'y'")) << std::endl;
|
||||
const QString eula = QString("\n*** %1 ***\n").arg(QObject::tr("Legal Notice"))
|
||||
+ QObject::tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.") + "\n\n"
|
||||
+ QObject::tr("No further notices will be issued.") + "\n\n"
|
||||
+ QObject::tr("Press %1 key to accept and continue...").arg("'y'") + '\n';
|
||||
printf("%s", qUtf8Printable(eula));
|
||||
|
||||
char ret = getchar(); // Read pressed key
|
||||
if (ret == 'y' || ret == 'Y') {
|
||||
// Save the answer
|
||||
|
||||
@@ -16,7 +16,7 @@ else (GUI)
|
||||
list(APPEND QBT_QTSINGLEAPPLICATION_SOURCES qtsinglecoreapplication.cpp)
|
||||
endif (GUI)
|
||||
|
||||
add_library(qtsingleapplication ${QBT_QTSINGLEAPPLICATION_HEADERS} ${QBT_QTSINGLEAPPLICATION_SOURCES})
|
||||
add_library(qtsingleapplication STATIC ${QBT_QTSINGLEAPPLICATION_HEADERS} ${QBT_QTSINGLEAPPLICATION_SOURCES})
|
||||
target_include_directories(qtsingleapplication INTERFACE "${qtsingleapplication_SOURCE_DIR}")
|
||||
target_link_qt_components(qtsingleapplication Network)
|
||||
|
||||
|
||||
@@ -176,8 +176,17 @@ void QtLocalPeer::receiveConnection()
|
||||
if (!socket)
|
||||
return;
|
||||
|
||||
while (socket->bytesAvailable() < (int)sizeof(quint32))
|
||||
while (true) {
|
||||
if (socket->state() == QLocalSocket::UnconnectedState) {
|
||||
qWarning("QtLocalPeer: Peer disconnected");
|
||||
delete socket;
|
||||
return;
|
||||
}
|
||||
if (socket->bytesAvailable() >= qint64(sizeof(quint32)))
|
||||
break;
|
||||
socket->waitForReadyRead();
|
||||
}
|
||||
|
||||
QDataStream ds(socket);
|
||||
QByteArray uMsg;
|
||||
quint32 remaining;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
/** Print a demangled stack backtrace of the caller function to FILE* out. */
|
||||
static inline void print_stacktrace(FILE *out = stderr, unsigned int max_frames = 63)
|
||||
{
|
||||
fprintf(out, "stack trace:\n");
|
||||
fprintf(out, "Stack trace:\n");
|
||||
|
||||
// storage array for stack trace address data
|
||||
std::vector<void *> addrlist(max_frames + 1);
|
||||
|
||||
@@ -291,7 +291,7 @@ const QString straceWin::getBacktrace()
|
||||
demangle(funcName);
|
||||
#endif
|
||||
|
||||
// now ihsf.InstructionOffset points to the instruction that follows CALL instuction
|
||||
// now ihsf.InstructionOffset points to the instruction that follows CALL instruction
|
||||
// decrease the query address by one byte to point somewhere in the CALL instruction byte sequence
|
||||
sourceFile = getSourcePathAndLineNumber(hProcess, ihsf.InstructionOffset - 1);
|
||||
}
|
||||
|
||||
@@ -40,13 +40,13 @@ class StraceDlg : public QDialog, private Ui::errorDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
StraceDlg(QWidget* parent = 0)
|
||||
StraceDlg(QWidget *parent = nullptr)
|
||||
: QDialog(parent)
|
||||
{
|
||||
setupUi(this);
|
||||
}
|
||||
|
||||
void setStacktraceString(const QString& trace)
|
||||
void setStacktraceString(const QString &sigName, const QString &trace)
|
||||
{
|
||||
// try to call Qt function as less as possible
|
||||
QString htmlStr = QString(
|
||||
@@ -68,14 +68,16 @@ public:
|
||||
"Libtorrent version: %1<br/>"
|
||||
"Qt version: " QT_VERSION_STR "<br/>"
|
||||
"Boost version: %2<br/>"
|
||||
"OS version: %3"
|
||||
"</font></p><br/>"
|
||||
"<pre><code>%4</code></pre>"
|
||||
"OS version: %3<br/><br/>"
|
||||
"Caught signal: %4"
|
||||
"</font></p>"
|
||||
"<pre><code>%5</code></pre>"
|
||||
"<br/><hr><br/><br/>")
|
||||
.arg(Utils::Misc::libtorrentVersionString())
|
||||
.arg(Utils::Misc::boostVersionString())
|
||||
.arg(Utils::Misc::osName())
|
||||
.arg(trace);
|
||||
.arg(Utils::Misc::libtorrentVersionString())
|
||||
.arg(Utils::Misc::boostVersionString())
|
||||
.arg(Utils::Misc::osName())
|
||||
.arg(sigName)
|
||||
.arg(trace);
|
||||
|
||||
errorText->setHtml(htmlStr);
|
||||
}
|
||||
|
||||
@@ -61,10 +61,11 @@
|
||||
bool userAcceptsUpgrade()
|
||||
{
|
||||
#ifdef DISABLE_GUI
|
||||
std::cout << std::endl << "*** " << qPrintable(QObject::tr("Upgrade")) << " ***" << std::endl;
|
||||
printf("\n*** %s ***\n", qUtf8Printable(QObject::tr("Upgrade")));
|
||||
char ret = '\0';
|
||||
do {
|
||||
std::cout << qPrintable(QObject::tr("You updated from an older version that saved things differently. You must migrate to the new saving system. You will not be able to use an older version than v3.3.0 again. Continue? [y/n]")) << std::endl;
|
||||
printf("%s\n"
|
||||
, qUtf8Printable(QObject::tr("You updated from an older version that saved things differently. You must migrate to the new saving system. You will not be able to use an older version than v3.3.0 again. Continue? [y/n]")));
|
||||
ret = getchar(); // Read pressed key
|
||||
}
|
||||
while ((ret != 'y') && (ret != 'Y') && (ret != 'n') && (ret != 'N'));
|
||||
@@ -186,16 +187,17 @@ bool upgrade(bool ask = true)
|
||||
}
|
||||
}
|
||||
|
||||
foreach (const QString &hash, oldResumeData.keys()) {
|
||||
QVariantHash oldTorrent = oldResumeData[hash].toHash();
|
||||
for (auto i = oldResumeData.cbegin(); i != oldResumeData.cend(); ++i) {
|
||||
const QVariantHash oldTorrent = i.value().toHash();
|
||||
if (oldTorrent.value("is_magnet", false).toBool()) {
|
||||
const QString &hash = i.key();
|
||||
libtorrent::entry resumeData;
|
||||
resumeData["qBt-magnetUri"] = oldTorrent.value("magnet_uri").toString().toStdString();
|
||||
resumeData["qBt-paused"] = false;
|
||||
resumeData["qBt-forced"] = false;
|
||||
|
||||
resumeData["qBt-savePath"] = oldTorrent.value("save_path").toString().toStdString();
|
||||
resumeData["qBt-ratioLimit"] = QString::number(oldTorrent.value("max_ratio", -2).toReal()).toStdString();
|
||||
resumeData["qBt-ratioLimit"] = static_cast<int>(oldTorrent.value("max_ratio", -2).toReal() * 1000);
|
||||
resumeData["qBt-label"] = oldTorrent.value("label").toString().toStdString();
|
||||
resumeData["qBt-name"] = oldTorrent.value("name").toString().toStdString();
|
||||
resumeData["qBt-seedStatus"] = oldTorrent.value("seed").toBool();
|
||||
|
||||
@@ -19,6 +19,7 @@ bittorrent/torrentinfo.h
|
||||
bittorrent/tracker.h
|
||||
bittorrent/trackerentry.h
|
||||
http/connection.h
|
||||
http/httperror.h
|
||||
http/irequesthandler.h
|
||||
http/requestparser.h
|
||||
http/responsebuilder.h
|
||||
@@ -43,6 +44,10 @@ rss/rss_feed.h
|
||||
rss/rss_folder.h
|
||||
rss/rss_item.h
|
||||
rss/rss_session.h
|
||||
search/searchdownloadhandler.h
|
||||
search/searchhandler.h
|
||||
search/searchpluginmanager.h
|
||||
utils/bytearray.h
|
||||
utils/fs.h
|
||||
utils/gzip.h
|
||||
utils/misc.h
|
||||
@@ -50,7 +55,9 @@ utils/net.h
|
||||
utils/random.h
|
||||
utils/string.h
|
||||
utils/version.h
|
||||
algorithm.h
|
||||
asyncfilestorage.h
|
||||
exceptions.h
|
||||
filesystemwatcher.h
|
||||
global.h
|
||||
iconprovider.h
|
||||
@@ -59,7 +66,6 @@ logger.h
|
||||
preferences.h
|
||||
profile.h
|
||||
scanfoldersmodel.h
|
||||
searchengine.h
|
||||
settingsstorage.h
|
||||
torrentfileguard.h
|
||||
torrentfilter.h
|
||||
@@ -84,6 +90,7 @@ bittorrent/torrentinfo.cpp
|
||||
bittorrent/tracker.cpp
|
||||
bittorrent/trackerentry.cpp
|
||||
http/connection.cpp
|
||||
http/httperror.cpp
|
||||
http/requestparser.cpp
|
||||
http/responsebuilder.cpp
|
||||
http/responsegenerator.cpp
|
||||
@@ -106,6 +113,10 @@ rss/rss_feed.cpp
|
||||
rss/rss_folder.cpp
|
||||
rss/rss_item.cpp
|
||||
rss/rss_session.cpp
|
||||
search/searchdownloadhandler.cpp
|
||||
search/searchhandler.cpp
|
||||
search/searchpluginmanager.cpp
|
||||
utils/bytearray.cpp
|
||||
utils/fs.cpp
|
||||
utils/gzip.cpp
|
||||
utils/misc.cpp
|
||||
@@ -113,13 +124,13 @@ utils/net.cpp
|
||||
utils/random.cpp
|
||||
utils/string.cpp
|
||||
asyncfilestorage.cpp
|
||||
exceptions.cpp
|
||||
filesystemwatcher.cpp
|
||||
iconprovider.cpp
|
||||
logger.cpp
|
||||
preferences.cpp
|
||||
profile.cpp
|
||||
scanfoldersmodel.cpp
|
||||
searchengine.cpp
|
||||
settingsstorage.cpp
|
||||
torrentfileguard.cpp
|
||||
torrentfilter.cpp
|
||||
@@ -141,5 +152,6 @@ endif ()
|
||||
if (APPLE)
|
||||
find_library(IOKit_LIBRARY IOKit)
|
||||
find_library(Carbon_LIBRARY Carbon)
|
||||
target_link_libraries(qbt_base PRIVATE ${Carbon_LIBRARY} ${IOKit_LIBRARY})
|
||||
find_library(AppKit_LIBRARY AppKit)
|
||||
target_link_libraries(qbt_base PRIVATE ${Carbon_LIBRARY} ${IOKit_LIBRARY} ${AppKit_LIBRARY})
|
||||
endif (APPLE)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2014 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2018 Vladimir Golovnev <glassez@yandex.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -26,26 +26,16 @@
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#ifndef JSONUTILS_H
|
||||
#define JSONUTILS_H
|
||||
#pragma once
|
||||
|
||||
#include <QVariant>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonArray>
|
||||
|
||||
namespace json {
|
||||
|
||||
inline QByteArray toJson(const QVariant& var)
|
||||
namespace Dict
|
||||
{
|
||||
// To be used with QMap, QHash and it's variants
|
||||
template <typename Dictionary, typename BinaryPredicate>
|
||||
void removeIf(Dictionary &&dict, BinaryPredicate p)
|
||||
{
|
||||
return QJsonDocument::fromVariant(var).toJson(QJsonDocument::Compact);
|
||||
auto it = dict.begin();
|
||||
while (it != dict.end())
|
||||
it = (p(it.key(), it.value()) ? dict.erase(it) : it + 1);
|
||||
}
|
||||
|
||||
inline QVariant fromJson(const QString& json)
|
||||
{
|
||||
return QJsonDocument::fromJson(json.toUtf8()).toVariant();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // JSONUTILS_H
|
||||
@@ -1,124 +1,135 @@
|
||||
HEADERS += \
|
||||
$$PWD/algorithm.h \
|
||||
$$PWD/asyncfilestorage.h \
|
||||
$$PWD/types.h \
|
||||
$$PWD/tristatebool.h \
|
||||
$$PWD/bittorrent/addtorrentparams.h \
|
||||
$$PWD/bittorrent/cachestatus.h \
|
||||
$$PWD/bittorrent/infohash.h \
|
||||
$$PWD/bittorrent/magneturi.h \
|
||||
$$PWD/bittorrent/peerinfo.h \
|
||||
$$PWD/bittorrent/private/bandwidthscheduler.h \
|
||||
$$PWD/bittorrent/private/filterparserthread.h \
|
||||
$$PWD/bittorrent/private/resumedatasavingmanager.h \
|
||||
$$PWD/bittorrent/private/speedmonitor.h \
|
||||
$$PWD/bittorrent/private/statistics.h \
|
||||
$$PWD/bittorrent/session.h \
|
||||
$$PWD/bittorrent/sessionstatus.h \
|
||||
$$PWD/bittorrent/torrentcreatorthread.h \
|
||||
$$PWD/bittorrent/torrenthandle.h \
|
||||
$$PWD/bittorrent/torrentinfo.h \
|
||||
$$PWD/bittorrent/tracker.h \
|
||||
$$PWD/bittorrent/trackerentry.h \
|
||||
$$PWD/exceptions.h \
|
||||
$$PWD/filesystemwatcher.h \
|
||||
$$PWD/logger.h \
|
||||
$$PWD/settingsstorage.h \
|
||||
$$PWD/settingvalue.h \
|
||||
$$PWD/preferences.h \
|
||||
$$PWD/indexrange.h \
|
||||
$$PWD/iconprovider.h \
|
||||
$$PWD/http/irequesthandler.h \
|
||||
$$PWD/global.h \
|
||||
$$PWD/http/connection.h \
|
||||
$$PWD/http/httperror.h \
|
||||
$$PWD/http/irequesthandler.h \
|
||||
$$PWD/http/requestparser.h \
|
||||
$$PWD/http/responsebuilder.h \
|
||||
$$PWD/http/responsegenerator.h \
|
||||
$$PWD/http/server.h \
|
||||
$$PWD/http/types.h \
|
||||
$$PWD/http/responsebuilder.h \
|
||||
$$PWD/iconprovider.h \
|
||||
$$PWD/indexrange.h \
|
||||
$$PWD/logger.h \
|
||||
$$PWD/net/dnsupdater.h \
|
||||
$$PWD/net/downloadmanager.h \
|
||||
$$PWD/net/downloadhandler.h \
|
||||
$$PWD/net/downloadmanager.h \
|
||||
$$PWD/net/geoipmanager.h \
|
||||
$$PWD/net/portforwarder.h \
|
||||
$$PWD/net/private/geoipdatabase.h \
|
||||
$$PWD/net/proxyconfigurationmanager.h \
|
||||
$$PWD/net/reverseresolution.h \
|
||||
$$PWD/net/smtp.h \
|
||||
$$PWD/net/private/geoipdatabase.h \
|
||||
$$PWD/bittorrent/addtorrentparams.h \
|
||||
$$PWD/bittorrent/infohash.h \
|
||||
$$PWD/bittorrent/session.h \
|
||||
$$PWD/bittorrent/sessionstatus.h \
|
||||
$$PWD/bittorrent/cachestatus.h \
|
||||
$$PWD/bittorrent/magneturi.h \
|
||||
$$PWD/bittorrent/torrentinfo.h \
|
||||
$$PWD/bittorrent/torrenthandle.h \
|
||||
$$PWD/bittorrent/peerinfo.h \
|
||||
$$PWD/bittorrent/trackerentry.h \
|
||||
$$PWD/bittorrent/tracker.h \
|
||||
$$PWD/bittorrent/torrentcreatorthread.h \
|
||||
$$PWD/bittorrent/private/speedmonitor.h \
|
||||
$$PWD/bittorrent/private/bandwidthscheduler.h \
|
||||
$$PWD/bittorrent/private/filterparserthread.h \
|
||||
$$PWD/bittorrent/private/statistics.h \
|
||||
$$PWD/bittorrent/private/resumedatasavingmanager.h \
|
||||
$$PWD/preferences.h \
|
||||
$$PWD/private/profile_p.h \
|
||||
$$PWD/profile.h \
|
||||
$$PWD/rss/private/rss_parser.h \
|
||||
$$PWD/rss/rss_article.h \
|
||||
$$PWD/rss/rss_item.h \
|
||||
$$PWD/rss/rss_feed.h \
|
||||
$$PWD/rss/rss_folder.h \
|
||||
$$PWD/rss/rss_session.h \
|
||||
$$PWD/rss/rss_autodownloader.h \
|
||||
$$PWD/rss/rss_autodownloadrule.h \
|
||||
$$PWD/rss/private/rss_parser.h \
|
||||
$$PWD/rss/rss_feed.h \
|
||||
$$PWD/rss/rss_folder.h \
|
||||
$$PWD/rss/rss_item.h \
|
||||
$$PWD/rss/rss_session.h \
|
||||
$$PWD/scanfoldersmodel.h \
|
||||
$$PWD/search/searchhandler.h \
|
||||
$$PWD/search/searchdownloadhandler.h \
|
||||
$$PWD/search/searchpluginmanager.h \
|
||||
$$PWD/settingsstorage.h \
|
||||
$$PWD/settingvalue.h \
|
||||
$$PWD/torrentfileguard.h \
|
||||
$$PWD/torrentfilter.h \
|
||||
$$PWD/tristatebool.h \
|
||||
$$PWD/types.h \
|
||||
$$PWD/unicodestrings.h \
|
||||
$$PWD/utils/bytearray.h \
|
||||
$$PWD/utils/fs.h \
|
||||
$$PWD/utils/gzip.h \
|
||||
$$PWD/utils/misc.h \
|
||||
$$PWD/utils/net.h \
|
||||
$$PWD/utils/random.h \
|
||||
$$PWD/utils/string.h \
|
||||
$$PWD/utils/version.h \
|
||||
$$PWD/profile.h \
|
||||
$$PWD/private/profile_p.h \
|
||||
$$PWD/unicodestrings.h \
|
||||
$$PWD/torrentfileguard.h \
|
||||
$$PWD/torrentfilter.h \
|
||||
$$PWD/scanfoldersmodel.h \
|
||||
$$PWD/searchengine.h \
|
||||
$$PWD/global.h
|
||||
$$PWD/utils/version.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/asyncfilestorage.cpp \
|
||||
$$PWD/tristatebool.cpp \
|
||||
$$PWD/bittorrent/infohash.cpp \
|
||||
$$PWD/bittorrent/magneturi.cpp \
|
||||
$$PWD/bittorrent/peerinfo.cpp \
|
||||
$$PWD/bittorrent/private/bandwidthscheduler.cpp \
|
||||
$$PWD/bittorrent/private/filterparserthread.cpp \
|
||||
$$PWD/bittorrent/private/resumedatasavingmanager.cpp \
|
||||
$$PWD/bittorrent/private/speedmonitor.cpp \
|
||||
$$PWD/bittorrent/private/statistics.cpp \
|
||||
$$PWD/bittorrent/session.cpp \
|
||||
$$PWD/bittorrent/torrentcreatorthread.cpp \
|
||||
$$PWD/bittorrent/torrenthandle.cpp \
|
||||
$$PWD/bittorrent/torrentinfo.cpp \
|
||||
$$PWD/bittorrent/tracker.cpp \
|
||||
$$PWD/bittorrent/trackerentry.cpp \
|
||||
$$PWD/exceptions.cpp \
|
||||
$$PWD/filesystemwatcher.cpp \
|
||||
$$PWD/logger.cpp \
|
||||
$$PWD/settingsstorage.cpp \
|
||||
$$PWD/preferences.cpp \
|
||||
$$PWD/iconprovider.cpp \
|
||||
$$PWD/http/connection.cpp \
|
||||
$$PWD/http/httperror.cpp \
|
||||
$$PWD/http/requestparser.cpp \
|
||||
$$PWD/http/responsebuilder.cpp \
|
||||
$$PWD/http/responsegenerator.cpp \
|
||||
$$PWD/http/server.cpp \
|
||||
$$PWD/http/responsebuilder.cpp \
|
||||
$$PWD/iconprovider.cpp \
|
||||
$$PWD/logger.cpp \
|
||||
$$PWD/net/dnsupdater.cpp \
|
||||
$$PWD/net/downloadmanager.cpp \
|
||||
$$PWD/net/downloadhandler.cpp \
|
||||
$$PWD/net/downloadmanager.cpp \
|
||||
$$PWD/net/geoipmanager.cpp \
|
||||
$$PWD/net/portforwarder.cpp \
|
||||
$$PWD/net/private/geoipdatabase.cpp \
|
||||
$$PWD/net/proxyconfigurationmanager.cpp \
|
||||
$$PWD/net/reverseresolution.cpp \
|
||||
$$PWD/net/smtp.cpp \
|
||||
$$PWD/net/private/geoipdatabase.cpp \
|
||||
$$PWD/bittorrent/infohash.cpp \
|
||||
$$PWD/bittorrent/session.cpp \
|
||||
$$PWD/bittorrent/magneturi.cpp \
|
||||
$$PWD/bittorrent/torrentinfo.cpp \
|
||||
$$PWD/bittorrent/torrenthandle.cpp \
|
||||
$$PWD/bittorrent/peerinfo.cpp \
|
||||
$$PWD/bittorrent/trackerentry.cpp \
|
||||
$$PWD/bittorrent/tracker.cpp \
|
||||
$$PWD/bittorrent/torrentcreatorthread.cpp \
|
||||
$$PWD/bittorrent/private/speedmonitor.cpp \
|
||||
$$PWD/bittorrent/private/bandwidthscheduler.cpp \
|
||||
$$PWD/bittorrent/private/filterparserthread.cpp \
|
||||
$$PWD/bittorrent/private/statistics.cpp \
|
||||
$$PWD/bittorrent/private/resumedatasavingmanager.cpp \
|
||||
$$PWD/preferences.cpp \
|
||||
$$PWD/private/profile_p.cpp \
|
||||
$$PWD/profile.cpp \
|
||||
$$PWD/rss/private/rss_parser.cpp \
|
||||
$$PWD/rss/rss_article.cpp \
|
||||
$$PWD/rss/rss_item.cpp \
|
||||
$$PWD/rss/rss_feed.cpp \
|
||||
$$PWD/rss/rss_folder.cpp \
|
||||
$$PWD/rss/rss_session.cpp \
|
||||
$$PWD/rss/rss_autodownloader.cpp \
|
||||
$$PWD/rss/rss_autodownloadrule.cpp \
|
||||
$$PWD/rss/private/rss_parser.cpp \
|
||||
$$PWD/rss/rss_feed.cpp \
|
||||
$$PWD/rss/rss_folder.cpp \
|
||||
$$PWD/rss/rss_item.cpp \
|
||||
$$PWD/rss/rss_session.cpp \
|
||||
$$PWD/scanfoldersmodel.cpp \
|
||||
$$PWD/search/searchdownloadhandler.cpp \
|
||||
$$PWD/search/searchhandler.cpp \
|
||||
$$PWD/search/searchpluginmanager.cpp \
|
||||
$$PWD/settingsstorage.cpp \
|
||||
$$PWD/torrentfileguard.cpp \
|
||||
$$PWD/torrentfilter.cpp \
|
||||
$$PWD/tristatebool.cpp \
|
||||
$$PWD/utils/bytearray.cpp \
|
||||
$$PWD/utils/fs.cpp \
|
||||
$$PWD/utils/gzip.cpp \
|
||||
$$PWD/utils/misc.cpp \
|
||||
$$PWD/utils/net.cpp \
|
||||
$$PWD/utils/random.cpp \
|
||||
$$PWD/utils/string.cpp \
|
||||
$$PWD/profile.cpp \
|
||||
$$PWD/private/profile_p.cpp \
|
||||
$$PWD/torrentfileguard.cpp \
|
||||
$$PWD/torrentfilter.cpp \
|
||||
$$PWD/scanfoldersmodel.cpp \
|
||||
$$PWD/searchengine.cpp
|
||||
$$PWD/utils/string.cpp
|
||||
|
||||
@@ -51,5 +51,8 @@ namespace BitTorrent
|
||||
bool ignoreShareLimits = false;
|
||||
bool skipChecking = false;
|
||||
TriStateBool createSubfolder;
|
||||
TriStateBool useAutoTMM;
|
||||
int uploadLimit = -1;
|
||||
int downloadLimit = -1;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ bool InfoHash::operator!=(const InfoHash &other) const
|
||||
return (m_nativeHash != other.m_nativeHash);
|
||||
}
|
||||
|
||||
uint qHash(const InfoHash &key, uint seed)
|
||||
uint BitTorrent::qHash(const InfoHash &key, uint seed)
|
||||
{
|
||||
return qHash(static_cast<QString>(key), seed);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#ifndef BITTORRENT_INFOHASH_H
|
||||
#define BITTORRENT_INFOHASH_H
|
||||
|
||||
#include <libtorrent/sha1_hash.hpp>
|
||||
#include <QString>
|
||||
#include <libtorrent/sha1_hash.hpp>
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
@@ -54,8 +54,8 @@ namespace BitTorrent
|
||||
libtorrent::sha1_hash m_nativeHash;
|
||||
QString m_hashString;
|
||||
};
|
||||
|
||||
uint qHash(const InfoHash &key, uint seed);
|
||||
}
|
||||
|
||||
uint qHash(const BitTorrent::InfoHash &key, uint seed);
|
||||
|
||||
#endif // BITTORRENT_INFOHASH_H
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
#ifndef BITTORRENT_MAGNETURI_H
|
||||
#define BITTORRENT_MAGNETURI_H
|
||||
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
#include <libtorrent/add_torrent_params.hpp>
|
||||
|
||||
@@ -26,12 +26,13 @@
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include "base/net/geoipmanager.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "base/unicodestrings.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "peerinfo.h"
|
||||
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/net/geoipmanager.h"
|
||||
#include "base/unicodestrings.h"
|
||||
#include "base/utils/string.h"
|
||||
|
||||
namespace libt = libtorrent;
|
||||
using namespace BitTorrent;
|
||||
|
||||
@@ -99,7 +100,6 @@ bool PeerInfo::isRemoteChocked() const
|
||||
return (m_nativeInfo.flags & libt::peer_info::remote_choked);
|
||||
}
|
||||
|
||||
|
||||
bool PeerInfo::isSupportsExtensions() const
|
||||
{
|
||||
return (m_nativeInfo.flags & libt::peer_info::supports_extensions);
|
||||
@@ -115,7 +115,6 @@ bool PeerInfo::isHandshake() const
|
||||
return (m_nativeInfo.flags & libt::peer_info::handshake);
|
||||
}
|
||||
|
||||
|
||||
bool PeerInfo::isConnecting() const
|
||||
{
|
||||
return (m_nativeInfo.flags & libt::peer_info::connecting);
|
||||
@@ -136,7 +135,6 @@ bool PeerInfo::optimisticUnchoke() const
|
||||
return (m_nativeInfo.flags & libt::peer_info::optimistic_unchoke);
|
||||
}
|
||||
|
||||
|
||||
bool PeerInfo::isSnubbed() const
|
||||
{
|
||||
return (m_nativeInfo.flags & libt::peer_info::snubbed);
|
||||
@@ -152,7 +150,6 @@ bool PeerInfo::isEndgameMode() const
|
||||
return (m_nativeInfo.flags & libt::peer_info::endgame_mode);
|
||||
}
|
||||
|
||||
|
||||
bool PeerInfo::isHolepunched() const
|
||||
{
|
||||
return (m_nativeInfo.flags & libt::peer_info::holepunched);
|
||||
@@ -183,7 +180,6 @@ bool PeerInfo::isPlaintextEncrypted() const
|
||||
return (m_nativeInfo.flags & libt::peer_info::plaintext_encrypted);
|
||||
}
|
||||
|
||||
|
||||
PeerAddress PeerInfo::address() const
|
||||
{
|
||||
return PeerAddress(QHostAddress(QString::fromStdString(m_nativeInfo.ip.address().to_string())),
|
||||
@@ -195,7 +191,6 @@ QString PeerInfo::client() const
|
||||
return QString::fromStdString(m_nativeInfo.client);
|
||||
}
|
||||
|
||||
|
||||
qreal PeerInfo::progress() const
|
||||
{
|
||||
return m_nativeInfo.progress;
|
||||
@@ -206,7 +201,6 @@ int PeerInfo::payloadUpSpeed() const
|
||||
return m_nativeInfo.payload_up_speed;
|
||||
}
|
||||
|
||||
|
||||
int PeerInfo::payloadDownSpeed() const
|
||||
{
|
||||
return m_nativeInfo.payload_down_speed;
|
||||
@@ -217,7 +211,6 @@ qlonglong PeerInfo::totalUpload() const
|
||||
return m_nativeInfo.total_upload;
|
||||
}
|
||||
|
||||
|
||||
qlonglong PeerInfo::totalDownload() const
|
||||
{
|
||||
return m_nativeInfo.total_download;
|
||||
@@ -239,7 +232,7 @@ QString PeerInfo::connectionType() const
|
||||
return QString::fromUtf8(C_UTP);
|
||||
|
||||
QString connection;
|
||||
switch(m_nativeInfo.connection_type) {
|
||||
switch (m_nativeInfo.connection_type) {
|
||||
case libt::peer_info::http_seed:
|
||||
case libt::peer_info::web_seed:
|
||||
connection = "Web";
|
||||
@@ -280,117 +273,116 @@ qreal PeerInfo::relevance() const
|
||||
|
||||
void PeerInfo::determineFlags()
|
||||
{
|
||||
QStringList flagsDescriptionList;
|
||||
|
||||
if (isInteresting()) {
|
||||
//d = Your client wants to download, but peer doesn't want to send (interested and choked)
|
||||
// d = Your client wants to download, but peer doesn't want to send (interested and choked)
|
||||
if (isRemoteChocked()) {
|
||||
m_flags += "d ";
|
||||
m_flagsDescription += tr("interested(local) and choked(peer)");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "d = "
|
||||
+ tr("Interested(local) and Choked(peer)");
|
||||
}
|
||||
else {
|
||||
//D = Currently downloading (interested and not choked)
|
||||
// D = Currently downloading (interested and not choked)
|
||||
m_flags += "D ";
|
||||
m_flagsDescription += tr("interested(local) and unchoked(peer)");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "D = "
|
||||
+ tr("interested(local) and unchoked(peer)");
|
||||
}
|
||||
}
|
||||
|
||||
if (isRemoteInterested()) {
|
||||
//u = Peer wants your client to upload, but your client doesn't want to (interested and choked)
|
||||
// u = Peer wants your client to upload, but your client doesn't want to (interested and choked)
|
||||
if (isChocked()) {
|
||||
m_flags += "u ";
|
||||
m_flagsDescription += tr("interested(peer) and choked(local)");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "u = "
|
||||
+ tr("interested(peer) and choked(local)");
|
||||
}
|
||||
else {
|
||||
//U = Currently uploading (interested and not choked)
|
||||
// U = Currently uploading (interested and not choked)
|
||||
m_flags += "U ";
|
||||
m_flagsDescription += tr("interested(peer) and unchoked(local)");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "U = "
|
||||
+ tr("interested(peer) and unchoked(local)");
|
||||
}
|
||||
}
|
||||
|
||||
//O = Optimistic unchoke
|
||||
// O = Optimistic unchoke
|
||||
if (optimisticUnchoke()) {
|
||||
m_flags += "O ";
|
||||
m_flagsDescription += tr("optimistic unchoke");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "O = "
|
||||
+ tr("optimistic unchoke");
|
||||
}
|
||||
|
||||
//S = Peer is snubbed
|
||||
// S = Peer is snubbed
|
||||
if (isSnubbed()) {
|
||||
m_flags += "S ";
|
||||
m_flagsDescription += tr("peer snubbed");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "S = "
|
||||
+ tr("peer snubbed");
|
||||
}
|
||||
|
||||
//I = Peer is an incoming connection
|
||||
// I = Peer is an incoming connection
|
||||
if (!isLocalConnection()) {
|
||||
m_flags += "I ";
|
||||
m_flagsDescription += tr("incoming connection");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "I = "
|
||||
+ tr("incoming connection");
|
||||
}
|
||||
|
||||
//K = Peer is unchoking your client, but your client is not interested
|
||||
// K = Peer is unchoking your client, but your client is not interested
|
||||
if (!isRemoteChocked() && !isInteresting()) {
|
||||
m_flags += "K ";
|
||||
m_flagsDescription += tr("not interested(local) and unchoked(peer)");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "K = "
|
||||
+ tr("not interested(local) and unchoked(peer)");
|
||||
}
|
||||
|
||||
//? = Your client unchoked the peer but the peer is not interested
|
||||
// ? = Your client unchoked the peer but the peer is not interested
|
||||
if (!isChocked() && !isRemoteInterested()) {
|
||||
m_flags += "? ";
|
||||
m_flagsDescription += tr("not interested(peer) and unchoked(local)");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "? = "
|
||||
+ tr("not interested(peer) and unchoked(local)");
|
||||
}
|
||||
|
||||
//X = Peer was included in peerlists obtained through Peer Exchange (PEX)
|
||||
// X = Peer was included in peerlists obtained through Peer Exchange (PEX)
|
||||
if (fromPeX()) {
|
||||
m_flags += "X ";
|
||||
m_flagsDescription += tr("peer from PEX");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "X = "
|
||||
+ tr("peer from PEX");
|
||||
}
|
||||
|
||||
//H = Peer was obtained through DHT
|
||||
// H = Peer was obtained through DHT
|
||||
if (fromDHT()) {
|
||||
m_flags += "H ";
|
||||
m_flagsDescription += tr("peer from DHT");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "H = "
|
||||
+ tr("peer from DHT");
|
||||
}
|
||||
|
||||
//E = Peer is using Protocol Encryption (all traffic)
|
||||
// E = Peer is using Protocol Encryption (all traffic)
|
||||
if (isRC4Encrypted()) {
|
||||
m_flags += "E ";
|
||||
m_flagsDescription += tr("encrypted traffic");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "E = "
|
||||
+ tr("encrypted traffic");
|
||||
}
|
||||
|
||||
//e = Peer is using Protocol Encryption (handshake)
|
||||
// e = Peer is using Protocol Encryption (handshake)
|
||||
if (isPlaintextEncrypted()) {
|
||||
m_flags += "e ";
|
||||
m_flagsDescription += tr("encrypted handshake");
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "e = "
|
||||
+ tr("encrypted handshake");
|
||||
}
|
||||
|
||||
//P = Peer is using uTorrent uTP
|
||||
|
||||
// P = Peer is using uTorrent uTP
|
||||
if (useUTPSocket()) {
|
||||
m_flags += "P ";
|
||||
m_flagsDescription += QString::fromUtf8(C_UTP);
|
||||
m_flagsDescription += ", ";
|
||||
flagsDescriptionList += "P = "
|
||||
+ QString::fromUtf8(C_UTP);
|
||||
}
|
||||
|
||||
//L = Peer is local
|
||||
// L = Peer is local
|
||||
if (fromLSD()) {
|
||||
m_flags += "L";
|
||||
m_flagsDescription += tr("peer from LSD");
|
||||
flagsDescriptionList += "L = "
|
||||
+ tr("peer from LSD");
|
||||
}
|
||||
|
||||
m_flags = m_flags.trimmed();
|
||||
m_flagsDescription = m_flagsDescription.trimmed();
|
||||
if (m_flagsDescription.endsWith(',', Qt::CaseInsensitive))
|
||||
m_flagsDescription.chop(1);
|
||||
m_flagsDescription = flagsDescriptionList.join('\n');
|
||||
}
|
||||
|
||||
QString PeerInfo::flags() const
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
#ifndef BITTORRENT_PEERINFO_H
|
||||
#define BITTORRENT_PEERINFO_H
|
||||
|
||||
#include <libtorrent/peer_info.hpp>
|
||||
|
||||
#include <QHostAddress>
|
||||
#include <QBitArray>
|
||||
#include <QCoreApplication>
|
||||
#include <QHostAddress>
|
||||
|
||||
#include <libtorrent/peer_info.hpp>
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2010 Christophe Dumez
|
||||
* Copyright (C) 2017 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2010 Christophe Dumez <chris@qbittorrent.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -24,72 +25,78 @@
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#include <QTime>
|
||||
#include <QDateTime>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/preferences.h"
|
||||
#include "bandwidthscheduler.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <QDate>
|
||||
#include <QTime>
|
||||
|
||||
#include "base/preferences.h"
|
||||
|
||||
BandwidthScheduler::BandwidthScheduler(QObject *parent)
|
||||
: QTimer(parent)
|
||||
: QObject(parent)
|
||||
, m_lastAlternative(false)
|
||||
{
|
||||
// Single shot, we call start() again manually
|
||||
setSingleShot(true);
|
||||
// Connect Signals/Slots
|
||||
connect(this, SIGNAL(timeout()), this, SLOT(start()));
|
||||
connect(&m_timer, &QTimer::timeout, this, &BandwidthScheduler::onTimeout);
|
||||
}
|
||||
|
||||
void BandwidthScheduler::start()
|
||||
{
|
||||
const Preferences* const pref = Preferences::instance();
|
||||
bool alt_bw_enabled = BitTorrent::Session::instance()->isAltGlobalSpeedLimitEnabled();
|
||||
|
||||
QTime start = pref->getSchedulerStartTime();
|
||||
QTime end = pref->getSchedulerEndTime();
|
||||
QTime now = QTime::currentTime();
|
||||
int sched_days = pref->getSchedulerDays();
|
||||
int day = QDateTime::currentDateTime().toLocalTime().date().dayOfWeek();
|
||||
bool new_mode = false;
|
||||
bool reverse = false;
|
||||
|
||||
if (start > end) {
|
||||
QTime temp = start;
|
||||
start = end;
|
||||
end = temp;
|
||||
reverse = true;
|
||||
}
|
||||
|
||||
if ((start <= now) && (end >= now)) {
|
||||
switch(sched_days) {
|
||||
case EVERY_DAY:
|
||||
new_mode = true;
|
||||
break;
|
||||
case WEEK_ENDS:
|
||||
if ((day == 6) || (day == 7))
|
||||
new_mode = true;
|
||||
break;
|
||||
case WEEK_DAYS:
|
||||
if ((day != 6) && (day != 7))
|
||||
new_mode = true;
|
||||
break;
|
||||
default:
|
||||
if (day == (sched_days - 2))
|
||||
new_mode = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (reverse)
|
||||
new_mode = !new_mode;
|
||||
|
||||
if (new_mode != alt_bw_enabled)
|
||||
emit switchToAlternativeMode(new_mode);
|
||||
m_lastAlternative = isTimeForAlternative();
|
||||
emit bandwidthLimitRequested(m_lastAlternative);
|
||||
|
||||
// Timeout regularly to accommodate for external system clock changes
|
||||
// eg from the user or from a timesync utility
|
||||
QTimer::start(1500);
|
||||
m_timer.start(30000);
|
||||
}
|
||||
|
||||
bool BandwidthScheduler::isTimeForAlternative() const
|
||||
{
|
||||
const Preferences* const pref = Preferences::instance();
|
||||
|
||||
QTime start = pref->getSchedulerStartTime();
|
||||
QTime end = pref->getSchedulerEndTime();
|
||||
const QTime now = QTime::currentTime();
|
||||
const int schedulerDays = pref->getSchedulerDays();
|
||||
const int day = QDate::currentDate().dayOfWeek();
|
||||
bool alternative = false;
|
||||
|
||||
if (start > end) {
|
||||
std::swap(start, end);
|
||||
alternative = true;
|
||||
}
|
||||
|
||||
if ((start <= now) && (end >= now)) {
|
||||
switch (schedulerDays) {
|
||||
case EVERY_DAY:
|
||||
alternative = !alternative;
|
||||
break;
|
||||
case WEEK_ENDS:
|
||||
if ((day == 6) || (day == 7))
|
||||
alternative = !alternative;
|
||||
break;
|
||||
case WEEK_DAYS:
|
||||
if ((day != 6) && (day != 7))
|
||||
alternative = !alternative;
|
||||
break;
|
||||
default:
|
||||
if (day == (schedulerDays - 2))
|
||||
alternative = !alternative;
|
||||
}
|
||||
}
|
||||
|
||||
return alternative;
|
||||
}
|
||||
|
||||
void BandwidthScheduler::onTimeout()
|
||||
{
|
||||
bool alternative = isTimeForAlternative();
|
||||
|
||||
if (alternative != m_lastAlternative) {
|
||||
m_lastAlternative = alternative;
|
||||
emit bandwidthLimitRequested(alternative);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2010 Christophe Dumez
|
||||
* Copyright (C) 2017 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2010 Christophe Dumez <chris@qbittorrent.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -24,27 +25,32 @@
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#ifndef BANDWIDTHSCHEDULER_H
|
||||
#define BANDWIDTHSCHEDULER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
class BandwidthScheduler : public QTimer
|
||||
class BandwidthScheduler: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(BandwidthScheduler)
|
||||
|
||||
public:
|
||||
BandwidthScheduler(QObject *parent = 0);
|
||||
|
||||
public slots:
|
||||
explicit BandwidthScheduler(QObject *parent = nullptr);
|
||||
void start();
|
||||
|
||||
signals:
|
||||
void switchToAlternativeMode(bool alternative);
|
||||
void bandwidthLimitRequested(bool alternative);
|
||||
|
||||
private:
|
||||
bool isTimeForAlternative() const;
|
||||
void onTimeout();
|
||||
|
||||
QTimer m_timer;
|
||||
bool m_lastAlternative;
|
||||
};
|
||||
|
||||
#endif // BANDWIDTHSCHEDULER_H
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libt.
|
||||
* Copyright (C) 2006 Christophe Dumez
|
||||
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -24,17 +24,15 @@
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#include "filterparserthread.h"
|
||||
|
||||
#include <cctype>
|
||||
|
||||
#include <QDataStream>
|
||||
#include <QFile>
|
||||
|
||||
#include <cctype>
|
||||
|
||||
#include "base/logger.h"
|
||||
|
||||
namespace libt = libtorrent;
|
||||
@@ -104,6 +102,7 @@ namespace
|
||||
}
|
||||
|
||||
const int BUFFER_SIZE = 2 * 1024 * 1024; // 2 MiB
|
||||
const int MAX_LOGGED_ERRORS = 5;
|
||||
}
|
||||
|
||||
FilterParserThread::FilterParserThread(QObject *parent)
|
||||
@@ -126,7 +125,7 @@ int FilterParserThread::parseDATFilterFile()
|
||||
if (!file.exists()) return ruleCount;
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
LogMsg(tr("I/O Error: Could not open ip filter file in read mode."), Log::CRITICAL);
|
||||
LogMsg(tr("I/O Error: Could not open IP filter file in read mode."), Log::CRITICAL);
|
||||
return ruleCount;
|
||||
}
|
||||
|
||||
@@ -136,6 +135,12 @@ int FilterParserThread::parseDATFilterFile()
|
||||
int start = 0;
|
||||
int endOfLine = -1;
|
||||
int nbLine = 0;
|
||||
int parseErrorCount = 0;
|
||||
const auto addLog = [&parseErrorCount](const QString &msg)
|
||||
{
|
||||
if (parseErrorCount <= MAX_LOGGED_ERRORS)
|
||||
LogMsg(msg, Log::CRITICAL);
|
||||
};
|
||||
|
||||
while (true) {
|
||||
bytesRead = file.read(buffer.data() + offset, BUFFER_SIZE - offset - 1);
|
||||
@@ -204,7 +209,8 @@ int FilterParserThread::parseDATFilterFile()
|
||||
int endOfIPRange = ((firstComma == -1) ? (endOfLine - 1) : (firstComma - 1));
|
||||
int delimIP = findAndNullDelimiter(buffer.data(), '-', start, endOfIPRange);
|
||||
if (delimIP == -1) {
|
||||
LogMsg(tr("IP filter line %1 is malformed.").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed.").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
@@ -212,7 +218,8 @@ int FilterParserThread::parseDATFilterFile()
|
||||
libt::address startAddr;
|
||||
int newStart = trim(buffer.data(), start, delimIP - 1);
|
||||
if (!parseIPAddress(buffer.data() + newStart, startAddr)) {
|
||||
LogMsg(tr("IP filter line %1 is malformed. Start IP of the range is malformed.").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed. Start IP of the range is malformed.").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
@@ -220,14 +227,16 @@ int FilterParserThread::parseDATFilterFile()
|
||||
libt::address endAddr;
|
||||
newStart = trim(buffer.data(), delimIP + 1, endOfIPRange);
|
||||
if (!parseIPAddress(buffer.data() + newStart, endAddr)) {
|
||||
LogMsg(tr("IP filter line %1 is malformed. End IP of the range is malformed.").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed. End IP of the range is malformed.").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((startAddr.is_v4() != endAddr.is_v4())
|
||||
|| (startAddr.is_v6() != endAddr.is_v6())) {
|
||||
LogMsg(tr("IP filter line %1 is malformed. One IP is IPv4 and the other is IPv6!").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed. One IP is IPv4 and the other is IPv6!").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
@@ -240,8 +249,9 @@ int FilterParserThread::parseDATFilterFile()
|
||||
++ruleCount;
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
LogMsg(tr("IP filter exception thrown for line %1. Exception is: %2").arg(nbLine)
|
||||
.arg(QString::fromLocal8Bit(e.what())), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter exception thrown for line %1. Exception is: %2")
|
||||
.arg(nbLine).arg(QString::fromLocal8Bit(e.what())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,6 +259,9 @@ int FilterParserThread::parseDATFilterFile()
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
if (parseErrorCount > MAX_LOGGED_ERRORS)
|
||||
LogMsg(tr("%1 extra IP filter parsing errors occurred.", "513 extra IP filter parsing errors occurred.")
|
||||
.arg(parseErrorCount - MAX_LOGGED_ERRORS), Log::CRITICAL);
|
||||
return ruleCount;
|
||||
}
|
||||
|
||||
@@ -260,7 +273,7 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
if (!file.exists()) return ruleCount;
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
LogMsg(tr("I/O Error: Could not open ip filter file in read mode."), Log::CRITICAL);
|
||||
LogMsg(tr("I/O Error: Could not open IP filter file in read mode."), Log::CRITICAL);
|
||||
return ruleCount;
|
||||
}
|
||||
|
||||
@@ -270,6 +283,12 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
int start = 0;
|
||||
int endOfLine = -1;
|
||||
int nbLine = 0;
|
||||
int parseErrorCount = 0;
|
||||
const auto addLog = [&parseErrorCount](const QString &msg)
|
||||
{
|
||||
if (parseErrorCount <= MAX_LOGGED_ERRORS)
|
||||
LogMsg(msg, Log::CRITICAL);
|
||||
};
|
||||
|
||||
while (true) {
|
||||
bytesRead = file.read(buffer.data() + offset, BUFFER_SIZE - offset - 1);
|
||||
@@ -321,7 +340,8 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
// The "Some organization" part might contain a ':' char itself so we find the last occurrence
|
||||
int partsDelimiter = findAndNullDelimiter(buffer.data(), ':', start, endOfLine, true);
|
||||
if (partsDelimiter == -1) {
|
||||
LogMsg(tr("IP filter line %1 is malformed.").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed.").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
@@ -329,7 +349,8 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
// IP Range should be split by a dash
|
||||
int delimIP = findAndNullDelimiter(buffer.data(), '-', partsDelimiter + 1, endOfLine);
|
||||
if (delimIP == -1) {
|
||||
LogMsg(tr("IP filter line %1 is malformed.").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed.").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
@@ -337,7 +358,8 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
libt::address startAddr;
|
||||
int newStart = trim(buffer.data(), partsDelimiter + 1, delimIP - 1);
|
||||
if (!parseIPAddress(buffer.data() + newStart, startAddr)) {
|
||||
LogMsg(tr("IP filter line %1 is malformed. Start IP of the range is malformed.").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed. Start IP of the range is malformed.").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
@@ -345,14 +367,16 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
libt::address endAddr;
|
||||
newStart = trim(buffer.data(), delimIP + 1, endOfLine);
|
||||
if (!parseIPAddress(buffer.data() + newStart, endAddr)) {
|
||||
LogMsg(tr("IP filter line %1 is malformed. End IP of the range is malformed.").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed. End IP of the range is malformed.").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((startAddr.is_v4() != endAddr.is_v4())
|
||||
|| (startAddr.is_v6() != endAddr.is_v6())) {
|
||||
LogMsg(tr("IP filter line %1 is malformed. One IP is IPv4 and the other is IPv6!").arg(nbLine), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter line %1 is malformed. One IP is IPv4 and the other is IPv6!").arg(nbLine));
|
||||
start = endOfLine;
|
||||
continue;
|
||||
}
|
||||
@@ -364,8 +388,9 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
++ruleCount;
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
LogMsg(tr("IP filter exception thrown for line %1. Exception is: %2").arg(nbLine)
|
||||
.arg(QString::fromLocal8Bit(e.what())), Log::CRITICAL);
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter exception thrown for line %1. Exception is: %2")
|
||||
.arg(nbLine).arg(QString::fromLocal8Bit(e.what())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,6 +398,9 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
if (parseErrorCount > MAX_LOGGED_ERRORS)
|
||||
LogMsg(tr("%1 extra IP filter parsing errors occurred.", "513 extra IP filter parsing errors occurred.")
|
||||
.arg(parseErrorCount - MAX_LOGGED_ERRORS), Log::CRITICAL);
|
||||
return ruleCount;
|
||||
}
|
||||
|
||||
@@ -407,7 +435,7 @@ int FilterParserThread::parseP2BFilterFile()
|
||||
if (!file.exists()) return ruleCount;
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
LogMsg(tr("I/O Error: Could not open ip filter file in read mode."), Log::CRITICAL);
|
||||
LogMsg(tr("I/O Error: Could not open IP filter file in read mode."), Log::CRITICAL);
|
||||
return ruleCount;
|
||||
}
|
||||
|
||||
@@ -444,7 +472,7 @@ int FilterParserThread::parseP2BFilterFile()
|
||||
m_filter.add_rule(first, last, libt::ip_filter::blocked);
|
||||
++ruleCount;
|
||||
}
|
||||
catch(std::exception &) {}
|
||||
catch (std::exception &) {}
|
||||
}
|
||||
}
|
||||
else if (version == 3) {
|
||||
@@ -494,7 +522,7 @@ int FilterParserThread::parseP2BFilterFile()
|
||||
m_filter.add_rule(first, last, libt::ip_filter::blocked);
|
||||
++ruleCount;
|
||||
}
|
||||
catch(std::exception &) {}
|
||||
catch (std::exception &) {}
|
||||
|
||||
if (m_abort) return ruleCount;
|
||||
}
|
||||
@@ -553,7 +581,7 @@ void FilterParserThread::run()
|
||||
try {
|
||||
emit IPFilterParsed(ruleCount);
|
||||
}
|
||||
catch(std::exception &) {
|
||||
catch (std::exception &) {
|
||||
emit IPFilterError();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2006 Christophe Dumez
|
||||
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -24,8 +24,6 @@
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#ifndef FILTERPARSERTHREAD_H
|
||||
@@ -42,7 +40,7 @@ class FilterParserThread : public QThread
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FilterParserThread(QObject *parent = 0);
|
||||
FilterParserThread(QObject *parent = nullptr);
|
||||
~FilterParserThread();
|
||||
void processFilterFile(const QString &filePath);
|
||||
libtorrent::ip_filter IPfilter();
|
||||
|
||||
@@ -49,7 +49,7 @@ void ResumeDataSavingManager::saveResumeData(QString infoHash, QByteArray data)
|
||||
resumeFile.write(data);
|
||||
if (!resumeFile.commit()) {
|
||||
Logger::instance()->addMessage(QString("Couldn't save resume data in %1. Error: %2")
|
||||
.arg(filepath).arg(resumeFile.errorString()), Log::WARNING);
|
||||
.arg(filepath, resumeFile.errorString()), Log::WARNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
#ifndef RESUMEDATASAVINGMANAGER_H
|
||||
#define RESUMEDATASAVINGMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QByteArray>
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
|
||||
class ResumeDataSavingManager: public QObject
|
||||
class ResumeDataSavingManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
#include <libtorrent/session.hpp>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/sessionstatus.h"
|
||||
#include "base/profile.h"
|
||||
#include "base/bittorrent/session.h"
|
||||
|
||||
static const qint64 SAVE_INTERVAL = 15 * 60 * 1000;
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
namespace BitTorrent { class Session; }
|
||||
namespace BitTorrent
|
||||
{
|
||||
class Session;
|
||||
}
|
||||
|
||||
class Statistics : QObject
|
||||
{
|
||||
|
||||
@@ -151,6 +151,47 @@ namespace BitTorrent
|
||||
uint nbErrored = 0;
|
||||
};
|
||||
|
||||
class SessionSettingsEnums
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
// TODO: remove `SessionSettingsEnums` wrapper when we can use `Q_ENUM_NS` directly (QT >= 5.8 only)
|
||||
enum class ChokingAlgorithm : int
|
||||
{
|
||||
FixedSlots = 0,
|
||||
RateBased = 1
|
||||
};
|
||||
Q_ENUM(ChokingAlgorithm)
|
||||
|
||||
enum class SeedChokingAlgorithm : int
|
||||
{
|
||||
RoundRobin = 0,
|
||||
FastestUpload = 1,
|
||||
AntiLeech = 2
|
||||
};
|
||||
Q_ENUM(SeedChokingAlgorithm)
|
||||
|
||||
enum class MixedModeAlgorithm : int
|
||||
{
|
||||
TCP = 0,
|
||||
Proportional = 1
|
||||
};
|
||||
Q_ENUM(MixedModeAlgorithm)
|
||||
|
||||
enum class BTProtocol : int
|
||||
{
|
||||
Both = 0,
|
||||
TCP = 1,
|
||||
UTP = 2
|
||||
};
|
||||
Q_ENUM(BTProtocol)
|
||||
};
|
||||
using ChokingAlgorithm = SessionSettingsEnums::ChokingAlgorithm;
|
||||
using SeedChokingAlgorithm = SessionSettingsEnums::SeedChokingAlgorithm;
|
||||
using MixedModeAlgorithm = SessionSettingsEnums::MixedModeAlgorithm;
|
||||
using BTProtocol = SessionSettingsEnums::BTProtocol;
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||
struct SessionMetricIndices
|
||||
{
|
||||
@@ -188,6 +229,9 @@ namespace BitTorrent
|
||||
int diskBlocksInUse = 0;
|
||||
int numBlocksRead = 0;
|
||||
int numBlocksCacheHits = 0;
|
||||
int writeJobs = 0;
|
||||
int readJobs = 0;
|
||||
int hashJobs = 0;
|
||||
int queuedDiskJobs = 0;
|
||||
int diskJobTime = 0;
|
||||
} disk;
|
||||
@@ -210,13 +254,13 @@ namespace BitTorrent
|
||||
void setTempPath(QString path);
|
||||
bool isTempPathEnabled() const;
|
||||
void setTempPathEnabled(bool enabled);
|
||||
QString torrentTempPath(const InfoHash &hash) const;
|
||||
QString torrentTempPath(const TorrentInfo &torrentInfo) const;
|
||||
|
||||
static bool isValidCategoryName(const QString &name);
|
||||
// returns category itself and all top level categories
|
||||
static QStringList expandCategory(const QString &category);
|
||||
|
||||
QStringList categories() const;
|
||||
const QStringMap &categories() const;
|
||||
QString categorySavePath(const QString &categoryName) const;
|
||||
bool addCategory(const QString &name, const QString &savePath = "");
|
||||
bool editCategory(const QString &name, const QString &savePath);
|
||||
@@ -314,6 +358,10 @@ namespace BitTorrent
|
||||
void setForceProxyEnabled(bool enabled);
|
||||
bool isProxyPeerConnectionsEnabled() const;
|
||||
void setProxyPeerConnectionsEnabled(bool enabled);
|
||||
ChokingAlgorithm chokingAlgorithm() const;
|
||||
void setChokingAlgorithm(ChokingAlgorithm mode);
|
||||
SeedChokingAlgorithm seedChokingAlgorithm() const;
|
||||
void setSeedChokingAlgorithm(SeedChokingAlgorithm mode);
|
||||
bool isAddTrackersEnabled() const;
|
||||
void setAddTrackersEnabled(bool enabled);
|
||||
QString additionalTrackers() const;
|
||||
@@ -324,22 +372,42 @@ namespace BitTorrent
|
||||
void setIPFilterFile(QString path);
|
||||
bool announceToAllTrackers() const;
|
||||
void setAnnounceToAllTrackers(bool val);
|
||||
uint diskCacheSize() const;
|
||||
void setDiskCacheSize(uint size);
|
||||
uint diskCacheTTL() const;
|
||||
void setDiskCacheTTL(uint ttl);
|
||||
bool announceToAllTiers() const;
|
||||
void setAnnounceToAllTiers(bool val);
|
||||
int diskCacheSize() const;
|
||||
void setDiskCacheSize(int size);
|
||||
int diskCacheTTL() const;
|
||||
void setDiskCacheTTL(int ttl);
|
||||
bool useOSCache() const;
|
||||
void setUseOSCache(bool use);
|
||||
bool isGuidedReadCacheEnabled() const;
|
||||
void setGuidedReadCacheEnabled(bool enabled);
|
||||
bool isCoalesceReadWriteEnabled() const;
|
||||
void setCoalesceReadWriteEnabled(bool enabled);
|
||||
bool isSuggestModeEnabled() const;
|
||||
void setSuggestMode(bool mode);
|
||||
int sendBufferWatermark() const;
|
||||
void setSendBufferWatermark(int value);
|
||||
int sendBufferLowWatermark() const;
|
||||
void setSendBufferLowWatermark(int value);
|
||||
int sendBufferWatermarkFactor() const;
|
||||
void setSendBufferWatermarkFactor(int value);
|
||||
bool isAnonymousModeEnabled() const;
|
||||
void setAnonymousModeEnabled(bool enabled);
|
||||
bool isQueueingSystemEnabled() const;
|
||||
void setQueueingSystemEnabled(bool enabled);
|
||||
bool ignoreSlowTorrentsForQueueing() const;
|
||||
void setIgnoreSlowTorrentsForQueueing(bool ignore);
|
||||
uint outgoingPortsMin() const;
|
||||
void setOutgoingPortsMin(uint min);
|
||||
uint outgoingPortsMax() const;
|
||||
void setOutgoingPortsMax(uint max);
|
||||
int downloadRateForSlowTorrents() const;
|
||||
void setDownloadRateForSlowTorrents(int rateInKibiBytes);
|
||||
int uploadRateForSlowTorrents() const;
|
||||
void setUploadRateForSlowTorrents(int rateInKibiBytes);
|
||||
int slowTorrentsInactivityTimer() const;
|
||||
void setSlowTorrentsInactivityTimer(int timeInSeconds);
|
||||
int outgoingPortsMin() const;
|
||||
void setOutgoingPortsMin(int min);
|
||||
int outgoingPortsMax() const;
|
||||
void setOutgoingPortsMax(int max);
|
||||
bool ignoreLimitsOnLAN() const;
|
||||
void setIgnoreLimitsOnLAN(bool ignore);
|
||||
bool includeOverheadInLimits() const;
|
||||
@@ -364,10 +432,14 @@ namespace BitTorrent
|
||||
void setMaxActiveUploads(int max);
|
||||
int maxActiveTorrents() const;
|
||||
void setMaxActiveTorrents(int max);
|
||||
bool isUTPEnabled() const;
|
||||
void setUTPEnabled(bool enabled);
|
||||
BTProtocol btProtocol() const;
|
||||
void setBTProtocol(BTProtocol protocol);
|
||||
bool isUTPRateLimited() const;
|
||||
void setUTPRateLimited(bool limited);
|
||||
MixedModeAlgorithm utpMixedMode() const;
|
||||
void setUtpMixedMode(MixedModeAlgorithm mode);
|
||||
bool multiConnectionsPerIpEnabled() const;
|
||||
void setMultiConnectionsPerIpEnabled(bool enabled);
|
||||
bool isTrackerFilteringEnabled() const;
|
||||
void setTrackerFilteringEnabled(bool enabled);
|
||||
QStringList bannedIPs() const;
|
||||
@@ -477,13 +549,19 @@ namespace BitTorrent
|
||||
void handleDownloadFinished(const QString &url, const QString &filePath);
|
||||
void handleDownloadFailed(const QString &url, const QString &reason);
|
||||
void handleRedirectedToMagnet(const QString &url, const QString &magnetUri);
|
||||
void switchToAlternativeMode(bool alternative);
|
||||
|
||||
// Session reconfiguration triggers
|
||||
void networkOnlineStateChanged(const bool online);
|
||||
void networkConfigurationChange(const QNetworkConfiguration&);
|
||||
|
||||
private:
|
||||
struct RemovingTorrentData
|
||||
{
|
||||
QString name;
|
||||
QString savePathToRemove;
|
||||
bool requestedFileDeletion;
|
||||
};
|
||||
|
||||
explicit Session(QObject *parent = 0);
|
||||
~Session();
|
||||
|
||||
@@ -497,17 +575,19 @@ namespace BitTorrent
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
void configure(libtorrent::session_settings &sessionSettings);
|
||||
void adjustLimits(libtorrent::session_settings &sessionSettings);
|
||||
void applyBandwidthLimits(libtorrent::session_settings &sessionSettings);
|
||||
#else
|
||||
void configure(libtorrent::settings_pack &settingsPack);
|
||||
void configurePeerClasses();
|
||||
void adjustLimits(libtorrent::settings_pack &settingsPack);
|
||||
void applyBandwidthLimits(libtorrent::settings_pack &settingsPack);
|
||||
void initMetrics();
|
||||
#endif
|
||||
void adjustLimits();
|
||||
void applyBandwidthLimits();
|
||||
void processBannedIPs(libtorrent::ip_filter &filter);
|
||||
const QStringList getListeningIPs();
|
||||
void configureListeningInterface();
|
||||
void changeSpeedLimitMode_impl(bool alternative);
|
||||
void enableTracker(bool enable);
|
||||
void enableBandwidthScheduler();
|
||||
void populateAdditionalTrackers();
|
||||
@@ -569,17 +649,27 @@ namespace BitTorrent
|
||||
CachedSettingValue<bool> m_isTrackerFilteringEnabled;
|
||||
CachedSettingValue<QString> m_IPFilterFile;
|
||||
CachedSettingValue<bool> m_announceToAllTrackers;
|
||||
CachedSettingValue<uint> m_diskCacheSize;
|
||||
CachedSettingValue<uint> m_diskCacheTTL;
|
||||
CachedSettingValue<bool> m_announceToAllTiers;
|
||||
CachedSettingValue<int> m_diskCacheSize;
|
||||
CachedSettingValue<int> m_diskCacheTTL;
|
||||
CachedSettingValue<bool> m_useOSCache;
|
||||
CachedSettingValue<bool> m_guidedReadCacheEnabled;
|
||||
CachedSettingValue<bool> m_coalesceReadWriteEnabled;
|
||||
CachedSettingValue<bool> m_isSuggestMode;
|
||||
CachedSettingValue<int> m_sendBufferWatermark;
|
||||
CachedSettingValue<int> m_sendBufferLowWatermark;
|
||||
CachedSettingValue<int> m_sendBufferWatermarkFactor;
|
||||
CachedSettingValue<bool> m_isAnonymousModeEnabled;
|
||||
CachedSettingValue<bool> m_isQueueingEnabled;
|
||||
CachedSettingValue<int> m_maxActiveDownloads;
|
||||
CachedSettingValue<int> m_maxActiveUploads;
|
||||
CachedSettingValue<int> m_maxActiveTorrents;
|
||||
CachedSettingValue<bool> m_ignoreSlowTorrentsForQueueing;
|
||||
CachedSettingValue<uint> m_outgoingPortsMin;
|
||||
CachedSettingValue<uint> m_outgoingPortsMax;
|
||||
CachedSettingValue<int> m_downloadRateForSlowTorrents;
|
||||
CachedSettingValue<int> m_uploadRateForSlowTorrents;
|
||||
CachedSettingValue<int> m_slowTorrentsInactivityTimer;
|
||||
CachedSettingValue<int> m_outgoingPortsMin;
|
||||
CachedSettingValue<int> m_outgoingPortsMax;
|
||||
CachedSettingValue<bool> m_ignoreLimitsOnLAN;
|
||||
CachedSettingValue<bool> m_includeOverheadInLimits;
|
||||
CachedSettingValue<QString> m_announceIP;
|
||||
@@ -589,8 +679,10 @@ namespace BitTorrent
|
||||
CachedSettingValue<int> m_maxUploads;
|
||||
CachedSettingValue<int> m_maxConnectionsPerTorrent;
|
||||
CachedSettingValue<int> m_maxUploadsPerTorrent;
|
||||
CachedSettingValue<bool> m_isUTPEnabled;
|
||||
CachedSettingValue<BTProtocol> m_btProtocol;
|
||||
CachedSettingValue<bool> m_isUTPRateLimited;
|
||||
CachedSettingValue<MixedModeAlgorithm> m_utpMixedMode;
|
||||
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
||||
CachedSettingValue<bool> m_isAddTrackersEnabled;
|
||||
CachedSettingValue<QString> m_additionalTrackers;
|
||||
CachedSettingValue<qreal> m_globalMaxRatio;
|
||||
@@ -618,6 +710,8 @@ namespace BitTorrent
|
||||
CachedSettingValue<int> m_encryption;
|
||||
CachedSettingValue<bool> m_isForceProxyEnabled;
|
||||
CachedSettingValue<bool> m_isProxyPeerConnectionsEnabled;
|
||||
CachedSettingValue<ChokingAlgorithm> m_chokingAlgorithm;
|
||||
CachedSettingValue<SeedChokingAlgorithm> m_seedChokingAlgorithm;
|
||||
CachedSettingValue<QVariantMap> m_storedCategories;
|
||||
CachedSettingValue<QStringList> m_storedTags;
|
||||
CachedSettingValue<int> m_maxRatioAction;
|
||||
@@ -642,7 +736,6 @@ namespace BitTorrent
|
||||
QList<BitTorrent::TrackerEntry> m_additionalTrackerList;
|
||||
QString m_resumeFolderPath;
|
||||
QFile m_resumeFolderLock;
|
||||
QHash<InfoHash, QString> m_savePathsToRemove;
|
||||
bool m_useProxy;
|
||||
|
||||
QTimer *m_refreshTimer;
|
||||
@@ -662,6 +755,7 @@ namespace BitTorrent
|
||||
QHash<InfoHash, TorrentHandle *> m_torrents;
|
||||
QHash<InfoHash, AddTorrentData> m_addingTorrents;
|
||||
QHash<QString, AddTorrentParams> m_downloadedTorrents;
|
||||
QHash<InfoHash, RemovingTorrentData> m_removingTorrents;
|
||||
TorrentStatusReport m_torrentStatusReport;
|
||||
QStringMap m_categories;
|
||||
QSet<QString> m_tags;
|
||||
|
||||
@@ -35,138 +35,187 @@
|
||||
#include <boost/bind.hpp>
|
||||
#include <libtorrent/bencode.hpp>
|
||||
#include <libtorrent/create_torrent.hpp>
|
||||
#include <libtorrent/torrent_info.hpp>
|
||||
#include <libtorrent/storage.hpp>
|
||||
#include <libtorrent/torrent_info.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#include <QDirIterator>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QHash>
|
||||
|
||||
#include "base/global.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "base/utils/string.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
// do not include files and folders whose
|
||||
// name starts with a .
|
||||
bool fileFilter(const std::string &f)
|
||||
{
|
||||
return !Utils::Fs::fileName(QString::fromStdString(f)).startsWith('.');
|
||||
}
|
||||
}
|
||||
|
||||
namespace libt = libtorrent;
|
||||
using namespace BitTorrent;
|
||||
|
||||
// do not include files and folders whose
|
||||
// name starts with a .
|
||||
bool fileFilter(const std::string &f)
|
||||
{
|
||||
return !Utils::Fs::fileName(QString::fromStdString(f)).startsWith('.');
|
||||
}
|
||||
|
||||
TorrentCreatorThread::TorrentCreatorThread(QObject *parent)
|
||||
: QThread(parent)
|
||||
, m_private(false)
|
||||
, m_pieceSize(0)
|
||||
{
|
||||
}
|
||||
|
||||
TorrentCreatorThread::~TorrentCreatorThread()
|
||||
{
|
||||
requestInterruption();
|
||||
wait(1000);
|
||||
wait();
|
||||
}
|
||||
|
||||
void TorrentCreatorThread::create(const QString &inputPath, const QString &savePath, const QStringList &trackers,
|
||||
const QStringList &urlSeeds, const QString &comment, bool isPrivate, int pieceSize)
|
||||
void TorrentCreatorThread::create(const TorrentCreatorParams ¶ms)
|
||||
{
|
||||
m_inputPath = Utils::Fs::fromNativePath(inputPath);
|
||||
m_savePath = Utils::Fs::fromNativePath(savePath);
|
||||
if (QFile(m_savePath).exists())
|
||||
Utils::Fs::forceRemove(m_savePath);
|
||||
m_trackers = trackers;
|
||||
m_urlSeeds = urlSeeds;
|
||||
m_comment = comment;
|
||||
m_private = isPrivate;
|
||||
m_pieceSize = pieceSize;
|
||||
|
||||
m_params = params;
|
||||
start();
|
||||
}
|
||||
|
||||
void TorrentCreatorThread::sendProgressSignal(int numHashes, int numPieces)
|
||||
void TorrentCreatorThread::sendProgressSignal(int currentPieceIdx, int totalPieces)
|
||||
{
|
||||
emit updateProgress(static_cast<int>((numHashes * 100.) / numPieces));
|
||||
emit updateProgress(static_cast<int>((currentPieceIdx * 100.) / totalPieces));
|
||||
}
|
||||
|
||||
void TorrentCreatorThread::run()
|
||||
{
|
||||
const QString creatorStr("qBittorrent " QBT_VERSION);
|
||||
|
||||
emit updateProgress(0);
|
||||
|
||||
QString creator_str("qBittorrent " QBT_VERSION);
|
||||
try {
|
||||
libt::file_storage fs;
|
||||
const QString parentPath = Utils::Fs::branchPath(m_params.inputPath) + "/";
|
||||
|
||||
// Adding files to the torrent
|
||||
libt::add_files(fs, Utils::Fs::toNativePath(m_inputPath).toStdString(), fileFilter);
|
||||
libt::file_storage fs;
|
||||
if (QFileInfo(m_params.inputPath).isFile()) {
|
||||
libt::add_files(fs, Utils::Fs::toNativePath(m_params.inputPath).toStdString(), fileFilter);
|
||||
}
|
||||
else {
|
||||
// need to sort the file names by natural sort order
|
||||
QStringList dirs = {m_params.inputPath};
|
||||
|
||||
QDirIterator dirIter(m_params.inputPath, (QDir::AllDirs | QDir::NoDotAndDotDot), QDirIterator::Subdirectories);
|
||||
while (dirIter.hasNext()) {
|
||||
dirIter.next();
|
||||
dirs += dirIter.filePath();
|
||||
}
|
||||
std::sort(dirs.begin(), dirs.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
|
||||
|
||||
QStringList fileNames;
|
||||
QHash<QString, boost::int64_t> fileSizeMap;
|
||||
|
||||
for (const auto &dir : qAsConst(dirs)) {
|
||||
QStringList tmpNames; // natural sort files within each dir
|
||||
|
||||
QDirIterator fileIter(dir, QDir::Files);
|
||||
while (fileIter.hasNext()) {
|
||||
fileIter.next();
|
||||
|
||||
const QString relFilePath = fileIter.filePath().mid(parentPath.length());
|
||||
tmpNames += relFilePath;
|
||||
fileSizeMap[relFilePath] = fileIter.fileInfo().size();
|
||||
}
|
||||
|
||||
std::sort(tmpNames.begin(), tmpNames.end(), Utils::String::naturalLessThan<Qt::CaseInsensitive>);
|
||||
fileNames += tmpNames;
|
||||
}
|
||||
|
||||
for (const auto &fileName : qAsConst(fileNames))
|
||||
fs.add_file(fileName.toStdString(), fileSizeMap[fileName]);
|
||||
}
|
||||
|
||||
if (isInterruptionRequested()) return;
|
||||
|
||||
libt::create_torrent t(fs, m_pieceSize);
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
libt::create_torrent newTorrent(fs, m_params.pieceSize, -1
|
||||
, (m_params.isAlignmentOptimized ? libt::create_torrent::optimize : 0));
|
||||
#else
|
||||
libt::create_torrent newTorrent(fs, m_params.pieceSize, -1
|
||||
, (m_params.isAlignmentOptimized ? libt::create_torrent::optimize_alignment : 0));
|
||||
#endif
|
||||
|
||||
// Add url seeds
|
||||
foreach (const QString &seed, m_urlSeeds)
|
||||
t.add_url_seed(seed.trimmed().toStdString());
|
||||
foreach (QString seed, m_params.urlSeeds) {
|
||||
seed = seed.trimmed();
|
||||
if (!seed.isEmpty())
|
||||
newTorrent.add_url_seed(seed.toStdString());
|
||||
}
|
||||
|
||||
int tier = 0;
|
||||
bool newline = false;
|
||||
foreach (const QString &tracker, m_trackers) {
|
||||
if (tracker.isEmpty()) {
|
||||
if (newline)
|
||||
continue;
|
||||
foreach (const QString &tracker, m_params.trackers) {
|
||||
if (tracker.isEmpty())
|
||||
++tier;
|
||||
newline = true;
|
||||
continue;
|
||||
}
|
||||
t.add_tracker(tracker.trimmed().toStdString(), tier);
|
||||
newline = false;
|
||||
else
|
||||
newTorrent.add_tracker(tracker.trimmed().toStdString(), tier);
|
||||
}
|
||||
|
||||
if (isInterruptionRequested()) return;
|
||||
|
||||
// calculate the hash for all pieces
|
||||
const QString parentPath = Utils::Fs::branchPath(m_inputPath) + "/";
|
||||
libt::set_piece_hashes(t, Utils::Fs::toNativePath(parentPath).toStdString(), boost::bind(&TorrentCreatorThread::sendProgressSignal, this, _1, t.num_pieces()));
|
||||
libt::set_piece_hashes(newTorrent, Utils::Fs::toNativePath(parentPath).toStdString()
|
||||
, [this, &newTorrent](const int n) { sendProgressSignal(n, newTorrent.num_pieces()); });
|
||||
// Set qBittorrent as creator and add user comment to
|
||||
// torrent_info structure
|
||||
t.set_creator(creator_str.toUtf8().constData());
|
||||
t.set_comment(m_comment.toUtf8().constData());
|
||||
newTorrent.set_creator(creatorStr.toUtf8().constData());
|
||||
newTorrent.set_comment(m_params.comment.toUtf8().constData());
|
||||
// Is private ?
|
||||
t.set_priv(m_private);
|
||||
newTorrent.set_priv(m_params.isPrivate);
|
||||
|
||||
if (isInterruptionRequested()) return;
|
||||
|
||||
// create the torrent and print it to out
|
||||
qDebug("Saving to %s", qPrintable(m_savePath));
|
||||
libt::entry entry = newTorrent.generate();
|
||||
|
||||
// add source field
|
||||
if (!m_params.source.isEmpty())
|
||||
entry["info"]["source"] = m_params.source.toStdString();
|
||||
|
||||
if (isInterruptionRequested()) return;
|
||||
|
||||
// create the torrent
|
||||
std::ofstream outfile(
|
||||
#ifdef _MSC_VER
|
||||
wchar_t *savePathW = new wchar_t[m_savePath.length() + 1];
|
||||
int len = Utils::Fs::toNativePath(m_savePath).toWCharArray(savePathW);
|
||||
savePathW[len] = L'\0';
|
||||
std::ofstream outfile(savePathW, std::ios_base::out | std::ios_base::binary);
|
||||
delete[] savePathW;
|
||||
Utils::Fs::toNativePath(m_params.savePath).toStdWString().c_str()
|
||||
#else
|
||||
std::ofstream outfile(Utils::Fs::toNativePath(m_savePath).toLocal8Bit().constData(), std::ios_base::out | std::ios_base::binary);
|
||||
Utils::Fs::toNativePath(m_params.savePath).toUtf8().constData()
|
||||
#endif
|
||||
, (std::ios_base::out | std::ios_base::binary | std::ios_base::trunc));
|
||||
if (outfile.fail())
|
||||
throw std::exception();
|
||||
throw std::runtime_error(tr("create new torrent file failed").toStdString());
|
||||
|
||||
if (isInterruptionRequested()) return;
|
||||
|
||||
libt::bencode(std::ostream_iterator<char>(outfile), t.generate());
|
||||
libt::bencode(std::ostream_iterator<char>(outfile), entry);
|
||||
outfile.close();
|
||||
|
||||
emit updateProgress(100);
|
||||
emit creationSuccess(m_savePath, parentPath);
|
||||
emit creationSuccess(m_params.savePath, parentPath);
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
emit creationFailure(QString::fromStdString(e.what()));
|
||||
catch (const std::exception &e) {
|
||||
emit creationFailure(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
int TorrentCreatorThread::calculateTotalPieces(const QString &inputPath, const int pieceSize)
|
||||
int TorrentCreatorThread::calculateTotalPieces(const QString &inputPath, const int pieceSize, const bool isAlignmentOptimized)
|
||||
{
|
||||
if (inputPath.isEmpty())
|
||||
return 0;
|
||||
|
||||
libt::file_storage fs;
|
||||
libt::add_files(fs, Utils::Fs::toNativePath(inputPath).toStdString(), fileFilter);
|
||||
return libt::create_torrent(fs, pieceSize).num_pieces();
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
return libt::create_torrent(fs, pieceSize, -1
|
||||
, (isAlignmentOptimized ? libt::create_torrent::optimize : 0)).num_pieces();
|
||||
#else
|
||||
return libt::create_torrent(fs, pieceSize, -1
|
||||
, (isAlignmentOptimized ? libt::create_torrent::optimize_alignment : 0)).num_pieces();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -36,18 +36,30 @@
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
struct TorrentCreatorParams
|
||||
{
|
||||
bool isPrivate;
|
||||
bool isAlignmentOptimized;
|
||||
int pieceSize;
|
||||
QString inputPath;
|
||||
QString savePath;
|
||||
QString comment;
|
||||
QString source;
|
||||
QStringList trackers;
|
||||
QStringList urlSeeds;
|
||||
};
|
||||
|
||||
class TorrentCreatorThread : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TorrentCreatorThread(QObject *parent = 0);
|
||||
TorrentCreatorThread(QObject *parent = nullptr);
|
||||
~TorrentCreatorThread();
|
||||
|
||||
void create(const QString &inputPath, const QString &savePath, const QStringList &trackers,
|
||||
const QStringList &urlSeeds, const QString &comment, bool isPrivate, int pieceSize);
|
||||
void create(const TorrentCreatorParams ¶ms);
|
||||
|
||||
static int calculateTotalPieces(const QString &inputPath, const int pieceSize);
|
||||
static int calculateTotalPieces(const QString &inputPath, const int pieceSize, const bool isAlignmentOptimized);
|
||||
|
||||
protected:
|
||||
void run();
|
||||
@@ -58,15 +70,9 @@ namespace BitTorrent
|
||||
void updateProgress(int progress);
|
||||
|
||||
private:
|
||||
void sendProgressSignal(int numHashes, int numPieces);
|
||||
void sendProgressSignal(int currentPieceIdx, int totalPieces);
|
||||
|
||||
QString m_inputPath;
|
||||
QString m_savePath;
|
||||
QStringList m_trackers;
|
||||
QStringList m_urlSeeds;
|
||||
QString m_comment;
|
||||
bool m_private;
|
||||
int m_pieceSize;
|
||||
TorrentCreatorParams m_params;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -27,20 +27,23 @@
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include "torrenthandle.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QByteArray>
|
||||
#include <QBitArray>
|
||||
#include <QByteArray>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QStringList>
|
||||
|
||||
#include <libtorrent/entry.hpp>
|
||||
#include <libtorrent/bencode.hpp>
|
||||
#include <libtorrent/address.hpp>
|
||||
#include <libtorrent/alert_types.hpp>
|
||||
#include <libtorrent/bencode.hpp>
|
||||
#include <libtorrent/create_torrent.hpp>
|
||||
#include <libtorrent/entry.hpp>
|
||||
#include <libtorrent/magnet_uri.hpp>
|
||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||
#include <libtorrent/time.hpp>
|
||||
@@ -55,13 +58,12 @@
|
||||
#include "base/logger.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/profile.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "base/utils/fs.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "session.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "peerinfo.h"
|
||||
#include "session.h"
|
||||
#include "trackerentry.h"
|
||||
#include "torrenthandle.h"
|
||||
|
||||
const QString QB_EXT {".!qB"};
|
||||
|
||||
@@ -93,6 +95,8 @@ AddTorrentData::AddTorrentData()
|
||||
, hasRootFolder(true)
|
||||
, addForced(false)
|
||||
, addPaused(false)
|
||||
, uploadLimit(-1)
|
||||
, downloadLimit(-1)
|
||||
, ratioLimit(TorrentHandle::USE_GLOBAL_RATIO)
|
||||
, seedingTimeLimit(TorrentHandle::USE_GLOBAL_SEEDING_TIME)
|
||||
{
|
||||
@@ -116,68 +120,19 @@ AddTorrentData::AddTorrentData(const AddTorrentParams ¶ms)
|
||||
, addPaused(params.addPaused == TriStateBool::Undefined
|
||||
? Session::instance()->isAddTorrentPaused()
|
||||
: params.addPaused == TriStateBool::True)
|
||||
, uploadLimit(params.uploadLimit)
|
||||
, downloadLimit(params.downloadLimit)
|
||||
, filePriorities(params.filePriorities)
|
||||
, ratioLimit(params.ignoreShareLimits ? TorrentHandle::NO_RATIO_LIMIT : TorrentHandle::USE_GLOBAL_RATIO)
|
||||
, seedingTimeLimit(params.ignoreShareLimits ? TorrentHandle::NO_SEEDING_TIME_LIMIT : TorrentHandle::USE_GLOBAL_SEEDING_TIME)
|
||||
{
|
||||
}
|
||||
|
||||
// TorrentState
|
||||
|
||||
TorrentState::TorrentState(int value)
|
||||
: m_value(value)
|
||||
{
|
||||
}
|
||||
|
||||
QString TorrentState::toString() const
|
||||
{
|
||||
switch (m_value) {
|
||||
case Error:
|
||||
return QLatin1String("error");
|
||||
case MissingFiles:
|
||||
return QLatin1String("missingFiles");
|
||||
case Uploading:
|
||||
return QLatin1String("uploading");
|
||||
case PausedUploading:
|
||||
return QLatin1String("pausedUP");
|
||||
case QueuedUploading:
|
||||
return QLatin1String("queuedUP");
|
||||
case StalledUploading:
|
||||
return QLatin1String("stalledUP");
|
||||
case CheckingUploading:
|
||||
return QLatin1String("checkingUP");
|
||||
case ForcedUploading:
|
||||
return QLatin1String("forcedUP");
|
||||
case Allocating:
|
||||
return QLatin1String("allocating");
|
||||
case Downloading:
|
||||
return QLatin1String("downloading");
|
||||
case DownloadingMetadata:
|
||||
return QLatin1String("metaDL");
|
||||
case PausedDownloading:
|
||||
return QLatin1String("pausedDL");
|
||||
case QueuedDownloading:
|
||||
return QLatin1String("queuedDL");
|
||||
case StalledDownloading:
|
||||
return QLatin1String("stalledDL");
|
||||
case CheckingDownloading:
|
||||
return QLatin1String("checkingDL");
|
||||
case ForcedDownloading:
|
||||
return QLatin1String("forcedDL");
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
case QueuedForChecking:
|
||||
return QLatin1String("queuedForChecking");
|
||||
#endif
|
||||
case CheckingResumeData:
|
||||
return QLatin1String("checkingResumeData");
|
||||
default:
|
||||
return QLatin1String("unknown");
|
||||
}
|
||||
}
|
||||
|
||||
TorrentState::operator int() const
|
||||
{
|
||||
return m_value;
|
||||
bool useAutoTMM = (params.useAutoTMM == TriStateBool::Undefined
|
||||
? !Session::instance()->isAutoTMMDisabledByDefault()
|
||||
: params.useAutoTMM == TriStateBool::True);
|
||||
if (useAutoTMM)
|
||||
savePath = "";
|
||||
else if (savePath.trimmed().isEmpty())
|
||||
savePath = Session::instance()->defaultSavePath();
|
||||
}
|
||||
|
||||
// TorrentHandle
|
||||
@@ -201,6 +156,8 @@ const int TorrentHandle::MAX_SEEDING_TIME = 525600;
|
||||
// The following can be removed after one or two libtorrent releases on each branch.
|
||||
namespace
|
||||
{
|
||||
const char i18nContext[] = "TorrentHandle";
|
||||
|
||||
// new constructor is available
|
||||
template<typename T, typename std::enable_if<std::is_constructible<T, libt::torrent_info, bool>::value, int>::type = 0>
|
||||
T makeTorrentCreator(const libtorrent::torrent_info & ti)
|
||||
@@ -390,7 +347,7 @@ void TorrentHandle::setAutoTMMEnabled(bool enabled)
|
||||
m_session->handleTorrentSavingModeChanged(this);
|
||||
|
||||
if (m_useAutoTMM)
|
||||
move_impl(m_session->categorySavePath(m_category));
|
||||
move_impl(m_session->categorySavePath(m_category), true);
|
||||
}
|
||||
|
||||
bool TorrentHandle::hasRootFolder() const
|
||||
@@ -1101,10 +1058,9 @@ int TorrentHandle::timeSinceDownload() const
|
||||
|
||||
int TorrentHandle::timeSinceActivity() const
|
||||
{
|
||||
if (m_nativeStatus.time_since_upload < m_nativeStatus.time_since_download)
|
||||
return m_nativeStatus.time_since_upload;
|
||||
else
|
||||
return m_nativeStatus.time_since_download;
|
||||
return ((m_nativeStatus.time_since_upload < 0) != (m_nativeStatus.time_since_download < 0))
|
||||
? std::max(m_nativeStatus.time_since_upload, m_nativeStatus.time_since_download)
|
||||
: std::min(m_nativeStatus.time_since_upload, m_nativeStatus.time_since_download);
|
||||
}
|
||||
|
||||
int TorrentHandle::downloadLimit() const
|
||||
@@ -1173,38 +1129,20 @@ qreal TorrentHandle::distributedCopies() const
|
||||
return m_nativeStatus.distributed_copies;
|
||||
}
|
||||
|
||||
qreal TorrentHandle::maxRatio(bool *usesGlobalRatio) const
|
||||
qreal TorrentHandle::maxRatio() const
|
||||
{
|
||||
qreal ratioLimit = m_ratioLimit;
|
||||
if (m_ratioLimit == USE_GLOBAL_RATIO)
|
||||
return m_session->globalMaxRatio();
|
||||
|
||||
if (ratioLimit == USE_GLOBAL_RATIO) {
|
||||
ratioLimit = m_session->globalMaxRatio();
|
||||
if (usesGlobalRatio)
|
||||
*usesGlobalRatio = true;
|
||||
}
|
||||
else {
|
||||
if (usesGlobalRatio)
|
||||
*usesGlobalRatio = false;
|
||||
}
|
||||
|
||||
return ratioLimit;
|
||||
return m_ratioLimit;
|
||||
}
|
||||
|
||||
int TorrentHandle::maxSeedingTime(bool *usesGlobalSeedingTime) const
|
||||
int TorrentHandle::maxSeedingTime() const
|
||||
{
|
||||
int seedingTimeLimit = m_seedingTimeLimit;
|
||||
if (m_seedingTimeLimit == USE_GLOBAL_SEEDING_TIME)
|
||||
return m_session->globalMaxSeedingMinutes();
|
||||
|
||||
if (seedingTimeLimit == USE_GLOBAL_SEEDING_TIME) {
|
||||
seedingTimeLimit = m_session->globalMaxSeedingMinutes();
|
||||
if (usesGlobalSeedingTime)
|
||||
*usesGlobalSeedingTime = true;
|
||||
}
|
||||
else {
|
||||
if (usesGlobalSeedingTime)
|
||||
*usesGlobalSeedingTime = false;
|
||||
}
|
||||
|
||||
return seedingTimeLimit;
|
||||
return m_seedingTimeLimit;
|
||||
}
|
||||
|
||||
qreal TorrentHandle::realRatio() const
|
||||
@@ -1285,7 +1223,7 @@ bool TorrentHandle::setCategory(const QString &category)
|
||||
|
||||
if (m_useAutoTMM) {
|
||||
if (!m_session->isDisableAutoTMMWhenCategoryChanged())
|
||||
move_impl(m_session->categorySavePath(m_category));
|
||||
move_impl(m_session->categorySavePath(m_category), true);
|
||||
else
|
||||
setAutoTMMEnabled(false);
|
||||
}
|
||||
@@ -1305,16 +1243,16 @@ void TorrentHandle::move(QString path)
|
||||
if (!path.endsWith('/'))
|
||||
path += '/';
|
||||
|
||||
move_impl(path);
|
||||
move_impl(path, false);
|
||||
}
|
||||
|
||||
void TorrentHandle::move_impl(QString path)
|
||||
void TorrentHandle::move_impl(QString path, bool overwrite)
|
||||
{
|
||||
path = Utils::Fs::toNativePath(path);
|
||||
if (path == savePath()) return;
|
||||
path = Utils::Fs::toNativePath(path);
|
||||
|
||||
if (!useTempPath()) {
|
||||
moveStorage(path);
|
||||
moveStorage(path, overwrite);
|
||||
}
|
||||
else {
|
||||
m_savePath = path;
|
||||
@@ -1339,7 +1277,7 @@ void TorrentHandle::forceRecheck()
|
||||
|
||||
if (isPaused()) {
|
||||
m_pauseAfterRecheck = true;
|
||||
resume();
|
||||
resume_impl(true, true);
|
||||
}
|
||||
|
||||
m_nativeHandle.force_recheck();
|
||||
@@ -1407,30 +1345,37 @@ void TorrentHandle::pause()
|
||||
}
|
||||
|
||||
void TorrentHandle::resume(bool forced)
|
||||
{
|
||||
resume_impl(forced, false);
|
||||
}
|
||||
|
||||
void TorrentHandle::resume_impl(bool forced, bool uploadMode)
|
||||
{
|
||||
if (hasError())
|
||||
m_nativeHandle.clear_error();
|
||||
m_hasMissingFiles = false;
|
||||
m_nativeHandle.set_upload_mode(false);
|
||||
m_nativeHandle.auto_managed(!forced);
|
||||
m_nativeHandle.set_upload_mode(uploadMode);
|
||||
m_nativeHandle.resume();
|
||||
}
|
||||
|
||||
void TorrentHandle::moveStorage(const QString &newPath)
|
||||
void TorrentHandle::moveStorage(const QString &newPath, bool overwrite)
|
||||
{
|
||||
if (isMoveInProgress()) {
|
||||
qDebug("enqueue move storage to %s", qPrintable(newPath));
|
||||
m_queuedPath = newPath;
|
||||
qDebug("enqueue move storage to %s", qUtf8Printable(newPath));
|
||||
m_moveStorageInfo.queuedPath = newPath;
|
||||
m_moveStorageInfo.queuedOverwrite = overwrite;
|
||||
}
|
||||
else {
|
||||
const QString oldPath = nativeActualSavePath();
|
||||
if (QDir(oldPath) == QDir(newPath)) return;
|
||||
|
||||
qDebug("move storage: %s to %s", qPrintable(oldPath), qPrintable(newPath));
|
||||
qDebug("move storage: %s to %s", qUtf8Printable(oldPath), qUtf8Printable(newPath));
|
||||
// Actually move the storage
|
||||
m_nativeHandle.move_storage(newPath.toUtf8().constData());
|
||||
m_oldPath = oldPath;
|
||||
m_newPath = newPath;
|
||||
m_nativeHandle.move_storage(newPath.toUtf8().constData()
|
||||
, (overwrite ? libt::always_replace_files : libt::dont_replace));
|
||||
m_moveStorageInfo.oldPath = oldPath;
|
||||
m_moveStorageInfo.newPath = newPath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1492,22 +1437,27 @@ void TorrentHandle::handleStorageMovedAlert(libtorrent::storage_moved_alert *p)
|
||||
#else
|
||||
const QString newPath(p->storage_path());
|
||||
#endif
|
||||
if (newPath != m_newPath) {
|
||||
if (newPath != m_moveStorageInfo.newPath) {
|
||||
qWarning() << Q_FUNC_INFO << ": New path doesn't match a path in a queue.";
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug("Torrent is successfully moved from %s to %s", qPrintable(m_oldPath), qPrintable(m_newPath));
|
||||
if (m_oldPath == m_session->torrentTempPath(hash())) {
|
||||
qDebug() << "Removing torrent temp folder:" << m_oldPath;
|
||||
Utils::Fs::smartRemoveEmptyFolderTree(m_oldPath);
|
||||
qDebug("Torrent is successfully moved from %s to %s"
|
||||
, qUtf8Printable(m_moveStorageInfo.oldPath), qUtf8Printable(m_moveStorageInfo.newPath));
|
||||
const QDir oldDir {m_moveStorageInfo.oldPath};
|
||||
if ((oldDir == QDir(m_session->torrentTempPath(info())))
|
||||
&& (oldDir != QDir(m_session->tempPath()))) {
|
||||
// torrent without root folder still has it in its temporary save path
|
||||
// so its temp path isn't equal to temp path root
|
||||
qDebug() << "Removing torrent temp folder:" << m_moveStorageInfo.oldPath;
|
||||
Utils::Fs::smartRemoveEmptyFolderTree(m_moveStorageInfo.oldPath);
|
||||
}
|
||||
updateStatus();
|
||||
|
||||
m_newPath.clear();
|
||||
if (!m_queuedPath.isEmpty()) {
|
||||
moveStorage(m_queuedPath);
|
||||
m_queuedPath.clear();
|
||||
m_moveStorageInfo.newPath.clear();
|
||||
if (!m_moveStorageInfo.queuedPath.isEmpty()) {
|
||||
moveStorage(m_moveStorageInfo.queuedPath, m_moveStorageInfo.queuedOverwrite);
|
||||
m_moveStorageInfo.queuedPath.clear();
|
||||
}
|
||||
|
||||
if (!useTempPath()) {
|
||||
@@ -1526,13 +1476,13 @@ void TorrentHandle::handleStorageMovedFailedAlert(libtorrent::storage_moved_fail
|
||||
return;
|
||||
}
|
||||
|
||||
Logger::instance()->addMessage(tr("Could not move torrent: '%1'. Reason: %2")
|
||||
.arg(name()).arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
||||
LogMsg(QCoreApplication::translate(i18nContext, "Could not move torrent: '%1'. Reason: %2")
|
||||
.arg(name(), QString::fromStdString(p->message())), Log::CRITICAL);
|
||||
|
||||
m_newPath.clear();
|
||||
if (!m_queuedPath.isEmpty()) {
|
||||
moveStorage(m_queuedPath);
|
||||
m_queuedPath.clear();
|
||||
m_moveStorageInfo.newPath.clear();
|
||||
if (!m_moveStorageInfo.queuedPath.isEmpty()) {
|
||||
moveStorage(m_moveStorageInfo.queuedPath, m_moveStorageInfo.queuedOverwrite);
|
||||
m_moveStorageInfo.queuedPath.clear();
|
||||
}
|
||||
|
||||
while (!isMoveInProgress() && (m_renameCount == 0) && !m_moveFinishedTriggers.isEmpty())
|
||||
@@ -1546,7 +1496,7 @@ void TorrentHandle::handleTrackerReplyAlert(libtorrent::tracker_reply_alert *p)
|
||||
#else
|
||||
QString trackerUrl(p->tracker_url());
|
||||
#endif
|
||||
qDebug("Received a tracker reply from %s (Num_peers = %d)", qPrintable(trackerUrl), p->num_peers);
|
||||
qDebug("Received a tracker reply from %s (Num_peers = %d)", qUtf8Printable(trackerUrl), p->num_peers);
|
||||
// Connection was successful now. Remove possible old errors
|
||||
m_trackerInfos[trackerUrl].lastMessage.clear(); // Reset error/warning message
|
||||
m_trackerInfos[trackerUrl].numPeers = p->num_peers;
|
||||
@@ -1563,7 +1513,7 @@ void TorrentHandle::handleTrackerWarningAlert(libtorrent::tracker_warning_alert
|
||||
QString trackerUrl(p->tracker_url());
|
||||
QString message = QString::fromStdString(p->message());
|
||||
#endif
|
||||
qDebug("Received a tracker warning for %s: %s", qPrintable(trackerUrl), qPrintable(message));
|
||||
qDebug("Received a tracker warning for %s: %s", qUtf8Printable(trackerUrl), qUtf8Printable(message));
|
||||
// Connection was successful now but there is a warning message
|
||||
m_trackerInfos[trackerUrl].lastMessage = message; // Store warning message
|
||||
|
||||
@@ -1579,7 +1529,7 @@ void TorrentHandle::handleTrackerErrorAlert(libtorrent::tracker_error_alert *p)
|
||||
QString trackerUrl(p->tracker_url());
|
||||
QString message = QString::fromStdString(p->message());
|
||||
#endif
|
||||
qDebug("Received a tracker error for %s: %s", qPrintable(trackerUrl), qPrintable(message));
|
||||
qDebug("Received a tracker error for %s: %s", qUtf8Printable(trackerUrl), qUtf8Printable(message));
|
||||
m_trackerInfos[trackerUrl].lastMessage = message;
|
||||
|
||||
if (p->status_code == 401)
|
||||
@@ -1591,7 +1541,7 @@ void TorrentHandle::handleTrackerErrorAlert(libtorrent::tracker_error_alert *p)
|
||||
void TorrentHandle::handleTorrentCheckedAlert(libtorrent::torrent_checked_alert *p)
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
qDebug("%s have just finished checking", qPrintable(hash()));
|
||||
qDebug("%s have just finished checking", qUtf8Printable(hash()));
|
||||
|
||||
updateStatus();
|
||||
|
||||
@@ -1614,7 +1564,7 @@ void TorrentHandle::handleTorrentCheckedAlert(libtorrent::torrent_checked_alert
|
||||
void TorrentHandle::handleTorrentFinishedAlert(libtorrent::torrent_finished_alert *p)
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
qDebug("Got a torrent finished alert for %s", qPrintable(name()));
|
||||
qDebug("Got a torrent finished alert for %s", qUtf8Printable(name()));
|
||||
qDebug("Torrent has seed status: %s", m_hasSeedStatus ? "yes" : "no");
|
||||
if (m_hasSeedStatus) return;
|
||||
|
||||
@@ -1673,8 +1623,8 @@ void TorrentHandle::handleSaveResumeDataAlert(libtorrent::save_resume_data_alert
|
||||
resumeData["save_path"] = Profile::instance().toPortablePath(QString::fromStdString(savePath)).toStdString();
|
||||
}
|
||||
resumeData["qBt-savePath"] = m_useAutoTMM ? "" : Profile::instance().toPortablePath(m_savePath).toStdString();
|
||||
resumeData["qBt-ratioLimit"] = QString::number(m_ratioLimit).toStdString();
|
||||
resumeData["qBt-seedingTimeLimit"] = QString::number(m_seedingTimeLimit).toStdString();
|
||||
resumeData["qBt-ratioLimit"] = static_cast<int>(m_ratioLimit * 1000);
|
||||
resumeData["qBt-seedingTimeLimit"] = m_seedingTimeLimit;
|
||||
resumeData["qBt-category"] = m_category.toStdString();
|
||||
resumeData["qBt-tags"] = setToEntryList(m_tags);
|
||||
resumeData["qBt-name"] = m_name.toStdString();
|
||||
@@ -1698,20 +1648,20 @@ void TorrentHandle::handleSaveResumeDataFailedAlert(libtorrent::save_resume_data
|
||||
|
||||
void TorrentHandle::handleFastResumeRejectedAlert(libtorrent::fastresume_rejected_alert *p)
|
||||
{
|
||||
qDebug("/!\\ Fast resume failed for %s, reason: %s", qPrintable(name()), p->message().c_str());
|
||||
qDebug("/!\\ Fast resume failed for %s, reason: %s", qUtf8Printable(name()), p->message().c_str());
|
||||
Logger *const logger = Logger::instance();
|
||||
|
||||
updateStatus();
|
||||
if (p->error.value() == libt::errors::mismatching_file_size) {
|
||||
// Mismatching file size (files were probably moved)
|
||||
logger->addMessage(tr("File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL);
|
||||
logger->addMessage(QCoreApplication::translate(i18nContext, "File sizes mismatch for torrent '%1', pausing it.").arg(name()), Log::CRITICAL);
|
||||
m_hasMissingFiles = true;
|
||||
if (!isPaused())
|
||||
pause();
|
||||
}
|
||||
else {
|
||||
logger->addMessage(tr("Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
|
||||
.arg(name()).arg(QString::fromStdString(p->message())), Log::CRITICAL);
|
||||
logger->addMessage(QCoreApplication::translate(i18nContext, "Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
|
||||
.arg(name(), QString::fromStdString(p->message())), Log::CRITICAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1733,9 +1683,9 @@ void TorrentHandle::handleFileRenamedAlert(libtorrent::file_renamed_alert *p)
|
||||
newPathParts.removeLast();
|
||||
QString newPath = newPathParts.join("/");
|
||||
if (!newPathParts.isEmpty() && (oldPath != newPath)) {
|
||||
qDebug("oldPath(%s) != newPath(%s)", qPrintable(oldPath), qPrintable(newPath));
|
||||
oldPath = QString("%1/%2").arg(savePath(true)).arg(oldPath);
|
||||
qDebug("Detected folder renaming, attempt to delete old folder: %s", qPrintable(oldPath));
|
||||
qDebug("oldPath(%s) != newPath(%s)", qUtf8Printable(oldPath), qUtf8Printable(newPath));
|
||||
oldPath = QString("%1/%2").arg(savePath(true), oldPath);
|
||||
qDebug("Detected folder renaming, attempt to delete old folder: %s", qUtf8Printable(oldPath));
|
||||
QDir().rmpath(oldPath);
|
||||
}
|
||||
}
|
||||
@@ -1760,13 +1710,13 @@ void TorrentHandle::handleFileCompletedAlert(libtorrent::file_completed_alert *p
|
||||
{
|
||||
updateStatus();
|
||||
|
||||
qDebug("A file completed download in torrent \"%s\"", qPrintable(name()));
|
||||
qDebug("A file completed download in torrent \"%s\"", qUtf8Printable(name()));
|
||||
if (m_session->isAppendExtensionEnabled()) {
|
||||
QString name = filePath(p->index);
|
||||
if (name.endsWith(QB_EXT)) {
|
||||
const QString oldName = name;
|
||||
name.chop(QB_EXT.size());
|
||||
qDebug("Renaming %s to %s", qPrintable(oldName), qPrintable(name));
|
||||
qDebug("Renaming %s to %s", qUtf8Printable(oldName), qUtf8Printable(name));
|
||||
renameFile(p->index, name);
|
||||
}
|
||||
}
|
||||
@@ -1783,7 +1733,7 @@ void TorrentHandle::handleStatsAlert(libtorrent::stats_alert *p)
|
||||
void TorrentHandle::handleMetadataReceivedAlert(libt::metadata_received_alert *p)
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
qDebug("Metadata received for torrent %s.", qPrintable(name()));
|
||||
qDebug("Metadata received for torrent %s.", qUtf8Printable(name()));
|
||||
updateStatus();
|
||||
if (m_session->isAppendExtensionEnabled())
|
||||
manageIncompleteFiles();
|
||||
@@ -1816,7 +1766,7 @@ void TorrentHandle::handleTempPathChanged()
|
||||
void TorrentHandle::handleCategorySavePathChanged()
|
||||
{
|
||||
if (m_useAutoTMM)
|
||||
move_impl(m_session->categorySavePath(m_category));
|
||||
move_impl(m_session->categorySavePath(m_category), true);
|
||||
}
|
||||
|
||||
void TorrentHandle::handleAppendExtensionToggled()
|
||||
@@ -1926,12 +1876,12 @@ void TorrentHandle::adjustActualSavePath_impl()
|
||||
path = savePath();
|
||||
}
|
||||
else {
|
||||
// Moving all downloading torrents to temporary save path
|
||||
path = m_session->torrentTempPath(hash());
|
||||
qDebug() << "Moving torrent to its temp save path:" << path;
|
||||
// Moving all downloading torrents to temporary folder
|
||||
path = m_session->torrentTempPath(info());
|
||||
qDebug() << "Moving torrent to its temporary folder:" << path;
|
||||
}
|
||||
|
||||
moveStorage(Utils::Fs::toNativePath(path));
|
||||
moveStorage(Utils::Fs::toNativePath(path), true);
|
||||
}
|
||||
|
||||
libtorrent::torrent_handle TorrentHandle::nativeHandle() const
|
||||
@@ -1951,7 +1901,7 @@ void TorrentHandle::updateTorrentInfo()
|
||||
|
||||
bool TorrentHandle::isMoveInProgress() const
|
||||
{
|
||||
return !m_newPath.isEmpty();
|
||||
return !m_moveStorageInfo.newPath.isEmpty();
|
||||
}
|
||||
|
||||
bool TorrentHandle::useTempPath() const
|
||||
|
||||
@@ -104,6 +104,8 @@ namespace BitTorrent
|
||||
bool hasRootFolder;
|
||||
bool addForced;
|
||||
bool addPaused;
|
||||
int uploadLimit;
|
||||
int downloadLimit;
|
||||
// for new torrents
|
||||
QVector<int> filePriorities;
|
||||
// for resumed torrents
|
||||
@@ -120,48 +122,35 @@ namespace BitTorrent
|
||||
quint32 numPeers = 0;
|
||||
};
|
||||
|
||||
class TorrentState
|
||||
enum class TorrentState
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
Unknown = -1,
|
||||
Unknown = -1,
|
||||
|
||||
ForcedDownloading,
|
||||
Downloading,
|
||||
DownloadingMetadata,
|
||||
Allocating,
|
||||
StalledDownloading,
|
||||
ForcedDownloading,
|
||||
Downloading,
|
||||
DownloadingMetadata,
|
||||
Allocating,
|
||||
StalledDownloading,
|
||||
|
||||
ForcedUploading,
|
||||
Uploading,
|
||||
StalledUploading,
|
||||
|
||||
QueuedDownloading,
|
||||
QueuedUploading,
|
||||
|
||||
CheckingUploading,
|
||||
CheckingDownloading,
|
||||
ForcedUploading,
|
||||
Uploading,
|
||||
StalledUploading,
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
QueuedForChecking,
|
||||
QueuedForChecking,
|
||||
#endif
|
||||
CheckingResumeData,
|
||||
CheckingResumeData,
|
||||
QueuedDownloading,
|
||||
QueuedUploading,
|
||||
|
||||
PausedDownloading,
|
||||
PausedUploading,
|
||||
CheckingUploading,
|
||||
CheckingDownloading,
|
||||
|
||||
MissingFiles,
|
||||
Error
|
||||
};
|
||||
PausedDownloading,
|
||||
PausedUploading,
|
||||
|
||||
TorrentState(int value);
|
||||
|
||||
operator int() const;
|
||||
QString toString() const;
|
||||
|
||||
private:
|
||||
int m_value;
|
||||
MissingFiles,
|
||||
Error
|
||||
};
|
||||
|
||||
class TorrentHandle : public QObject
|
||||
@@ -244,6 +233,8 @@ namespace BitTorrent
|
||||
QString rootPath(bool actual = false) const;
|
||||
QString contentPath(bool actual = false) const;
|
||||
|
||||
bool useTempPath() const;
|
||||
|
||||
bool isAutoTMMEnabled() const;
|
||||
void setAutoTMMEnabled(bool enabled);
|
||||
QString category() const;
|
||||
@@ -326,8 +317,8 @@ namespace BitTorrent
|
||||
QBitArray downloadingPieces() const;
|
||||
QVector<int> pieceAvailability() const;
|
||||
qreal distributedCopies() const;
|
||||
qreal maxRatio(bool *usesGlobalRatio = 0) const;
|
||||
int maxSeedingTime(bool *usesGlobalSeedingTime = 0) const;
|
||||
qreal maxRatio() const;
|
||||
int maxSeedingTime() const;
|
||||
qreal realRatio() const;
|
||||
int uploadPayloadRate() const;
|
||||
int downloadPayloadRate() const;
|
||||
@@ -415,14 +406,14 @@ namespace BitTorrent
|
||||
void handleMetadataReceivedAlert(libtorrent::metadata_received_alert *p);
|
||||
void handleStatsAlert(libtorrent::stats_alert *p);
|
||||
|
||||
void resume_impl(bool forced, bool uploadMode);
|
||||
bool isMoveInProgress() const;
|
||||
bool useTempPath() const;
|
||||
QString nativeActualSavePath() const;
|
||||
|
||||
void adjustActualSavePath();
|
||||
void adjustActualSavePath_impl();
|
||||
void move_impl(QString path);
|
||||
void moveStorage(const QString &newPath);
|
||||
void move_impl(QString path, bool overwrite);
|
||||
void moveStorage(const QString &newPath, bool overwrite);
|
||||
void manageIncompleteFiles();
|
||||
bool addTracker(const TrackerEntry &tracker);
|
||||
bool addUrlSeed(const QUrl &urlSeed);
|
||||
@@ -437,11 +428,16 @@ namespace BitTorrent
|
||||
|
||||
InfoHash m_hash;
|
||||
|
||||
QString m_oldPath;
|
||||
QString m_newPath;
|
||||
// m_queuedPath is where files should be moved to,
|
||||
// when current moving is completed
|
||||
QString m_queuedPath;
|
||||
struct
|
||||
{
|
||||
QString oldPath;
|
||||
QString newPath;
|
||||
// queuedPath is where files should be moved to,
|
||||
// when current moving is completed
|
||||
QString queuedPath;
|
||||
bool queuedOverwrite = true;
|
||||
} m_moveStorageInfo;
|
||||
|
||||
// m_moveFinishedTriggers is activated only when the following conditions are met:
|
||||
// all file rename jobs complete, all file move jobs complete
|
||||
QQueue<EventTrigger> m_moveFinishedTriggers;
|
||||
@@ -468,4 +464,6 @@ namespace BitTorrent
|
||||
};
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(BitTorrent::TorrentState)
|
||||
|
||||
#endif // BITTORRENT_TORRENTHANDLE_H
|
||||
|
||||
@@ -60,23 +60,77 @@ TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
TorrentInfo TorrentInfo::loadFromFile(const QString &path, QString &error)
|
||||
TorrentInfo TorrentInfo::load(const QByteArray &data, QString *error) noexcept
|
||||
{
|
||||
error.clear();
|
||||
libt::error_code ec;
|
||||
TorrentInfo info(NativePtr(new libt::torrent_info(Utils::Fs::toNativePath(path).toStdString(), ec)));
|
||||
if (ec) {
|
||||
error = QString::fromUtf8(ec.message().c_str());
|
||||
qDebug("Cannot load .torrent file: %s", qPrintable(error));
|
||||
TorrentInfo info(NativePtr(new libt::torrent_info(data.constData(), data.size(), ec)));
|
||||
if (error) {
|
||||
if (ec)
|
||||
*error = QString::fromStdString(ec.message());
|
||||
else
|
||||
error->clear();
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
TorrentInfo TorrentInfo::loadFromFile(const QString &path)
|
||||
TorrentInfo TorrentInfo::loadFromFile(const QString &path, QString *error) noexcept
|
||||
{
|
||||
QString error;
|
||||
return loadFromFile(path, error);
|
||||
if (error)
|
||||
error->clear();
|
||||
|
||||
QFile file {path};
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
if (error)
|
||||
*error = file.errorString();
|
||||
return TorrentInfo();
|
||||
}
|
||||
|
||||
const qint64 fileSizeLimit = 100 * 1024 * 1024; // 100 MB
|
||||
if (file.size() > fileSizeLimit) {
|
||||
if (error)
|
||||
*error = tr("File size exceeds max limit %1").arg(fileSizeLimit);
|
||||
return TorrentInfo();
|
||||
}
|
||||
|
||||
const QByteArray data = file.read(fileSizeLimit);
|
||||
if (data.size() != file.size()) {
|
||||
if (error)
|
||||
*error = tr("Torrent file read error");
|
||||
return TorrentInfo();
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
// 2-step construction to overcome default limits of `depth_limit` & `token_limit` which are
|
||||
// used in `torrent_info()` constructor
|
||||
const int depthLimit = 100;
|
||||
const int tokenLimit = 10000000;
|
||||
libt::error_code ec;
|
||||
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
libt::lazy_entry node;
|
||||
libt::lazy_bdecode(data.constData(), (data.constData() + data.size()), node, ec
|
||||
, nullptr, depthLimit, tokenLimit);
|
||||
#else
|
||||
libt::bdecode_node node;
|
||||
bdecode(data.constData(), (data.constData() + data.size()), node, ec
|
||||
, nullptr, depthLimit, tokenLimit);
|
||||
#endif
|
||||
if (ec) {
|
||||
if (error)
|
||||
*error = QString::fromStdString(ec.message());
|
||||
return TorrentInfo();
|
||||
}
|
||||
|
||||
TorrentInfo info {NativePtr(new libt::torrent_info(node, ec))};
|
||||
if (ec) {
|
||||
if (error)
|
||||
*error = QString::fromStdString(ec.message());
|
||||
return TorrentInfo();
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
bool TorrentInfo::isValid() const
|
||||
@@ -308,9 +362,29 @@ int BitTorrent::TorrentInfo::fileIndex(const QString& fileName) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool TorrentInfo::hasRootFolder() const
|
||||
{
|
||||
QString testRootFolder;
|
||||
for (int i = 0; i < filesCount(); ++i) {
|
||||
const QString filePath = this->filePath(i);
|
||||
if (QDir::isAbsolutePath(filePath)) continue;
|
||||
|
||||
const auto filePathElements = filePath.splitRef('/');
|
||||
// if at least one file has no root folder, no common root folder exists
|
||||
if (filePathElements.count() <= 1) return false;
|
||||
|
||||
if (testRootFolder.isEmpty())
|
||||
testRootFolder = filePathElements.at(0).toString();
|
||||
else if (testRootFolder != filePathElements.at(0))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void TorrentInfo::stripRootFolder()
|
||||
{
|
||||
if (filesCount() <= 1) return;
|
||||
if (!hasRootFolder()) return;
|
||||
|
||||
libtorrent::file_storage files = m_nativeInfo->files();
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#ifndef BITTORRENT_TORRENTINFO_H
|
||||
#define BITTORRENT_TORRENTINFO_H
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <libtorrent/torrent_info.hpp>
|
||||
@@ -51,6 +52,8 @@ namespace BitTorrent
|
||||
|
||||
class TorrentInfo
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS("TorrentInfo")
|
||||
|
||||
public:
|
||||
#if LIBTORRENT_VERSION_NUM < 10100
|
||||
typedef boost::intrusive_ptr<const libtorrent::torrent_info> NativeConstPtr;
|
||||
@@ -63,8 +66,8 @@ namespace BitTorrent
|
||||
explicit TorrentInfo(NativeConstPtr nativeInfo = NativeConstPtr());
|
||||
TorrentInfo(const TorrentInfo &other);
|
||||
|
||||
static TorrentInfo loadFromFile(const QString &path, QString &error);
|
||||
static TorrentInfo loadFromFile(const QString &path);
|
||||
static TorrentInfo load(const QByteArray &data, QString *error = nullptr) noexcept;
|
||||
static TorrentInfo loadFromFile(const QString &path, QString *error = nullptr) noexcept;
|
||||
|
||||
TorrentInfo &operator=(const TorrentInfo &other);
|
||||
|
||||
@@ -100,6 +103,8 @@ namespace BitTorrent
|
||||
PieceRange filePieces(int fileIndex) const;
|
||||
|
||||
void renameFile(uint index, const QString &newPath);
|
||||
|
||||
bool hasRootFolder() const;
|
||||
void stripRootFolder();
|
||||
|
||||
NativePtr nativeInfo() const;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt4 and libtorrent.
|
||||
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2006 Christophe Dumez
|
||||
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -25,16 +25,17 @@
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <libtorrent/bencode.hpp>
|
||||
#include <libtorrent/entry.hpp>
|
||||
|
||||
#include "base/preferences.h"
|
||||
#include "base/global.h"
|
||||
#include "base/http/server.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/utils/bytearray.h"
|
||||
#include "base/utils/string.h"
|
||||
#include "tracker.h"
|
||||
|
||||
@@ -75,7 +76,7 @@ libtorrent::entry Peer::toEntry(bool noPeerId) const
|
||||
// Tracker
|
||||
|
||||
Tracker::Tracker(QObject *parent)
|
||||
: Http::ResponseBuilder(parent)
|
||||
: QObject(parent)
|
||||
, m_server(new Http::Server(this, this))
|
||||
{
|
||||
}
|
||||
@@ -109,14 +110,14 @@ Http::Response Tracker::processRequest(const Http::Request &request, const Http:
|
||||
{
|
||||
clear(); // clear response
|
||||
|
||||
//qDebug("Tracker received the following request:\n%s", qPrintable(parser.toString()));
|
||||
//qDebug("Tracker received the following request:\n%s", qUtf8Printable(parser.toString()));
|
||||
// Is request a GET request?
|
||||
if (request.method != "GET") {
|
||||
qDebug("Tracker: Unsupported HTTP request: %s", qPrintable(request.method));
|
||||
qDebug("Tracker: Unsupported HTTP request: %s", qUtf8Printable(request.method));
|
||||
status(100, "Invalid request type");
|
||||
}
|
||||
else if (!request.path.startsWith("/announce", Qt::CaseInsensitive)) {
|
||||
qDebug("Tracker: Unrecognized path: %s", qPrintable(request.path));
|
||||
qDebug("Tracker: Unrecognized path: %s", qUtf8Printable(request.path));
|
||||
status(100, "Invalid request type");
|
||||
}
|
||||
else {
|
||||
@@ -131,49 +132,60 @@ Http::Response Tracker::processRequest(const Http::Request &request, const Http:
|
||||
|
||||
void Tracker::respondToAnnounceRequest()
|
||||
{
|
||||
const QStringMap &gets = m_request.gets;
|
||||
QMap<QString, QByteArray> queryParams;
|
||||
// Parse GET parameters
|
||||
using namespace Utils::ByteArray;
|
||||
for (const QByteArray ¶m : copyAsConst(splitToViews(m_request.query, "&"))) {
|
||||
const int sepPos = param.indexOf('=');
|
||||
if (sepPos <= 0) continue; // ignores params without name
|
||||
|
||||
const QString paramName {QString::fromUtf8(param.constData(), sepPos)};
|
||||
const QByteArray paramValue {param.mid(sepPos + 1)};
|
||||
queryParams[paramName] = paramValue;
|
||||
}
|
||||
|
||||
TrackerAnnounceRequest annonceReq;
|
||||
|
||||
// IP
|
||||
annonceReq.peer.ip = m_env.clientAddress.toString();
|
||||
|
||||
// 1. Get info_hash
|
||||
if (!gets.contains("info_hash")) {
|
||||
if (!queryParams.contains("info_hash")) {
|
||||
qDebug("Tracker: Missing info_hash");
|
||||
status(101, "Missing info_hash");
|
||||
return;
|
||||
}
|
||||
annonceReq.infoHash = gets.value("info_hash");
|
||||
annonceReq.infoHash = queryParams.value("info_hash");
|
||||
// info_hash cannot be longer than 20 bytes
|
||||
/*if (annonce_req.info_hash.toLatin1().length() > 20) {
|
||||
qDebug("Tracker: Info_hash is not 20 byte long: %s (%d)", qPrintable(annonce_req.info_hash), annonce_req.info_hash.toLatin1().length());
|
||||
qDebug("Tracker: Info_hash is not 20 byte long: %s (%d)", qUtf8Printable(annonce_req.info_hash), annonce_req.info_hash.toLatin1().length());
|
||||
status(150, "Invalid infohash");
|
||||
return;
|
||||
}*/
|
||||
|
||||
// 2. Get peer ID
|
||||
if (!gets.contains("peer_id")) {
|
||||
if (!queryParams.contains("peer_id")) {
|
||||
qDebug("Tracker: Missing peer_id");
|
||||
status(102, "Missing peer_id");
|
||||
return;
|
||||
}
|
||||
annonceReq.peer.peerId = gets.value("peer_id");
|
||||
annonceReq.peer.peerId = queryParams.value("peer_id");
|
||||
// peer_id cannot be longer than 20 bytes
|
||||
/*if (annonce_req.peer.peer_id.length() > 20) {
|
||||
qDebug("Tracker: peer_id is not 20 byte long: %s", qPrintable(annonce_req.peer.peer_id));
|
||||
qDebug("Tracker: peer_id is not 20 byte long: %s", qUtf8Printable(annonce_req.peer.peer_id));
|
||||
status(151, "Invalid peerid");
|
||||
return;
|
||||
}*/
|
||||
|
||||
// 3. Get port
|
||||
if (!gets.contains("port")) {
|
||||
if (!queryParams.contains("port")) {
|
||||
qDebug("Tracker: Missing port");
|
||||
status(103, "Missing port");
|
||||
return;
|
||||
}
|
||||
bool ok = false;
|
||||
annonceReq.peer.port = gets.value("port").toInt(&ok);
|
||||
if (!ok || annonceReq.peer.port < 1 || annonceReq.peer.port > 65535) {
|
||||
annonceReq.peer.port = queryParams.value("port").toInt(&ok);
|
||||
if (!ok || (annonceReq.peer.port < 0) || (annonceReq.peer.port > 65535)) {
|
||||
qDebug("Tracker: Invalid port number (%d)", annonceReq.peer.port);
|
||||
status(103, "Missing port");
|
||||
return;
|
||||
@@ -181,15 +193,15 @@ void Tracker::respondToAnnounceRequest()
|
||||
|
||||
// 4. Get event
|
||||
annonceReq.event = "";
|
||||
if (gets.contains("event")) {
|
||||
annonceReq.event = gets.value("event");
|
||||
qDebug("Tracker: event is %s", qPrintable(annonceReq.event));
|
||||
if (queryParams.contains("event")) {
|
||||
annonceReq.event = queryParams.value("event");
|
||||
qDebug("Tracker: event is %s", qUtf8Printable(annonceReq.event));
|
||||
}
|
||||
|
||||
// 5. Get numwant
|
||||
annonceReq.numwant = 50;
|
||||
if (gets.contains("numwant")) {
|
||||
int tmp = gets.value("numwant").toInt();
|
||||
if (queryParams.contains("numwant")) {
|
||||
int tmp = queryParams.value("numwant").toInt();
|
||||
if (tmp > 0) {
|
||||
qDebug("Tracker: numwant = %d", tmp);
|
||||
annonceReq.numwant = tmp;
|
||||
@@ -198,37 +210,51 @@ void Tracker::respondToAnnounceRequest()
|
||||
|
||||
// 6. no_peer_id (extension)
|
||||
annonceReq.noPeerId = false;
|
||||
if (gets.contains("no_peer_id"))
|
||||
if (queryParams.contains("no_peer_id"))
|
||||
annonceReq.noPeerId = true;
|
||||
|
||||
// 7. TODO: support "compact" extension
|
||||
|
||||
// Done parsing, now let's reply
|
||||
if (m_torrents.contains(annonceReq.infoHash)) {
|
||||
if (annonceReq.event == "stopped") {
|
||||
qDebug("Tracker: Peer stopped downloading, deleting it from the list");
|
||||
m_torrents[annonceReq.infoHash].remove(annonceReq.peer.uid());
|
||||
return;
|
||||
}
|
||||
if (annonceReq.event == "stopped") {
|
||||
unregisterPeer(annonceReq);
|
||||
}
|
||||
else {
|
||||
registerPeer(annonceReq);
|
||||
replyWithPeerList(annonceReq);
|
||||
}
|
||||
}
|
||||
|
||||
void Tracker::registerPeer(const TrackerAnnounceRequest &annonceReq)
|
||||
{
|
||||
if (annonceReq.peer.port == 0) return;
|
||||
|
||||
if (!m_torrents.contains(annonceReq.infoHash)) {
|
||||
// Unknown torrent
|
||||
if (m_torrents.size() == MAX_TORRENTS) {
|
||||
// Reached max size, remove a random torrent
|
||||
m_torrents.erase(m_torrents.begin());
|
||||
}
|
||||
}
|
||||
|
||||
// Register the user
|
||||
PeerList peers = m_torrents.value(annonceReq.infoHash);
|
||||
if (peers.size() == MAX_PEERS_PER_TORRENT) {
|
||||
// Too many peers, remove a random one
|
||||
peers.erase(peers.begin());
|
||||
PeerList &peers = m_torrents[annonceReq.infoHash];
|
||||
if (!peers.contains(annonceReq.peer.uid())) {
|
||||
// Unknown peer
|
||||
if (peers.size() == MAX_PEERS_PER_TORRENT) {
|
||||
// Too many peers, remove a random one
|
||||
peers.erase(peers.begin());
|
||||
}
|
||||
}
|
||||
peers[annonceReq.peer.uid()] = annonceReq.peer;
|
||||
m_torrents[annonceReq.infoHash] = peers;
|
||||
}
|
||||
|
||||
// Reply
|
||||
replyWithPeerList(annonceReq);
|
||||
void Tracker::unregisterPeer(const TrackerAnnounceRequest &annonceReq)
|
||||
{
|
||||
if (annonceReq.peer.port == 0) return;
|
||||
|
||||
if (m_torrents[annonceReq.infoHash].remove(annonceReq.peer.uid()) > 0)
|
||||
qDebug("Tracker: Peer stopped downloading, deleting it from the list");
|
||||
}
|
||||
|
||||
void Tracker::replyWithPeerList(const TrackerAnnounceRequest &annonceReq)
|
||||
@@ -236,18 +262,16 @@ void Tracker::replyWithPeerList(const TrackerAnnounceRequest &annonceReq)
|
||||
// Prepare the entry for bencoding
|
||||
libtorrent::entry::dictionary_type replyDict;
|
||||
replyDict["interval"] = libtorrent::entry(ANNOUNCE_INTERVAL);
|
||||
QList<Peer> peers = m_torrents.value(annonceReq.infoHash).values();
|
||||
|
||||
libtorrent::entry::list_type peerList;
|
||||
foreach (const Peer &p, peers) {
|
||||
//if (p != annonce_req.peer)
|
||||
for (const Peer &p : m_torrents.value(annonceReq.infoHash))
|
||||
peerList.push_back(p.toEntry(annonceReq.noPeerId));
|
||||
}
|
||||
replyDict["peers"] = libtorrent::entry(peerList);
|
||||
libtorrent::entry replyEntry(replyDict);
|
||||
|
||||
const libtorrent::entry replyEntry(replyDict);
|
||||
// bencode
|
||||
std::vector<char> buf;
|
||||
libtorrent::bencode(std::back_inserter(buf), replyEntry);
|
||||
QByteArray reply(&buf[0], static_cast<int>(buf.size()));
|
||||
QByteArray reply;
|
||||
libtorrent::bencode(std::back_inserter(reply), replyEntry);
|
||||
qDebug("Tracker: reply with the following bencoded data:\n %s", reply.constData());
|
||||
|
||||
// HTTP reply
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2010 Christophe Dumez
|
||||
* Copyright (C) 2010 Christophe Dumez <chris@qbittorrent.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -25,17 +25,17 @@
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#ifndef BITTORRENT_TRACKER_H
|
||||
#define BITTORRENT_TRACKER_H
|
||||
|
||||
#include <QHash>
|
||||
#include "base/http/types.h"
|
||||
#include "base/http/responsebuilder.h"
|
||||
#include <QObject>
|
||||
|
||||
#include "base/http/irequesthandler.h"
|
||||
#include "base/http/responsebuilder.h"
|
||||
#include "base/http/types.h"
|
||||
|
||||
namespace libtorrent
|
||||
{
|
||||
@@ -52,7 +52,7 @@ namespace BitTorrent
|
||||
struct Peer
|
||||
{
|
||||
QString ip;
|
||||
QString peerId;
|
||||
QByteArray peerId;
|
||||
int port;
|
||||
|
||||
bool operator!=(const Peer &other) const;
|
||||
@@ -63,7 +63,7 @@ namespace BitTorrent
|
||||
|
||||
struct TrackerAnnounceRequest
|
||||
{
|
||||
QString infoHash;
|
||||
QByteArray infoHash;
|
||||
QString event;
|
||||
int numwant;
|
||||
Peer peer;
|
||||
@@ -72,17 +72,17 @@ namespace BitTorrent
|
||||
};
|
||||
|
||||
typedef QHash<QString, Peer> PeerList;
|
||||
typedef QHash<QString, PeerList> TorrentList;
|
||||
typedef QHash<QByteArray, PeerList> TorrentList;
|
||||
|
||||
/* Basic Bittorrent tracker implementation in Qt */
|
||||
/* Following http://wiki.theory.org/BitTorrent_Tracker_Protocol */
|
||||
class Tracker : public Http::ResponseBuilder, public Http::IRequestHandler
|
||||
class Tracker : public QObject, public Http::IRequestHandler, private Http::ResponseBuilder
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(Tracker)
|
||||
|
||||
public:
|
||||
explicit Tracker(QObject *parent = 0);
|
||||
explicit Tracker(QObject *parent = nullptr);
|
||||
~Tracker();
|
||||
|
||||
bool start();
|
||||
@@ -90,6 +90,8 @@ namespace BitTorrent
|
||||
|
||||
private:
|
||||
void respondToAnnounceRequest();
|
||||
void registerPeer(const TrackerAnnounceRequest &annonceReq);
|
||||
void unregisterPeer(const TrackerAnnounceRequest &annonceReq);
|
||||
void replyWithPeerList(const TrackerAnnounceRequest &annonceReq);
|
||||
|
||||
Http::Server *m_server;
|
||||
|
||||
40
src/base/exceptions.cpp
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2018 Vladimir Golovnev <glassez@yandex.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include "exceptions.h"
|
||||
|
||||
RuntimeError::RuntimeError(const QString &message)
|
||||
: std::runtime_error {message.toUtf8().data()}
|
||||
, m_message {message}
|
||||
{
|
||||
}
|
||||
|
||||
QString RuntimeError::message() const
|
||||
{
|
||||
return m_message;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt4 and libtorrent.
|
||||
* Copyright (C) 2006-2012 Ishan Arora and Christophe Dumez
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2018 Vladimir Golovnev <glassez@yandex.ru>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -24,24 +24,19 @@
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*
|
||||
* Contact : chris@qbittorrent.org
|
||||
*/
|
||||
|
||||
#ifndef PREFJSON_H
|
||||
#define PREFJSON_H
|
||||
#pragma once
|
||||
|
||||
#include <stdexcept>
|
||||
#include <QString>
|
||||
|
||||
class prefjson
|
||||
class RuntimeError : public std::runtime_error
|
||||
{
|
||||
private:
|
||||
prefjson();
|
||||
|
||||
public:
|
||||
static QByteArray getPreferences();
|
||||
static void setPreferences(const QString& json);
|
||||
explicit RuntimeError(const QString &message = "");
|
||||
QString message() const;
|
||||
|
||||
private:
|
||||
const QString m_message;
|
||||
};
|
||||
|
||||
#endif // PREFJSON_H
|
||||
@@ -1,176 +1,161 @@
|
||||
#include <QtGlobal>
|
||||
#ifndef Q_OS_WIN
|
||||
#include <QSet>
|
||||
#include <iostream>
|
||||
#include <errno.h>
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_FREEBSD)
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#include <string.h>
|
||||
#elif !defined Q_OS_HAIKU
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
#endif
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2018
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
||||
* modified versions of it that use the same license as the "OpenSSL" library),
|
||||
* and distribute the linked executables. You must obey the GNU General Public
|
||||
* License in all respects for all of the code used other than "OpenSSL". If you
|
||||
* modify file(s), you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete this
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include "base/preferences.h"
|
||||
#include "base/bittorrent/torrentinfo.h"
|
||||
#include "base/bittorrent/magneturi.h"
|
||||
#include "filesystemwatcher.h"
|
||||
|
||||
#ifndef CIFS_MAGIC_NUMBER
|
||||
#define CIFS_MAGIC_NUMBER 0xFF534D42
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_FREEBSD)
|
||||
#include <cstring>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#ifndef NFS_SUPER_MAGIC
|
||||
#define NFS_SUPER_MAGIC 0x6969
|
||||
#endif
|
||||
#include <QtGlobal>
|
||||
|
||||
#ifndef SMB_SUPER_MAGIC
|
||||
#define SMB_SUPER_MAGIC 0x517B
|
||||
#endif
|
||||
#include "base/algorithm.h"
|
||||
#include "base/bittorrent/magneturi.h"
|
||||
#include "base/bittorrent/torrentinfo.h"
|
||||
#include "base/global.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/utils/fs.h"
|
||||
|
||||
const int WATCH_INTERVAL = 10000; // 10 sec
|
||||
const int MAX_PARTIAL_RETRIES = 5;
|
||||
namespace
|
||||
{
|
||||
const int WATCH_INTERVAL = 10000; // 10 sec
|
||||
const int MAX_PARTIAL_RETRIES = 5;
|
||||
}
|
||||
|
||||
FileSystemWatcher::FileSystemWatcher(QObject *parent)
|
||||
: QFileSystemWatcher(parent)
|
||||
{
|
||||
m_filters << "*.torrent" << "*.magnet";
|
||||
connect(this, SIGNAL(directoryChanged(QString)), SLOT(scanLocalFolder(QString)));
|
||||
}
|
||||
connect(this, &QFileSystemWatcher::directoryChanged, this, &FileSystemWatcher::scanLocalFolder);
|
||||
|
||||
m_partialTorrentTimer.setSingleShot(true);
|
||||
connect(&m_partialTorrentTimer, &QTimer::timeout, this, &FileSystemWatcher::processPartialTorrents);
|
||||
|
||||
FileSystemWatcher::~FileSystemWatcher()
|
||||
{
|
||||
#ifndef Q_OS_WIN
|
||||
if (m_watchTimer)
|
||||
delete m_watchTimer;
|
||||
connect(&m_watchTimer, &QTimer::timeout, this, &FileSystemWatcher::scanNetworkFolders);
|
||||
#endif
|
||||
if (m_partialTorrentTimer)
|
||||
delete m_partialTorrentTimer;
|
||||
}
|
||||
|
||||
QStringList FileSystemWatcher::directories() const
|
||||
{
|
||||
QStringList dirs;
|
||||
QStringList dirs = QFileSystemWatcher::directories();
|
||||
#ifndef Q_OS_WIN
|
||||
if (m_watchTimer) {
|
||||
foreach (const QDir &dir, m_watchedFolders)
|
||||
dirs << dir.canonicalPath();
|
||||
}
|
||||
for (const QDir &dir : qAsConst(m_watchedFolders))
|
||||
dirs << dir.canonicalPath();
|
||||
#endif
|
||||
dirs << QFileSystemWatcher::directories();
|
||||
return dirs;
|
||||
}
|
||||
|
||||
void FileSystemWatcher::addPath(const QString &path)
|
||||
{
|
||||
if (path.isEmpty()) return;
|
||||
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
QDir dir(path);
|
||||
const QDir dir(path);
|
||||
if (!dir.exists()) return;
|
||||
|
||||
// Check if the path points to a network file system or not
|
||||
if (isNetworkFileSystem(path)) {
|
||||
if (Utils::Fs::isNetworkFileSystem(path)) {
|
||||
// Network mode
|
||||
qDebug("Network folder detected: %s", qPrintable(path));
|
||||
qDebug("Network folder detected: %s", qUtf8Printable(path));
|
||||
qDebug("Using file polling mode instead of inotify...");
|
||||
m_watchedFolders << dir;
|
||||
// Set up the watch timer
|
||||
if (!m_watchTimer) {
|
||||
m_watchTimer = new QTimer(this);
|
||||
connect(m_watchTimer, SIGNAL(timeout()), SLOT(scanNetworkFolders()));
|
||||
m_watchTimer->start(WATCH_INTERVAL); // 5 sec
|
||||
}
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
// Normal mode
|
||||
qDebug("FS Watching is watching %s in normal mode", qPrintable(path));
|
||||
QFileSystemWatcher::addPath(path);
|
||||
scanLocalFolder(path);
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
|
||||
m_watchTimer.start(WATCH_INTERVAL);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Normal mode
|
||||
qDebug("FS Watcher is watching %s in normal mode", qUtf8Printable(path));
|
||||
QFileSystemWatcher::addPath(path);
|
||||
scanLocalFolder(path);
|
||||
}
|
||||
|
||||
void FileSystemWatcher::removePath(const QString &path)
|
||||
{
|
||||
#ifndef Q_OS_WIN
|
||||
QDir dir(path);
|
||||
for (int i = 0; i < m_watchedFolders.count(); ++i) {
|
||||
if (QDir(m_watchedFolders.at(i)) == dir) {
|
||||
m_watchedFolders.removeAt(i);
|
||||
if (m_watchedFolders.isEmpty())
|
||||
delete m_watchTimer;
|
||||
return;
|
||||
}
|
||||
if (m_watchedFolders.removeOne(path)) {
|
||||
if (m_watchedFolders.isEmpty())
|
||||
m_watchTimer.stop();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// Normal mode
|
||||
QFileSystemWatcher::removePath(path);
|
||||
}
|
||||
|
||||
void FileSystemWatcher::scanLocalFolder(QString path)
|
||||
void FileSystemWatcher::scanLocalFolder(const QString &path)
|
||||
{
|
||||
qDebug("scanLocalFolder(%s) called", qPrintable(path));
|
||||
QStringList torrents;
|
||||
// Local folders scan
|
||||
addTorrentsFromDir(QDir(path), torrents);
|
||||
// Report detected torrent files
|
||||
if (!torrents.empty()) {
|
||||
qDebug("The following files are being reported: %s", qPrintable(torrents.join("\n")));
|
||||
emit torrentsAdded(torrents);
|
||||
}
|
||||
QTimer::singleShot(2000, this, [this, path]() { processTorrentsInDir(path); });
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
void FileSystemWatcher::scanNetworkFolders()
|
||||
{
|
||||
#ifndef Q_OS_WIN
|
||||
qDebug("scanNetworkFolders() called");
|
||||
QStringList torrents;
|
||||
// Network folders scan
|
||||
foreach (const QDir &dir, m_watchedFolders) {
|
||||
//qDebug("FSWatcher: Polling manually folder %s", qPrintable(dir.path()));
|
||||
addTorrentsFromDir(dir, torrents);
|
||||
}
|
||||
// Report detected torrent files
|
||||
if (!torrents.empty()) {
|
||||
qDebug("The following files are being reported: %s", qPrintable(torrents.join("\n")));
|
||||
emit torrentsAdded(torrents);
|
||||
}
|
||||
#endif
|
||||
for (const QDir &dir : qAsConst(m_watchedFolders))
|
||||
processTorrentsInDir(dir);
|
||||
}
|
||||
#endif
|
||||
|
||||
void FileSystemWatcher::processPartialTorrents()
|
||||
{
|
||||
QStringList noLongerPartial;
|
||||
|
||||
// Check which torrents are still partial
|
||||
foreach (const QString &torrentPath, m_partialTorrents.keys()) {
|
||||
if (!QFile::exists(torrentPath)) {
|
||||
m_partialTorrents.remove(torrentPath);
|
||||
}
|
||||
else if (BitTorrent::TorrentInfo::loadFromFile(torrentPath).isValid()) {
|
||||
Dict::removeIf(m_partialTorrents, [&noLongerPartial](const QString &torrentPath, int &value)
|
||||
{
|
||||
if (!QFile::exists(torrentPath))
|
||||
return true;
|
||||
|
||||
if (BitTorrent::TorrentInfo::loadFromFile(torrentPath).isValid()) {
|
||||
noLongerPartial << torrentPath;
|
||||
m_partialTorrents.remove(torrentPath);
|
||||
return true;
|
||||
}
|
||||
else if (m_partialTorrents[torrentPath] >= MAX_PARTIAL_RETRIES) {
|
||||
m_partialTorrents.remove(torrentPath);
|
||||
QFile::rename(torrentPath, torrentPath + ".invalid");
|
||||
|
||||
if (value >= MAX_PARTIAL_RETRIES) {
|
||||
QFile::rename(torrentPath, torrentPath + ".qbt_rejected");
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
++m_partialTorrents[torrentPath];
|
||||
}
|
||||
}
|
||||
|
||||
++value;
|
||||
return false;
|
||||
});
|
||||
|
||||
// Stop the partial timer if necessary
|
||||
if (m_partialTorrents.empty()) {
|
||||
m_partialTorrentTimer->stop();
|
||||
m_partialTorrentTimer->deleteLater();
|
||||
m_partialTorrentTimer.stop();
|
||||
qDebug("No longer any partial torrent.");
|
||||
}
|
||||
else {
|
||||
qDebug("Still %d partial torrents after delayed processing.", m_partialTorrents.count());
|
||||
m_partialTorrentTimer->start(WATCH_INTERVAL);
|
||||
m_partialTorrentTimer.start(WATCH_INTERVAL);
|
||||
}
|
||||
|
||||
// Notify of new torrents
|
||||
@@ -178,99 +163,23 @@ void FileSystemWatcher::processPartialTorrents()
|
||||
emit torrentsAdded(noLongerPartial);
|
||||
}
|
||||
|
||||
void FileSystemWatcher::startPartialTorrentTimer()
|
||||
void FileSystemWatcher::processTorrentsInDir(const QDir &dir)
|
||||
{
|
||||
Q_ASSERT(!m_partialTorrents.isEmpty());
|
||||
if (!m_partialTorrentTimer) {
|
||||
m_partialTorrentTimer = new QTimer();
|
||||
connect(m_partialTorrentTimer, SIGNAL(timeout()), SLOT(processPartialTorrents()));
|
||||
m_partialTorrentTimer->setSingleShot(true);
|
||||
m_partialTorrentTimer->start(WATCH_INTERVAL);
|
||||
}
|
||||
}
|
||||
|
||||
void FileSystemWatcher::addTorrentsFromDir(const QDir &dir, QStringList &torrents)
|
||||
{
|
||||
const QStringList files = dir.entryList(m_filters, QDir::Files, QDir::Unsorted);
|
||||
foreach (const QString &file, files) {
|
||||
QStringList torrents;
|
||||
const QStringList files = dir.entryList({"*.torrent", "*.magnet"}, QDir::Files);
|
||||
for (const QString &file : files) {
|
||||
const QString fileAbsPath = dir.absoluteFilePath(file);
|
||||
if (fileAbsPath.endsWith(".magnet")) {
|
||||
if (file.endsWith(".magnet"))
|
||||
torrents << fileAbsPath;
|
||||
}
|
||||
else if (BitTorrent::TorrentInfo::loadFromFile(fileAbsPath).isValid()) {
|
||||
else if (BitTorrent::TorrentInfo::loadFromFile(fileAbsPath).isValid())
|
||||
torrents << fileAbsPath;
|
||||
}
|
||||
else if (!m_partialTorrents.contains(fileAbsPath)) {
|
||||
qDebug("Partial torrent detected at: %s", qPrintable(fileAbsPath));
|
||||
qDebug("Delay the file's processing...");
|
||||
m_partialTorrents.insert(fileAbsPath, 0);
|
||||
}
|
||||
else if (!m_partialTorrents.contains(fileAbsPath))
|
||||
m_partialTorrents[fileAbsPath] = 0;
|
||||
}
|
||||
|
||||
if (!m_partialTorrents.empty())
|
||||
startPartialTorrentTimer();
|
||||
if (!torrents.empty())
|
||||
emit torrentsAdded(torrents);
|
||||
|
||||
if (!m_partialTorrents.empty() && !m_partialTorrentTimer.isActive())
|
||||
m_partialTorrentTimer.start(WATCH_INTERVAL);
|
||||
}
|
||||
|
||||
#if !defined Q_OS_WIN && !defined Q_OS_HAIKU
|
||||
bool FileSystemWatcher::isNetworkFileSystem(QString path)
|
||||
{
|
||||
QString file = path;
|
||||
if (!file.endsWith("/"))
|
||||
file += "/";
|
||||
file += ".";
|
||||
struct statfs buf;
|
||||
if (!statfs(file.toLocal8Bit().constData(), &buf)) {
|
||||
#ifdef Q_OS_MAC
|
||||
// XXX: should we make sure HAVE_STRUCT_FSSTAT_F_FSTYPENAME is defined?
|
||||
return ((strcmp(buf.f_fstypename, "nfs") == 0) || (strcmp(buf.f_fstypename, "cifs") == 0) || (strcmp(buf.f_fstypename, "smbfs") == 0));
|
||||
#else
|
||||
return ((buf.f_type == static_cast<long>(CIFS_MAGIC_NUMBER))
|
||||
|| (buf.f_type == static_cast<long>(NFS_SUPER_MAGIC))
|
||||
|| (buf.f_type == static_cast<long>(SMB_SUPER_MAGIC)));
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
std::cerr << "Error: statfs() call failed for " << qPrintable(file) << ". Supposing it is a local folder..." << std::endl;
|
||||
switch(errno) {
|
||||
case EACCES:
|
||||
std::cerr << "Search permission is denied for a component of the path prefix of the path" << std::endl;
|
||||
break;
|
||||
case EFAULT:
|
||||
std::cerr << "Buf or path points to an invalid address" << std::endl;
|
||||
break;
|
||||
case EINTR:
|
||||
std::cerr << "This call was interrupted by a signal" << std::endl;
|
||||
break;
|
||||
case EIO:
|
||||
std::cerr << "I/O Error" << std::endl;
|
||||
break;
|
||||
case ELOOP:
|
||||
std::cerr << "Too many symlinks" << std::endl;
|
||||
break;
|
||||
case ENAMETOOLONG:
|
||||
std::cerr << "path is too long" << std::endl;
|
||||
break;
|
||||
case ENOENT:
|
||||
std::cerr << "The file referred by path does not exist" << std::endl;
|
||||
break;
|
||||
case ENOMEM:
|
||||
std::cerr << "Insufficient kernel memory" << std::endl;
|
||||
break;
|
||||
case ENOSYS:
|
||||
std::cerr << "The file system does not detect this call" << std::endl;
|
||||
break;
|
||||
case ENOTDIR:
|
||||
std::cerr << "A component of the path is not a directory" << std::endl;
|
||||
break;
|
||||
case EOVERFLOW:
|
||||
std::cerr << "Some values were too large to be represented in the struct" << std::endl;
|
||||
break;
|
||||
default:
|
||||
std::cerr << "Unknown error" << std::endl;
|
||||
}
|
||||
|
||||
std::cerr << "Errno: " << errno << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||