Commit Graph

17 Commits

Author SHA1 Message Date
Charles Kerr 19e52d8b9a
chore: sonarcloud warnings 2 (#1496)
* fix "merge nested if" sonarcloud warnings

* fix explicit constructor warnings in qt client
2020-11-01 15:47:57 -06:00
Charles Kerr c2fb393390
chore: fix clang-tidy-11 warnings (#1436)
* refactor: mark subclass' destructors as override.

* refactor: use QUrl to parse announce URL strings.

The prompt for this was to work around a clang-tidy issue where
"char* host = nullptr;" triggers a "don't use varargs" warning,
but on the other hand it's also terser / cleaner.

* refactor: make the TorrentDelegate brushes const.

* refactor: s/auto/auto const*/ where appropriate

* chore: add some nonconst global warning exemptions

* chore: turn off warnings in GTest

* refactor: just disable the clang-tidy warning.

Apparently a std::array<T>::iterator is a T* on clang, since clang-tidy's
readability warning says we should use 'auto*' instead of 'auto'. However
adding that annotation fails on MSVC, where the is apparently _not_ a raw
pointer.

Since there's not a way to satisfy both of them at the same time, disable
the warning.
2020-09-09 09:24:39 -05:00
Charles Kerr b3c3168f16
refactor: intern repeated strings e.g. downloadDir (#1430)
* refactor: intern repeated strings e.g. downloadDir

Add an app-wide interned QString cache for commonly-repeated
strings. Currently used for download_dir, announce_url, comment,
creator, error_string.
2020-09-07 22:52:29 -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 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
Charles Kerr 44fc571a67
feat: add editDate to RPC (#1056)
* feat: add tr_stat.infoDate to note tr_info changes

The last time during this session that any tr_info field changed
(e.g. trackers/filenames edited or magnet torrent got metadata).
RPC clients can monitor this to know when to reload fields which
don't usually change.
2019-11-12 17:13:42 -06:00
Charles Kerr c62cb35fd4
qt client speedups
* faster updating of trackers combobox.
* generate trackerDisplayNames just once per torrent
* refactor: cache torrent delegate's warning emblem
* refactor: change mainwin refresh debounce to 200ms
* refactor: do not store trackers, hosts in QVariant
* refactor: don't use `virtual` when it's not needed
* refactor: faster counting torrents-matching-filter
* refactor: faster tracker handling in filterbar
* refactor: improve json parser's prealloc heuristic
* refactor: make Torrent::hasError() faster
* refactor: remove redundant speed stats collection
* refactor: remove unnecessary tor->isQueued() calls
* refactor: use unordered containers where possible
* scale favicons only once, when adding to the cache
2019-11-11 19:37:05 -06:00
Charles Kerr 96f76999aa
feat: add "table" format in torrent-get RPC (#1049)
* feat: add optional "format" arg to torrent-get RPC

If the "format" request was "objects" (default), "torrents" will be an
array of objects, each of which contains the key/value pairs matching
the request's "fields" arg. This is unchanged from previous versions.

If the format was "table", then "torrents" will be an array of arrays.
The first row holds the keys and each remaining row holds a torrent's
values for those keys. This format is more efficient in terms of JSON
generation and JSON parsing.
2019-11-09 17:02:23 -06:00
Charles Kerr d857a5821a
refractor: simplify torrent model signal emissions (#1044)
refractor: simplify torrent model signal emissions

The Torrent->Application signal connections make up for about 5% of the
app's memory use. Move this to the TorrentModel so that there are only a
handful of signal connections.

Moving signals to TorrentModel means batch change signals can be emitted
instead of per-change-per-torrent emissions and can be handled that way.
2019-11-09 08:44:40 -06:00
Mike Gelfand dadffa2c0f Align type qualifiers to the right (code style)
This way all the qualifiers (`const`, `volatile`, `mutable`) are grouped
together, e.g. `T const* const x` vs. `const T* const x`. Also helps reading
types right-to-left, e.g. "constant pointer to constant T" vs. "constant
pointer to T which is constant".
2017-04-20 19:53:20 +03:00
Mike Gelfand d7930984ef Adjust uncrustify config, reformat all but Mac client
There're places where manual intervention is still required as uncrustify
is not ideal (unfortunately), but at least one may rely on it to do the
right thing most of the time (e.g. when sending in a patch).

The style itself is quite different from what we had before but making it
uniform across all the codebase is the key. I also hope that it'll make the
code more readable (YMMV) and less sensitive to further changes.
2017-04-20 10:01:22 +03:00
Mike Gelfand 2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Jordan Lee 1af60ad6ad use '#pragma once' instead of #ifndef..#define..#endif guards 2016-03-29 16:37:21 +00:00
Mike Gelfand 74129b7ef3 Fallback to English if no proper translation is available 2015-11-15 11:03:27 +00:00
Mike Gelfand 5120fc0f2c Unify/prettify Qt client headers style 2015-06-12 22:12:12 +00:00
Mike Gelfand 07912d230b Use PascalCase for Qt client filenames
Split FileTree.{h,cc} and FilterBar.{h,cc} files so that each class
is in its own file.

This breaks translations (some classes got renamed => context changed),
to be fixed by next commit (along with Tx sync).
2015-06-10 21:27:11 +00:00
Renamed from qt/app.h (Browse further)