Commit Graph

25 Commits

Author SHA1 Message Date
Charles Kerr 7f147c65fb
refactor: fix more sonarcloud warnings (#1508)
* refactor: const correctness

* refactor: use getpwuid_r instead of getpwuid

* chore: simplify dict walking loop logic

* refactor: remove dead store assignment in announcer

* refactor: use std::make_shared
2020-11-05 16:46:21 -06:00
Charles Kerr 73fdd722a7
Sonarcloud warnings 3 (#1498)
* chore: use ClassName:: for calling static methods

* chore: prefer to initialize member data in the class initializer
2020-11-01 19:13:32 -06: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 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 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 797700e63f
perf: lazy-update actions enabled on change events (#1187)
* perf: lazy-update actions enabled on change events

Actions' sensitivity was being lazy-updated in response to other events
but accidentally were doing immediate updates in response to torrentsChanged
signals being emitted from TorrentModel. This commit makes that path a
lazy-update as well.

* chore: uncrustify

* refactor: make the idle updater a lambda again
2020-05-01 23:23:47 -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 aa9b752cd9
refactor: don't load the same stock more than once (#1041)
* refactor: don't load the same stock more than once

Some actions share an icon -- for example, "start all", "start now", and
"start" each use "media-playback-start". When this happens, get the icon
once and cache it to avoid hitting the disk more often than necessary.

In addition, the statusbar's network transfer icon was being reloaded in
a periodic upkeep timer, reloading with QIcon::fromTheme each time. Only
give icons are needed, so load them once and cache them.

* refactor: better lookup of torrent mime-type icons

filename-to-mime-type and mime-type-to-icon lookups are both expensive,
so do a better job of detecting top-level folders and caching the icons
based on file suffixes.

This also lets find a good mime icon even if the torrent doesn't have
its 'files' property populated yet from RPC.
2019-11-06 15:09:04 -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 c77946e49a Set icon for "Open URL" action (Qt client) 2017-02-18 21:22:34 +03:00
Mike Gelfand 2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Mike Gelfand 2b917de65b Refactor RPC requests code for proper queueing (patch by intelfx @ GH-10)
This refactoring is driven by the need to be able to do true queued RPC calls
(where each successive call uses the result of the previous).

Currently, such queueing of requests is done by assigning them special "magic"
tag numbers, which are then intercepted in one big switch() statement and acted
upon. This (aside from making code greatly unclear) effectively makes each such
queue a singleton, because state passing is restricted to global variables.

We refactor RpcClient to assign an unique tag to each remote call, and then
abstract all the call<->response matching with Qt's future/promise mechanism.

Finally, we introduce a "RPC request queue" class (RpcQueue) which is built on
top of QFutureWatcher and C++11's <functional> library. This class maintains
a queue of functions, where each function receives an RPC response, does
necessary processing, performs another call and finally returns its future.
2016-04-19 20:41:59 +00:00
Jordan Lee 1af60ad6ad use '#pragma once' instead of #ifndef..#define..#endif guards 2016-03-29 16:37:21 +00:00
Mike Gelfand 585e3df30c Show notice on top of filtered torrents list
This has a couple of benefits: 1) it is clearly visible to the user that
the list is filtered (doesn't display all the torrents) even when filter
bar is hidden, 2) doesn't lead to filter bar controls being shifted to
the left/right as when "Show:" label text changes.
2015-10-19 20:30:26 +00:00
Mike Gelfand 3b8829d3fb Display notifications via tray icon if dbus is not available 2015-10-18 11:48:10 +00:00
Mike Gelfand c8920abad6 #5993: Improve magnets handling in main window
Disable "Open Folder" and "Verify Local Data" actions for magnets in
Torrent menu. If more than one torrent is selected, "Verify Local Data"
is enabled but only non-magnets are verified if activated.
Add a few sanity checks when opening folder, just in case.
2015-10-04 06:16:59 +00:00
Mike Gelfand 0aa572b657 Refactor action groups initialization/handling and trackers merging a bit 2015-08-06 20:28:44 +00:00
Mike Gelfand f592083f15 Create dialogs on demand, don't keep them ready all the time 2015-07-30 06:18:02 +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/mainwin.h (Browse further)