Commit Graph

25 Commits

Author SHA1 Message Date
Charles Kerr 59efe4642d
feat: allow filtering torrents by info hash in qt client (#1763)
* feat: allow filtering torrents by info hash
2021-08-27 12:58:47 -05:00
Mike Gelfand db3d40d0ed Switch to clang-format for code formatting, include Mac client 2021-08-16 00:38:29 +03:00
Charles Kerr 9f7c865454
refactor: don't store torrent hashes in QStrings (#1428)
* refactor: keep torrent hash in std::array<char,20>

This replaces the hashString QString allocation with a compile-time
array that's included in sizeof the Torrent struct that owns it.
2020-09-07 16:19:10 -05:00
Charles Kerr cf9b81eb7d
feat: nicer add-torrent workflow in the qt client. (#1410)
* If you accidentally try to add a lot of duplicates -- for example, by
  starting up with a lot of duplicate torrents in the watchdir -- then
  coalesce all of them into a single error dialog instead of spamming
  the desktop with a different dialog for every duplicate.

* Make the duplicate torrent dialog's error message slightly terser to
  make it accommodate a long list of torrents: omit the ".torrent" file
  suffixes and show an abbreviated form of the existing torrent's hash.

* Support searching by torrent hash in the filterbar's text entry.
  This is useful when copy/pasting the hash from the duplicate torrent
  error dialog and is also consistent with the GTK client behavior.

* Copy the GTK client's behavior of appending ".added" to the end of
  .torrent files after they've been added to the session.
2020-08-26 20:42:41 -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 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 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
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 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 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 fa6df52d58
chore: remove unused methods (#1207)
* chore: remove unused methods in qt client

* chore: remove unused libtransmission methods

* chore: remove unused gtk methods

* chore: remove more unused libtransmission methods

* chore: remove more unused code found by @reardonia
2020-05-11 17:20:46 -05: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 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
Charles Kerr 4c79758dbc
refactor: debounce TorrentFilter prefs refiltering (#1027)
* refactor: debounce TorrentFilter prefs refiltering

When filter settings change, add a slight delay before refiltering. This
prevents the UI from freezing when the user is typing in the filterbar's
textfield.

Also fixes a long-standing wart that caused the model to be sorted twice
instead of just once whenever the filter text changed.
2019-11-06 19:13:41 -06:00
Charles Kerr 973afda057
refactor: keep torrent's time properties as time_t (#1042)
* refactor: keep torrent's time properties as time_t

Comparing QDateTimes is expensive. Keep the torrents' time properties in
the time_t form that we got them from RPG in; difftime() is cheaper.
2019-11-06 17:31:41 -06:00
Mike Gelfand 82722476aa Fix some issues reported by Coverity 2017-05-20 23:31:56 +03:00
Mike Gelfand c5e730c63a Only compare magnet state if not yet different 2017-05-01 12:45:09 +03:00
Christian Muehlhaeuser 6dd034b826 Fix sorting by progress (Qt client)
Magnet transfers caused the by-progress sorting to become non-stable, as their
percentComplete() could return NaN. This patch fixes this by preferring active
downloads over magnet transfers, then sorting them by percentComplete().
2017-05-01 12:44:47 +03:00
Mike Gelfand a762c770f2 Make conditional expressions explicitly boolean 2017-04-30 19:26:01 +03: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
Mike Gelfand fd9c2c74f4 Remove some unused includes/macros; fix build (re. QPointer) 2015-07-30 06:55:28 +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/torrent-filter.cc (Browse further)