Commit Graph

820 Commits

Author SHA1 Message Date
Charles Kerr 1413346fa2
fix: details dialog "available" percent can be off (#2025)
It's often off by a little bit because it fails to account for blocks
we've downloaded but haven't been verified yet. Copied the fix from the
GTK client.
2021-10-23 23:45:10 -05:00
Charles Kerr d70c8387b3
fixup! refactor: use qt5's connect api (#1491) (#2024)
* fixup! refactor: use qt5's connect api (#1491)

fix broken signal connection in session dialog
2021-10-23 22:28:16 -05:00
Daniel Kamil Kozar 4996f3356a
Add a "Start Now" action to the notification window in the Qt client (#848)
* Add a "Start Now" action to the notification window in the Qt client

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-10-23 09:26:28 -05:00
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
Daniel Kamil Kozar 77b11232f2
Add support for creating torrents with a source flag (#443)
* Add support for creating torrents with a source flag

* Add the source flag functionality for Mac OSX

* Source flag should be a part of the info dictionary

* Address review comments

* Rename "sourceFlag" to "source" since "Flag" is usually reserved for booleans.
* Free the "source" pointer in tr_metainfoFree.
* Add information about transmission-create argument to its manpage.

* Replace all occurences of "sourceFlag" with "source" and use "Source tag" in UI

* Settle on just "Source" in UI

* The last usage of "flag" hopefully bites the dust! ;-)

* Add a missing free for the source in tr_metainfoFree

* Add a "source" field to the torrent-get RPC method

* uncrustify

* Test for torrents having different infohashes due to different source flags.

This is the whole point of this feature, so it makes sense to test it.

* case is important

* try to incorporate the macosx xml changes
2021-10-18 18:05:39 -05:00
Charles Kerr 9f639868b8
perf: remove unused variables in qt details dialog (#1987) 2021-10-18 11:25:43 -05:00
Charles Kerr 4b4948d26d
build: silence new clang-tidy 13 warnings (#1982)
* build: silence new clang-tidy 13 warnings

* build: remove WarningsAsErrors in libT-tests .clang-tidy
2021-10-17 19:48:33 -05:00
Charles Kerr 567f1e48c8
tr_quark_new() now takes a std::string_view (#1961) 2021-10-15 08:28:47 -05:00
Charles Kerr 148de2da94
chore: allow vararg calls in qt/.clang-tidy (#1929)
let clang-tidy allow C-style vararg functions
2021-10-11 17:37:43 -05:00
Dinesh Manajipet ac41837ae9
Feature: Support Batch Adding Tracker Urls in Qt UI (#1161)
Adding tracker urls one at a time is very tedious.
This lEts you add multiple tracker urls at oNce, 1 trAcker url per line.
As a bonus, this also takes care of trailing spaces when pasting urls.

Fixes #1148
And this seems to be a requested feature:
https://forum.transmissionbt.com/viewtopic.php?t=18958

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-10 22:19:36 -05:00
Charles Kerr 1ba64684f9
refactor: C++ify clients.cc (#1907)
* refactor: use C++17 for clients.cc
2021-10-08 21:46:10 -05:00
Charles Kerr f876a100a0
refactor: add [[fallthrough]] annotation (#1886) 2021-10-06 12:24:02 -05:00
Charles Kerr 003685b40a
refactor: use nullptr instead of NULL (#1884)
* refactor: use nullptr instead of NULL.

No functional changes; just more C++ification
2021-10-06 11:32:17 -05:00
Charles Kerr cc204e0b2c
refactor: prefer "using" over "typedef" (#1883)
* refactor: prefer "using" over "typedef"
2021-10-06 09:26:07 -05:00
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
dubhater a7370fe8fb
Qt: Move icon after "Alternative Speed Limits" label (#503)
Looks better and matches the Gtk client.

Co-authored-by: dubhater <cantabile.desu@gmail.com>
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-08-07 17:57:59 +03:00
dubhater f804043b85
Qt: Use file selector in Set Location if session is local (#502)
It's the only place where Session::isServer() is used to decide if
a file selector should be used, or a text box. Session::isLocal()
is used everywhere else.

Co-authored-by: dubhater <cantabile.desu@gmail.com>
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-08-07 17:08:37 +03:00
dubhater 6f76d8fae7
Qt: Add tooltips for Options, Statistics buttons (#501)
Same as in the Gtk client.

Co-authored-by: dubhater <cantabile.desu@gmail.com>
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-08-07 14:21:06 +03:00
Charles Kerr 07d385cf44
refactor: torrent-complete-sound-command is a list (#1710)
* refactor: torrent-complete-sound-command is a list
2021-05-25 11:21:41 -05:00
Charles Kerr 16ec15d84b fixup! fix: dangling reference crash in FreeSpaceLabel (#1604) 2021-05-22 10:53:52 -05:00
Charles Kerr 5c8f7d410c
refactor: qt deprecations, pt 1 (#1707)
* refactor: use QMultiMap in DetailsDialog::onRemoveTrackerClicked()

* refactor: use 'QWindowFlags = {}' in BaseDialog

Fixes deprecated use:

> ../qt/BaseDialog.h:16:59: warning: 'QFlags' is deprecated: Use default constructor instead [-Wdeprecated-declarations]

* refactor: remove empty string in string_view ctor

Fixes readability-redundant-string-init warning:

> ../qt/Prefs.cc:379:20: error: redundant string initialization [readability-redundant-string-init,-warnings-as-errors]
>    auto constexpr SessionUsername = std::string_view { "" };
>                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-05-21 16:38:08 -05:00
Charles Kerr c9a9652abf
silence readability-function-cognitive-complexity (#1703) 2021-05-20 15:00:20 -05:00
Charles Kerr 7fd9fa15b7
fix: dangling reference crash in FreeSpaceLabel (#1694)
* fix: dangling reference crash in FreeSpaceLabel

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-05-18 12:36:46 -05:00
Charles Kerr 090a4b5ff8
fix: dangling reference crash in FreeSpaceLabel (#1604) 2021-01-24 22:20:21 -06:00
Charles Kerr 270a937909
feat: add remote server version to the about dialog (#1603) 2021-01-24 11:43:14 -06:00
Charles Kerr 41f225df7b
Remove posix memalign (#1520)
* refactor: remove unnecessary func tr_valloc()

We're only using it in a handful of places, and none of them need the
kind of alignment that posix_memalign() provide. So we can drop a few
dozen lines by removing the portability wrapper.
2020-11-15 15:53:42 -06:00
Charles Kerr 9d313a8816
sonarcloud warnings 9 (#1511)
* refactor: const correctness 

* refactor: fix some implicit conversions

* refactor: make local pointers const if their objects are not modified

* refactor: do not cast away const in torrent-cell-renderer

* refactor: remove call to deprecated gtk_icon_size_lookup_for_settings

* refactor: member functions that do not mutate their objects should be declared const

* chore: do not end comments with a semicolon
2020-11-08 21:31:02 -06: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 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
Mike Gelfand a6798adf2c Sync existing translations with Transifex 2020-11-03 20:26:30 +03:00
Charles Kerr 0bfbc3eba7
Sonarcloud warnings 4 (#1499)
* chore: fix some sonarcloud html warnings (e.g. deprecated attribute use)

* chore: uppercase literal suffixes

* chore: remove redundant casts

* chore: remove commented-out code

* chore: use qInfo() instead of std::cerr
2020-11-02 09:16:12 -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 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 973e63d897
refactor: use qt5's connect api (#1491)
* refactor: use qt5's connect syntax everywhere

https://wiki.qt.io/New_Signal_Slot_Syntax
2020-10-31 13:56:12 -05:00
Mike Gelfand 7cbfaf9d59 Fix qt/IconCache includes 2020-10-14 13:18:14 +03:00
Charles Kerr f59118d1fe
feat: add torrent-get 'primary-mime-type' to RPC. (#1464)
* feat: add torrent-get 'primary-mime-type' to RPC.

This is a cheap way for RPC clients to know what type of content is in a
torrent. This info can be used to display the torrent, e.g. by using an
icon that corresponds to the mime type.

* use size_t for content byte count

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* explicit boolean expressions

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* use uint64_t for content byte counts

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* avoid unnecessary logic branches

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* explicit cast

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* refactor: add an autogenerated mime-type.h header

* chore: maybe fix the win32 FTBFS

* chore: add mime-types.[ch] to xcode

* Squashed commit of the following:

commit 4c7153fa48
Author: Mike Gelfand <mikedld@users.noreply.github.com>
Date:   Tue Oct 13 03:15:19 2020 +0300

    Remove autotools-based build system (#1465)

    * Support .git files (e.g. for worktrees, submodules)
    * Fix symlinks in source tarball, switch to TXZ, adjust non-release name
    * Remove autotools stuff

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2020-10-13 10:33:56 -05:00
Mike Gelfand 4c7153fa48
Remove autotools-based build system (#1465)
* Support .git files (e.g. for worktrees, submodules)
* Fix symlinks in source tarball, switch to TXZ, adjust non-release name
* Remove autotools stuff
2020-10-13 03:15:19 +03:00
Mike Gelfand 32add75f0e Add new translations from Transifex (95% and higher)
Qt client: Arabic, Hebrew, Hindi, Croatian, Chinese (Taiwan).
2020-10-03 15:38:00 +03:00
Mike Gelfand 3a4cc558b6 Sync existing translations with Transifex 2020-10-03 15:36:23 +03:00
Charles Kerr 92fc42ceb5
Scrape www subdomain for favicon (#1451)
* fix: scrape other subdomains for favicon
2020-09-17 00:38:13 -05: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 bda60c5a18
feat: add 'TR_RPC_VERBOSE' env variable in Qt app. (#1435)
When set, this will log the RPC messages sent between the GUI and the
backend. This replaces the old `#ifdef DEBUG_HTTP` as something that can
be enabled without needing to recompile.
2020-09-08 17:20:46 -05:00
Charles Kerr 542feef77d
refactor: make torrents' mime icons lazy-loaded. (#1433)
* refactor: make torrents' mime icons lazy-loaded.

Another "small wins" patch, this time on CPU: icon loading is expensive,
so calculating them for every torrent all at once on startup isn't the
smartest way to do it.
2020-09-08 11:51:33 -05:00
Mike Gelfand 138ee3d7a0 Fix ICC build error due to template argument type reduction failure 2020-09-08 18:53:39 +03:00
Charles Kerr b156f55dca
refactor: use a vector for FavIcon cache keys (#1432)
* refactor: use a vector for FavIcon cache keys

Third of three PRs focused on small memory wins in transmission-qt.
This one saves 1-2 M off RES in my 15K torrent testbed. Not a major
improvement, but nice enough.

Previously we held the torrent's tracker keys in an unordered_set.
That container type is overkill for this field: the list is usually
short and almost never changes, so we don't need fast insertion time.
We can keep the same log N lookup by using a sorted vector and avoid
the excess container size & memory allocations of an unordered_set.
2020-09-08 08:58:14 -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 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 90ce7efc09
fixup: qt client nicer torrent add handling (#1427)
* refactor: omit unnecessary #include

* refactor: make the onDuplicatesTimer slot private.

* feat: show dupe torrents in dialog's detailText

* fix: a stupid bug that I introduced.
2020-09-07 10:20:48 -05:00
Charles Kerr fdaad67def fixup! refactor: make variant_headers reusable to qt app. (#1369) 2020-09-07 00:33:46 -05:00