Commit Graph

9 Commits

Author SHA1 Message Date
Charles Kerr 236a0965fa
refactor: tr_variant*Str() functions now take a std::string_view (#1990)
* refactor tr_variant*Str functions now take a std::string_view

* refactor: tr_torrentPrimaryMimeType returns a string-view
2021-10-19 21:30:50 -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 6b0408b320
refactor: fix more sonarcloud warnings (#1509)
* chore: simplify loop logic

* refactor: simplify isValidUtf8()

* refactor: use std::make_unique in Application::Application

* refactor: avoid raw pointers in DetailsDialog

* refactor: simplify DetailsDialog::refreshPref()

* refactor: make Application methods const

* refactor: reduce cognitive complexity of buildTrackerSummary()
2020-11-08 13:54:40 -06: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 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 1bb9e2eef2
refactor: speed up FaviconCache::add() again. (#1402)
* refactor: speed up FaviconCache::add() again.

Another iteration on FaviconCache::add() since it's still showing up so
high in my perf tests. add()'s url argument is now a QString instead of
a QUrl, and the class has a private unordered_map that maps QString urls
into Keys. Basically, QUrl generation is so expensive that it's worth
caching the result to avoid constructing the intermediate QUrl object.

Also, ensure that the network reply's `deleteLater()` method is called
so that they don't leak, and add 'svg' to the icon list since it's now
supported on all major browsers.
2020-08-26 14:00:39 -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 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