Commit Graph

1834 Commits

Author SHA1 Message Date
Charles Kerr af339a15ed
refactor: remove deep logging (#2749)
* refactor: remove "deep logging"
2022-03-09 23:51:14 -06:00
Charles Kerr 80ab910cbd
feat: update built-in speed limit settings (#2697)
Fixes #2092.
2022-02-23 20:27:28 -06:00
Charles Kerr 8d5c900ee0 refactor: Qt, GTK, web client UI consistency 2022-02-21 08:34:59 -06:00
Stefan Talpalaru 7b377511a9 feat: default public trackers 2022-02-21 08:34:57 -06:00
Charles Kerr 02b6cc76d1
feat: add tr_torrentSetTrackerList(), tr_torrentGetTrackerList() (#2642)
Add a getter/setter for torrent announce URLs as text that can be copied
and pasted: one URL per line, with a blank line between tiers.

C API: tr_torrentGetTrackerList() and tr_torrentSetTrackerList()
RPC APi: `trackerList` in `torrent-get` and `torrent-set`.

This deprecates `trackerAdd`, `trackerRemove`, and `trackerEdit`
from the RPC API.
2022-02-18 11:52:01 -06:00
Charles Kerr 29af76d977
refactor: tr_web (#2640)
* fixup! refactor: tr_web (#2633)

fix: race condition in web threadfunc during bootstrap

fixes #2639
2022-02-17 17:35:57 -06:00
Charles Kerr f1a53840f9
refactor: tr_web (#2633)
* refactor: fix tr_web rate limiting and dns caching
2022-02-16 12:33:50 -06:00
Charles Kerr 0a27346efb
use metainfo folder instead of appdata (#2624)
* use metainfo folder instead of appdata

Co-authored-by: David Heidelberg <david@ixit.cz>
2022-02-14 09:41:19 -06:00
Charles Kerr d772824553
fix: sonarcloud code smells (#2623)
* fix: make variable a pointer-to-const

* fix: use init-statement to reduce variable scope

* fix: implicit conversion from long to int

* fix: refactor to not nest more than 3 if|for|do|while|switch statements

* fix: make tr_session::setSocketTos() const

* fix: use array.prototype.some instead of a for loop

* refactor: use nullptr instead of NULL

* fix: oops
2022-02-13 23:44:38 -06:00
Charles Kerr 9f9b6cdaa2
feat: run script when done seeding (#2621)
* feat: add seeding-done script to core and rpc

* feat: add seeding-done script to gtk client

* feat: add seeding-done script to qt client

* feat: add seeding-done script to transmission-remote

* refactor: make Qt and GTK client text match

* test: update tests

Co-authored-by: Timothy Nibeaudeau <timothy.nibeaudeau@gmail.com>
2022-02-13 22:07:12 -06:00
Charles Kerr a822a46e47
refactor: add fetch options object to tr_webRun() (#2620)
* refactor: add fetch options object to tr_webRun()

Fold `tr_webRun()`, `tr_webRunWithCookies()`, and `tr_webRunWebseed()`
into a single API that takes an options argument that callers can
customize to their needs.

Also does a surface cleanup pass to the tr_webseed and tr_web internal
structures, e.g. making fields const where possible, not using raw
pointers, and making some fields private.

This revision is still full of code smells. Refactoring the entire
system is overwhelming, so instead I'm doing it in incremental steps.
2022-02-13 20:09:56 -06:00
Charles Kerr 96178b1a9f
feat: add support for adding torrents by raw hash values (#2608)
* Add support for adding torrents by raw hash values

Co-authored-by: vjunk <vjunk@mail.ru>
2022-02-12 22:16:55 -06:00
Charles Kerr 2410ad2fa6
feat: support webseeds in transmission-create (#2611) 2022-02-12 12:50:47 -06:00
Charles Kerr e14c7f38e5
feat: use libpsl (#2575)
Use libpsl to calculate public and private parts of URL hosts.
2022-02-12 11:30:27 -06:00
Charles Kerr a87be3762f
fix: rename 'corrupt' label for understandability (#2605)
Fixes #154. The current 'corrupt' label can confuse users to think that
there is corrupt data on the disk. The phrasing has been changed:

- Downloaded: 1.91 GB
- Corrupt DL: 22.02 MB

+ Downloaded: 1.91 GB (+22.02 MB discarded after failed checksum)
2022-02-11 01:15:10 -06:00
Charles Kerr ec6a92d761
fix: make remove-torrent dialogs modal in GTK client (#2602)
Followup to #2443
2022-02-10 14:31:11 -06:00
Charles Kerr 7bdb6f777b
refactor: remove callback from tr_torrentVerify() public API (#2592) 2022-02-09 12:02:59 -06:00
Charles Kerr 318d60b72d
refactor: fix sonarcloud "use enum class" code smells (#2590)
* refactor: prefer constexpr over enum for GUI_PAD values

* refactor: prefer constexpr over enum for PrefsDialog values

* refactor: prefer constexpr over enum for StatsDialog values

* refactor: use enum class for GtrUnicode types

* refactor: prefer constexpr over enum for BT peer msg codes

* refactor: use enum class for TrMakemetaResult

* refactor: prefer constexpr over enum for BT metadata message types

* refactor: use enum class for AwaitingBt

* refactor: use enum class for EncryptionPreference

* refactor: use enum class for TrFormat in rpcimpl

* refactor: prefer constexpr over enum for QApp intervals

* refactor: prefer constexpr over enum for tr_resume bitfields

* refactor: prefer constexpr over enum for Qt/TrFileModel bitfields

* refactor: remove obsolete TODO comment in announce-list
2022-02-08 20:25:19 -06:00
Charles Kerr ba14ffa74c
refactor: sonarcloud "use if init" statements (#2587) 2022-02-07 23:44:31 -06:00
Charles Kerr ebb2ab6aee
chore: update license spdx abbreviations (#2582)
Use SPDX license list 3.0 terminology: replace deprecated identifiers
GPL-2.0" and "GPL-3.0" with "GPL-3.0-only" and "GPL-3.0-only".
2022-02-07 10:25:02 -06:00
Charles Kerr e908193027
fix: some use-init-statement sonarcloud warnings (#2563) 2022-02-01 19:09:11 -06:00
Charles Kerr 878405f862
Revert "fix: sonarcloud (#2558)" (#2562)
This reverts commit 8b9483f7fb.
2022-02-01 11:30:51 -06:00
Charles Kerr 8b9483f7fb
fix: sonarcloud (#2558)
* fix: add const modifier for functions

* fix: many sonarcloud use-init-statement warnings
2022-01-31 22:46:27 -06:00
Charles Kerr 5db993d348
chore: iwyu (#2553) 2022-01-31 17:05:35 -06:00
Charles Kerr 4c4b2714f1
feat: remember tab selection in Details dialog (#2506) 2022-01-24 23:16:33 -06:00
Charles Kerr 26bb9f3440
fix: sonarcloud code smells (#2486) 2022-01-23 18:53:35 -06:00
Carles Pastor Badosa 8d1d445fbc
Add content_rating to appdata (#1487)
This tag can be used by app stores such as kde discover, gnome software, elementary appcenter, flathub or similar to discern age-appropriate content.

It uses the Open Age Ratings Service (OARS) in order to provide the required information.
2022-01-23 15:23:53 -06:00
Charles Kerr f94f7923e8
add multiline wrapping in error label (#2465) 2022-01-20 17:22:23 -06:00
Charles Kerr df1cca9b57
chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr 5b8dae3557
fix: make add-torrent dialogs modal in GTK client (#2443)
This solves the issue of the dialogs not centering above the main GTK
client window. Fixes #2214.
2022-01-18 14:16:25 -06:00
Charles Kerr 3036a76beb
fix: sonarcloud code smells (#2421) 2022-01-17 12:39:50 -06:00
Charles Kerr c9f8f150ea
fix: broken tooltiop in GTK client peer flag tooltip (#2409) 2022-01-16 08:48:01 -06:00
Charles Kerr 3a96a5c316
build: refer to primary branch as main (#2394) 2022-01-13 16:03:59 -06:00
Charles Kerr b0ee4007ff
refactor: include cleanups (#2392)
* refactor: include <memory> when using shared_ptr or unique_ptr

* refactor: include <cstdio> iff we use it

* refactor: include <cstring> iff we use it

* refactor: include <cstdlib> iff we use it

* refactor: include <string_view> or <string> iff we use it

* refactor: include <array> iff we use it

* refactor: include <ctime> iff we use it

* refactor: include <cctype> iff we use it

* refactor: misc #include cleanups in libtransmission
2022-01-12 20:13:58 -06:00
Mike Gelfand d8d361e491
Make some utility functions return std::string to simplify code (#2368)
* tr_formatter_speed_KBps returns std::string

* tr_formatter_mem_B returns std::string

* tr_formatter_size_B returns std::string

* tr_strpercent/tr_strratio returns std::string
2021-12-31 03:30:21 +03:00
Charles Kerr c832f3c18c
fix: sonarcloud warnings (#2353)
* fix: remove-redundant-cast sonarcloud warning

* fix: make type a pointer-to-const sonarcloud warning

* fix: use-init-statement sonarcloud warning

* fix: use-init-statement sonarcloud warning

* fix: extract-assignment-from-expression sonarcloud warning

* fix: remove-redundant-cast sonarcloud warning

* fix: extract-nested-block-into-method sonarcloud warning
2021-12-28 01:14:52 -06:00
Charles Kerr 02aa2f46d4
refactor: don't use varargs in tr_error (#2352) 2021-12-27 20:32:22 -06:00
Charles Kerr fa35b8ad39
refactor: use std::string in tr_variantToStr() (#2351)
* refactor: use std::string in tr_variantToStr()
2021-12-27 16:47:25 -06:00
Charles Kerr a515c1d94b
refactor: use tr_torrent_metainfo in tr ctor (#2345) 2021-12-26 10:25:07 -06:00
Charles Kerr b058daff4b
refactor: change tr_torrentNew() args (#2337) 2021-12-24 16:05:17 -06:00
Charles Kerr e4a172d39c
fix: sonarcloud (#2322)
* fix: sonarcloud warning - redundant cast

* fix: sonarcloud warning - init-statement

* fix: sonarcloud warning - init-statement

* fix: sonarcloud warning - move #include to top of file

* fix: sonarcloud warning - implicit conversion loses precision

* fix: sonarcloud warning - confirm safe use of strlen

* fix: sonarcloud warning - refactor code to not nest more than three deep

* iwyu: cstring

* iwyu: algorithm
2021-12-16 16:58:58 -06:00
Charles Kerr 1e20d676c1
refactor: make tr_torrentInfo() private (#2285)
* refactor: make tr_torrentInfo() private
2021-12-14 15:59:44 -06:00
Charles Kerr 656df477f2
refactor: add tr_announce_list (#2308)
* refactor: add tr_announce_list (#2308)
2021-12-14 14:59:40 -06:00
Mike Gelfand 3e072f9bd4
Fix most of critical issues reported by Sonar (GTK client) (#2309)
* (C++) Macros should not be used to define constants

* (C++) Memory should not be managed manually

* (C++) "void*" should not be used in typedefs, member variables, function parameters or return type

* (C++) When the "Rule-of-Zero" is not applicable, the "Rule-of-Five" should be followed

* (C++) "switch" statements should have "default" clauses

* (C++) "explicit" should be used on single-parameter constructors and conversiosn operators

* (C++) Non-const global variables should not be used
2021-12-14 11:43:27 +03:00
Charles Kerr ab0c49859e
refactor: add tr_torrentTrackers() (#2282)
* refactor: add tr_torrentTrackers()
2021-12-08 10:55:52 -06:00
Charles Kerr 0a85c3aaa4
fixup! refactor: make parts of tr file private (#2241) (#2281)
fix: crash regression in GTK client details dialog
2021-12-07 19:03:32 -06:00
Charles Kerr c46ce2da06
refactor: add tr_torrentWebseed(), tr_torrentWebseedCount() (#2277)
* refactor: add tr_torrentWebseedCount()
2021-12-07 12:11:28 -06:00
Charles Kerr c656bee061
refactor: add tr_saveFile() (#2267)
* refactor: add tr_saveFile()

* refactor: add tr_ctorSaveContents()
2021-12-04 19:32:35 -06:00
Charles Kerr 2977636d58
fix: sonarcloud warnings (#2260)
* fix: add-explicit-keyword-to-constructor warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuB-2farvsyMPiZl&open=AX1tyuB-2farvsyMPiZl

* fix: use a structured binding declaration

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuHH2farvsyMPiZm&open=AX1tyuHH2farvsyMPiZm

* Fix implicit-conversion-loses-precision warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuH22farvsyMPiZn&open=AX1tyuH22farvsyMPiZn

* fix use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuO42farvsyMPiZw&open=AX1tyuO42farvsyMPiZw

* fix implicit-conversion-loses-precision warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuO42farvsyMPiZs&open=AX1tyuO42farvsyMPiZs

* fix: implicit-conversion-loses-precision warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuO42farvsyMPiZt&open=AX1tyuO42farvsyMPiZt

* fix handle-this-exceeption-or-do-not-catch-it warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1y7t12cIz3krp3mVpV&open=AX1y7t12cIz3krp3mVpV

* fix make-this-variable-a-reference-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1y7t12cIz3krp3mVpW&open=AX1y7t12cIz3krp3mVpW

* fix replace-redundant-type-with-auto warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1y7t12cIz3krp3mVpY&open=AX1y7t12cIz3krp3mVpY

* Fix use-try_emplace-instead-of-emplace warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0WPk3QwxvzFbF6whWN&open=AX0WPk3QwxvzFbF6whWN

* Fix: make-this-a-pointer-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPUXjI_aUyxGBxB4&open=AX0bZPUXjI_aUyxGBxB4

* Fix use-std::make_unique warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0WPk0twxvzFbF6whWC&open=AX0WPk0twxvzFbF6whWC

* Fix: replace-push_back-with-emplace_back warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0BraL_0QLXO0pQ_Bfv&open=AX0BraL_0QLXO0pQ_Bfv

* Fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxB8&open=AX0bZPXajI_aUyxGBxB8

* Fix: replace-redundant-type-with-auto warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxB9&open=AX0bZPXajI_aUyxGBxB9

* Fix: replace-emplace-with-try_emplace warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxB_&open=AX0bZPXajI_aUyxGBxB_

* Fix: extract-assignment-from-operation warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxCA&open=AX0bZPXajI_aUyxGBxCA

* Fix use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1op6_hUBCnp-Grmra8&open=AX1op6_hUBCnp-Grmra8

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0L8qgMUnpKTxYiu5CN&open=AX0L8qgMUnpKTxYiu5CN

* Revert "Fix use-std::make_unique warning"

This reverts commit 463a742f34.

* fix: make-parameter-a-pointer-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX06St241usi2gyYkPTZ&open=AX06St241usi2gyYkPTZ

* fix: make-parameter-a-pointer-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX06St241usi2gyYkPTa&open=AX06St241usi2gyYkPTa

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX01Itn2f_SST5i7BN1o&open=AX01Itn2f_SST5i7BN1o

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXziv55-MuQoG-Y-NgLX&open=AXziv55-MuQoG-Y-NgLX

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0_a_JGNJn7rAzml_68&open=AX0_a_JGNJn7rAzml_68

* fix: replace-redundant-type-with-auto warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXzyMRYbK9dvryvWm8XA&open=AXzyMRYbK9dvryvWm8XA

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXziv52fMuQoG-Y-NgLW&open=AXziv52fMuQoG-Y-NgLW
2021-12-01 17:11:57 -06:00
Charles Kerr 34881f6295
refactor: make parts of tr file private (#2241)
* refactor: make parts of tr_file private
2021-11-27 21:17:47 -06:00