Commit Graph

13598 Commits

Author SHA1 Message Date
Mike Gelfand e61b49c2fe Disable openssl support when building bundled libevent 2020-08-26 04:09:15 +03:00
Mike Gelfand b7a8bd45b7 Reformat affected code after recent changes 2020-08-18 20:31:06 +03:00
Mike Gelfand 75458d6be3 Make use of TR_UNUSED macro where cast-to-void was used before 2020-08-18 14:34:49 +03:00
Mike Gelfand ff8d0dbf3b Switch from UNUSED macro to TR_UNUSED macro
Since there is no way to mark parameters as [potentially] unused in
standard C and when using MSVC compiler, use the widely accepted
cast-to-void approach instead.
2020-08-18 14:19:55 +03:00
Mike Gelfand 077f4d8d2b Require C11, switch to standard static_assert 2020-08-18 14:19:55 +03:00
Mike Gelfand 5125feca5d Don't test warning flags inherently unsupported by compiler
MSVC does not support GNU-style compiler flags, and vice versa. Not only
does it make no sense to test for those flags, with MSVC it also takes
considerably longer to do so.

The only flag that MSVC does support is -Wall (/Wall), but since it's
equivalent to Clang's -Weverything and thus issues lots of warnings
nobody usually cares about, including from system header files, it's
preferred to use /W4.
2020-08-18 11:37:25 +03:00
Mike Gelfand 4e5ad7937a Don't add warning flags that don't apply to a specific language
Some compilers issue additional CLI-level warning, that cannot be
suppressed, when passed flags that are irrelevant for a particular
invocation. Temporarily treat warnings as errors when testing flags
support so that those warnings lead to flags being excluded.
2020-08-18 10:51:38 +03:00
Mike Gelfand 057b8a61d6 Use CURL::libcurl imported target when available
When built with CMake, CURL installation includes configuration package
that could be used instead of CMake-bundled find module. The former
doesn't define CURL_INCLUDE_DIRS and CURL_LIBRARIES variables, but only
imported targets.
2020-08-18 09:58:33 +03:00
Charles Kerr b8a02fdfb3 fixup! refactor: remove exit-time destructors from transmission-qt (#1395) 2020-08-16 20:43:14 -05:00
Charles Kerr 68920f5fa6
refactor: remove exit-time destructors from transmission-qt (#1395)
* refactor: remove exit-time destructors from transmission-qt
2020-08-15 10:42:51 -05:00
Charles Kerr 677dc73eac
refactor: use GTest for running tests (#1383)
* refactor: use google-test on libtransmission tests
2020-08-11 13:11:55 -05:00
Charles Kerr 6da4a4dfad
Fix or silence gtk warnings (#1380)
* chore: disable deprecation warnings in GTK client

Yes, updating the GTK codebase is still a goal. (help welcomed!)
But there's a deluge of deprecation warnings that drown out other more
important warnings, so turn off deprecation warnings for now.

* fixup! chore: disable deprecation warnings in GTK client

* fix: gtk_tree_sortable_set_sort_column_id caller.

* fix: gtk_window_resize caller.
2020-07-30 14:45:11 -05:00
Charles Kerr 49400ab443
fix: qt client memory leaks (#1378)
* fix: don't leak the qt client's QFileSystemWatcher

* fix: don't leak the Qt client's ListViewProxyStyle
2020-07-29 18:21:11 -05:00
Charles Kerr 77ced2b7c8
Fix Ubuntu 18.04 Qt FTBFS (#1377)
* fix: avoid qt5_add_translation options on old qt5

Check the Qt5Linguist version before passing 'OPTIONS -silent' to
qt5_add_translation(). 'OPTIONS' arg support was merged 2018-01-12
https://codereview.qt.nokia.com/gitweb?p=qt%2Fqttools.git;a=commit;h=9f3dba2ea3978936565aa5e7893415a8a765268e
and made it into the 5.11 release on 2018-05-22.

* fix: ftbfs include <cassert> before using assert()
2020-07-29 14:53:55 -05:00
Charles Kerr 8f12792186
fix: ensure details dialog is updated on selection (#1376)
* fix: ensure details dialog is updated on selection
2020-07-29 11:56:23 -05:00
RobCrowston 6fee8724ab
Allow the operating system to set the size of the listen queue connection backlog. (#922)
* Allow the operating system to determine the size of the listen queue connection backlog.

* On Windows, set the listen queue backlog to SOMAXCONN, as advised in https://docs.microsoft.com/en-us/windows/desktop/api/winsock2/nf-winsock2-listen.
2020-07-28 22:14:07 -05:00
Vitaly Potyarkin 2da97b25fa
Lift 1024 open files limit (switch to curl polling API) (#893)
* Switch to new libcurl's polling interface

* Drop unused includes

* Use NOFILE limit value defined by operating system

* Avoid tight loops, ensure blocking for a small timeout

When there are no file descriptors to wait for, select() would work the
same as sleep(). But curl_multi_wait() returns immediately in this case,
so we need to add explicit wait to avoid tight loops.

Documentation: https://curl.haxx.se/libcurl/c/curl_multi_timeout.html
Discussion: https://curl.haxx.se/mail/lib-2018-03/0074.html

* Bump libcurl minimum version to 7.28.0
2020-07-28 21:38:27 -05:00
Charles Kerr 9da4abb003
feat: add 'transfer.complete' notification hint (#1374)
Described at https://developer.gnome.org/notification-spec/#categories ,
this is for a file transfer or download complete notification.
2020-07-28 16:51:01 -05:00
Pedro Scarapicchia Junior 5be8bd50f9
Check if log deep is enabled before tr_logAddDeep (#1329)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-07-28 12:31:36 -05:00
Charles Kerr 910944733e
refactor: reuse one QRequestHeader across requests (#1373)
Minor optimization: since we don't actually change our request headers
very often, we can lazy-build the request once and reuse that instead of
having to rebuild it each time.
2020-07-28 10:56:40 -05:00
Charles Kerr 0b042d85dd
fix: type deduction error introduced in 00be8d0 (#1372)
Explicitly delete the implied function to ensure we don't get bitten by
this again in the future.

Mark the string_views constexpr where possible so that we can avoid some
strlen() calls at runtime.
2020-07-27 18:34:40 -05:00
Nicholas Guriev 05a2e15b00
i18n: translate "Ratio:" string in compact view (#1354)
Use already available translation from gettext.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-07-27 13:51:31 -05:00
Charles Kerr 073ae6c206
chore: fix deprecation warnings of GTK_STOCK_ use. (#1370)
* chore: fix deprecation warnings of GTK_STOCK_ use.

This is just a tiny step towards getting all of the GTK code up-to-date,
but GTK_STOCK warnings are the lowest-hanging fruit of the warnings, so
let's fix them.
2020-07-27 12:49:45 -05:00
Viacheslav Chimishuk 10fc016239
Add argument description to --labels command line option in transmission-remote man. (#1364)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-07-27 00:30:32 -05:00
Chris Young dc48c980e2
Fix typo in rpc-spec.txt (#1326)
The "format" is a request arg, not part of the torrent-get payload.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2020-07-26 23:36:38 -05:00
Charles Kerr 00be8d00d7
refactor: make variant_headers reusable to qt app. (#1369)
* refactor: make variant_headers reusable to qt app.

Torrent.cc's `change()` template methods are generically useful to deal
with tr_variant wrangling, but previously were only used in Torrent.cc.
This PR moves them into a new API `VariantHelpers.h` for use by Prefs,
Session, TorrentModel, etc.
2020-07-26 23:30:58 -05:00
Charles Kerr 7e1da2d8fe
refactor: only update favicon when tracker changes (#1336)
* refactor: make Favicon's Key a semi-opaque type and update a Torrent's icon only when the announce_url changes.
2020-06-24 13:28:54 -05:00
Charles Kerr 33a421e97f
refactor: only update filterbar comboboxes when necessary (#1335)
* refactor: Torrent::update() returns a delta bitset

Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.

* chore: make uncrustify happy

* refactor: update filterbar counts more selectively

Only rebuild the activity and tracker combobox models when the model's
size changes or when the relevant Torrent properties change.

Previously, rebuild would happen on any Torrent property change even if
the properties were unrelated to activity or trackers.

* chore: remove redundant "private:" key
2020-06-23 18:54:08 -05:00
Charles Kerr f37253a3ab
feat: Torrent::update() returns a bitset of changed properties (#1334)
* refactor: Torrent::update() returns a delta bitset

Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.

* chore: make uncrustify happy

* chore: fix #includes
2020-06-23 16:11:16 -05:00
Charles Kerr 83e4e4ca55
refactor: faster action sensitivity updates (#1333)
* refactor: faster action sensitivity updates

Currently we walk through every row in the model and pump its TorrentRole data, which can be expensive for long lists. However since we're only interested in the selected rows, let's save some traversal overhead by getting that list directly and walking it instead.
2020-06-23 12:16:07 -05:00
Charles Kerr 8fcfc1e4ae
feat: add 'edit-date' support to qt client (#1322)
edit-date got added to the backend in 3.00, but I never finished adding
it properly to the Qt client. This PR rectifies that. When a torrent is
edited, the Application and DetailsDialogs will re-query the backend to
update the torrent properties that are needed.
2020-06-18 15:34:11 -05:00
Charles Kerr fcda077cdd
chore: remove extraneous/default class destructors (#1317)
* chore: remove extraneous/default class destructors

* fixup! chore: remove extraneous/default class destructors
2020-06-15 09:30:29 -05:00
Pedro Scarapicchia Junior 0a897cb3aa
Remove unused html (#1313) 2020-06-14 16:04:26 -05:00
Charles Kerr 51573a3c1e
chore: clang-tidy cleanups (#1287)
* chore: fix syntax error in clang-tidy config file
2020-06-05 14:02:11 -05:00
Charles Kerr 1f28470cf4
chore: prefer QStringLiteral (#1284)
Further reading:
* https://forum.qt.io/topic/78540/qstringliteral-vs-qlatin1string/2
* https://woboq.com/blog/qstringliteral.html
* https://www.qt.io/blog/2014/06/13/qt-weekly-13-qstringliteral

tl;dr: QLatin1Literal uses less memory than QStringLiteral; however,
since most Qt APIs require a QString argument, there's extra runtime
cost of converting QLatin1Strings to QStrings. QStringLiteral uses a
little more memory but constructs its QStrings at compile time.

ok, the `prefer-qstringliteral` branch is getting out of control: the
secondary goal of fixing a .clang-tidy issue is causing more diffs
than the primary goal. So, I'm breaking it into two separate PRs.
2020-05-29 12:40:07 -05:00
Charles Kerr 070a7f2ffc
refactor: use snake_case field naming in qt client (#1262)
* refactor: use snake_case field naming in qt client

* fix: some missed symbols

* chore: make uncrustify happy

* fixup! refactor: use snake_case field naming in qt client
2020-05-27 16:53:12 -05:00
Mitchell Livingston 4893771a04 Merge branch 'master' of https://github.com/transmission/transmission 2020-05-25 09:37:24 -04:00
Mitchell Livingston 6d2164ec47 Remove mention of Growl, which has been removed. 2020-05-25 09:37:19 -04:00
Pavel Borzenkov 34137ae324
fix(rpc-spec): fix typo in `editDate` arg description (#1251)
The argument is actually valid for `torrent-get` only.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
2020-05-24 11:13:17 -05:00
Mike Gelfand 0c10308e06
Add missing files that fail build from tarball (#1247)
Fixes: #1246, #1138
2020-05-23 02:13:59 +03:00
Charles Kerr d43aeb6a5c
chore: add clang-tidy checks to Qt client (#1236)
* chore: add clang-tidy integration for Qt client
2020-05-19 20:32:51 -05:00
Charles Kerr 6aa559f12f
refactor: remove QVariants from torrent (#1234)
* chore: remove qvariants from torrent class

* chore: remove unused Q_DECLARE macro calls

* refactor: remove unused includes from Torrent.h

* chore: make clang-tidy and linter happy

* refactor: rename 'setValue()' to 'change()'

* refactor: make tr_variant function paramters const

* chore: remove devel scaffolding

* refactor: rename peer_limit_ to peerLimit_

* refactor: do not use bitwise logic on booleans
2020-05-19 18:42:17 -05:00
Charles Kerr e7c099b8d8 chore: bump version to '3.00+' 2020-05-15 19:38:43 -05:00
Charles Kerr bb6b5a062e chore: bump version to '3.00'
If at first you don't succeed, bang your fingers on the keyboard until something works
2020-05-15 19:36:16 -05:00
Charles Kerr f4489c982e chore: bump version to '3.00+' 2020-05-15 18:53:16 -05:00
Charles Kerr 8a65b32b48 chore: bump version to '3.00' 2020-05-15 18:51:31 -05:00
Charles Kerr 82020d2e8c
fix: fix console warning when adding magnet links (#1229) 2020-05-15 12:22:06 -05:00
Mike Gelfand 87ca3529b7 Use release code signing certificate on Windows 2020-05-14 19:20:07 +03:00
Mike Gelfand 7db1c848ed Add new translations from Transifex (95% and higher)
GTK client: none.

Qt client: Finnish.

Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
2020-05-14 19:17:11 +03:00
Mike Gelfand 4aa60bad52 Sync existing translations with Transifex 2020-05-14 19:16:15 +03:00