This is applicable to any signals where emitter's lifetime isn't
controlled by the receiver.
There're still about 7 `Glib::signal_idle()` connections which aren't
tracked but I see the possibility of it leading to major issues as quite
low.
* fix: save log level, encryption mod, preallocation mode as ints
* fix: ensure log level is saved in tr_sessionGetSettings()
* fix: ensure the right verbosity row is selected
View-relative coordinates were treated as bin window-relative, leading to
incorrect selected item calculation.
Broken since the introduction of GTK 4 support in #3916.
* Compile images into an assets catalog
* Optionally sign resulting Mac bundle
* Move 3rd-party/utility/test targets to their own folders
* Enable ARC via compile options unconditionally
* Install base and localized resources into correct directory
This seems like a Xcode quirk: if subdirectory containing the resource file
matches the destination directory name (and probably if there's more than one
resource file being installed there), the resulting folder structure then
contains an extra subdirectory, i.e. Resources/dirname/dirname/resname.
* Group source files for better structure in IDEs (Xcode, VS)
* Remove Xcode project
Using Xcode is still possible via "Xcode" CMake generator.
* Use ad-hoc signature if one is not specified
* Always use ad-hoc signature on link, leave proper signing to CPack
* Install localized resources into correct directory (QL plugin)
* Don't include CTest (we don't use additional targets it provides)
* Revert "Remove Xcode project"
This reverts commit dc069f654f.
* Fix `readability-container-data-pointer` clang-tidy issues
* Fix `readability-container-size-empty` clang-tidy issues
* Fix `readability-isolate-declaration` clang-tidy issues
* Fix `readability-convert-member-functions-to-static` clang-tidy issues
* Fix `readability-else-after-return` clang-tidy issues
* Fix `readability-redundant-member-init` clang-tidy issues
* Fix `readability-uppercase-literal-suffix` clang-tidy issues
* Fix `readability-make-member-function-const` clang-tidy issues
* Fix `readability-simplify-boolean-expr` clang-tidy issues
* Fix `readability-qualified-auto` clang-tidy issues
* Fix `readability-avoid-const-params-in-decls` clang-tidy issues
* Fix `readability-implicit-bool-conversion` clang-tidy issues
* Fix `readability-inconsistent-declaration-parameter-name` clang-tidy issues
* Add initial .clang-tidy configuration
Currently enabling readability checks only, others to follow. Of the
four disabled readability checks, three (function-cognitive-complexity,
identifier-length, magic-numbers) require extensive refactoring and were
left for later, and one (redundant-access-specifiers) is not planned to
be fixed due to the current coding style - using extra sections to
separate methods from variables of the same visibility.
GLIBMM will catch them for us, but in two cases print a warning instead
of suppressing, and in one other case still print a warning (as well as
we do) but without context.
* Disable GTK 3 toolbars overflow menu
This prevents the toolbar from hiding its items when they don't fit. Not
an issue with GTK 4 where there's no dedicated toolbar widget and
associated logic.
* Increase default message log window width
In GLIB 2.68+ `Glib::RefPtr<>` is an alias for `std::shared_ptr<>` which
has no idea about GLIB's reference counting, thus destroying the object
instead of unreferencing it. Use `Glib::make_refptr_for_instance()` to
construct the smart pointer which passes in a custom reference-aware
deleter for us.
Fixes: #3954
* Sync translations with code
* Sync translations with Transifex
* Remove Mac menu title that isn't displayed and shouldn't be translated
* Add context to logging level strings in GTK client
* Use "µTP" consistently in code
* Use ellipsis instead of three docs in Qt client strings
* Close HTML tags in blocklist-related strings
* Remove trailing space from a translatable string in Qt client
* Add missing plural forms for English strings in Qt client
* Fix spelling: metaInfo -> metainfo
This allows to test against GTK 4 and Qt 6.
Changes to CMakeLists.txt files are non-functional and are meant to
trigger the components rebuild, nothing more.
* Make compact mode switch work for both GTK 3 and 4
* Implement GTK 4-specific view gesture handling
* Fix torrents view context menu on GTK 4
* Explicitly show/hide menubar on startup/teardown
* Switch from `Gtk::Pixbuf` to `Gio::Icon` for views
* Support GTK 4 exceptions based on `std::exception`
* Fix options menu setup with GTK 4
* Use `delete-event` (GTK 3) and `close-request` (GTK 4) signals to handle window clousure
* Add custom file chooser button implementation
GTK 4 drops FileChooserButton widget and suggests implementing it using
Button.
* Add helpers to set X11 hints with GTK 4
* Remove `HigWorkarea` class that's no longer used
* Make main menu shortcuts work with GTK 4
* Make drops work in main window and make dialog with GTK 4
* Remove unused `gtr_action_get_widget()` helper
* Fix text direction mark setup with GTK 4 (due to switch to enum class)
* Fix file tree font size calculation with GTK 4
* Fix crash during shutdown with GTK 4
* Switch from `RadioButton` to `CheckButton` for compatibility with GTK 4
* Fix opening files with GTK 4
* Rework torrent cell renderer to support both GTK 3 and 4
* Disable system tray icon support with GTK 4
* Fix windows positioning with GTK 4
* Fix focus event handling with GTK 4
* Adapt to tree model row/iterator changes in GTK 4
* Adapt to toplevel/root window changes in GTK 4
* Adapt to clipboard changes in GTK 4
* Adapt to icon/theme changes in GTK 4
* Adapt to file/path changes in GTK 4
* Random leftover fixes for GTK 4 compatibility
* Clean up unused code
* Move GTK 3 *.ui files into a subdirectory
* Add GTK 4 *.ui files
* Search for both GTK 3 and 4 during configuration
* build: rename GTK_MINIMUM, etc as GTKMM_MINIMUM in CMakeLists
* build: bump glibmm depdency min version to 2.60.0
https://github.com/transmission/transmission/issues/3846\#issuecomment-1263782526
for extraclassinit.h
* build: fix duplicated version number for deflate dependency
* build: sort dependency list in CMakeLists.txt
no functional changes, just housekeeping
* refactor: remove gtr_get_ptr()
* Move CSS definitions to resources
* Add Gtk::Builder helpers
* Switch StatsDialog to Gtk::Builder
* Switch RelocateDialog to Gtk::Builder
* Switch OptionsDialog to Gtk::Builder
* Switch MakeDialog to Gtk::Builder
* Switch FilterBar to Gtk::Builder
* Switch MainWindow to Gtk::Builder
* Switch MessageLogWindow to Gtk::Builder
* Switch DetailsDialog to Gtk::Builder
* Switch PrefsDialog to Gtk::Builder
* Fixup translatable strings
Since this branch was brewing for a while, changes happened in the meantime.
Current window management approach results in secondary windows being
destroyed once they are hidden. Since those windows are managed by
`std::unique_ptr<>`, we can't just [temporarily] increase their refcount
to avoid use-after-free situation, so retrieve updated top-level windows
list every time we hide one instead.
The default behavior is to send them to the window first to activate
mnemonics and accelerators. Some accelerators conflict with text
selection hotkeys (like CTRL+A to select all torrents), this fixes that
conflict.
* fix(gtk): prevent duplicate shortcut folders
This prevents duplicates if the recent destination is also a system
shortcut folder.
* refactor(gtk): create gtr_get_recent_dirs helper
* feat(gtk): remember 4 recent relocate dirs
The torrent list hotkeys include `CTR + A` and were always active,
swallowing text edit hotkeys in the filter entry.
Now they are only active when the torrent list is focused.
* refactor: tr_torrentGetMetadataPiece() returns an optional vector
* refactor: use tr_pathbuf in create_temp_path()
* refactor: use tr_pathbuf in win32 create_temp_path()
* refactor: use std::vector in isPeerInteresting()
* refactor: remove tr_new0 from tr_peerMgrPeerStats()
* refactor: remove tr_new0 from rechokeUploads()
* refactor: silence clang nullptr dereference warning
* refactor: make tr_natpmp a C++ class
* refactor: use std::string in tr_log_message
* Revert "refactor: remove tr_sessionGetConfigDir() (#3506)"
This reverts commit c50da43ae0.
* Revert "fix: do not leak in tr_getWebClientDir() (#3502)"
This reverts commit 5a75e37033.
* GTK ico
Restoring the more contemporary GTK icon makes some sense after being in GTK for the last while. Current 3.0 builds in flatpak, snap etc are using it, and having the client and tray match seems right.
* Updated the svg -> ico conversion method for better scaling
While i'm in Manjaro Linux and working on the GTK client for a little while, i noticed Linux wasn't included as a platform in the file, and the repetition of frontend and backend was annoying me.
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: use semantic type tr_torrent_type_t in libtransmission
* refactor: use semantic type tr_torrent_type_t in gtk client
* refactor: use semantic type tr_torrent_type_t in qt client
* perf: faster file tree building in GTK client
* perf: faster GTK client FileList
* use a std::map for faster node lookup when building a file tree
* use tr_get_mime_type_for_filename() for mime-type lookup
* remove unnecessary layer of indirection when building the
keys for lookuops in the mime-type icon cache
* be more careful to only call operator= on proxies whose values
have actually changed, since that assignment is expensive
* refactor: re-enable cert-err33-c clang-tidy warning
* refactor: use fmt::chrono in transmission-remote
* refactor: use fmt::chrono in transmission-show
* refactor: use fmt::chrono in GTK details dialog
* refactor: use fmt::chrono in tr_session
* refactor: remove tr_localtime_r
* refactor: remove tr_gmtime_r
* refactor: use fmt in gtk/SystemIconTray
* refactor: use fmt in gtk/MakeDialog
* refactor: remove unused tr_strip_positional_args()
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
* refactor: do not use va_arg in peer-msgs.cc
* refactor: do not use va_arg in platform.cc
* build: enable cert-dcl50-cpp clang-tidy warning
* refactor: use some tr_pathbuf where sensible
* refactor: make this variable const
* refactor: replace redundant type with auto
* refactor: use the nullptr literal
* refactor: replace declaration by structured binding declaration
* refactor: implement FileTreeItem::children_ with a std::vector
* fix: std::move should not be called on forwarding reference
* fix: uninitialized scalar variable
* fix: unchecked return value from library
* fix: dereference before null check
* fix: unchecked return value from library
* fix: unchecked return value from library
* fixup! refactor: implement FileTreeItem::children_ with a std::vector
* fix: signed-unsigned comparison in libtransmission tests
* fix: avoid unnecessary copy by using const reference
* fix: function should be declared const
* refactor: use fmt::format to build log timestamps
* fix: use init-statement to reduce variable scope
* fixup! refactor: use fmt::format to build log timestamps
* fix: remove tau_tracker destructor for rule-of-zero
* fix: remove tr_peerIo destructor for rule-of-zero
* Revert "fix: dereference before null check"
This reverts commit cd78967815.
* fix: signed-unsigned comparison in libtransmission tests
* fix: use init-statement to reduce variable scope
* fix: extract nested code block into separate method
* fix: extract nested code block into separate method
* fix: extract nested code block into separate method
* fix: use init-statement to reduce variable scope
* fix: extract nested code block into separate method
* fix: signed-unsigned comparison in libtransmission tests
* fixup! fix: extract nested code block into separate method
* fix: mark possibly-unused as [[maybe_unused]]
* fix: invalid stack memory reference in tr_found_file_t
* fix: signed-unsigned comparison in libtransmission tests
* fix: add default case to switch statement
* fix: remove redundant static specifier
* fix: use std::optional.value_or
* fix: make type of variable pointer-to-const
* refactor: move log state into a struct
* refactor: make tr_peerMgr constructor explicit
* fix: make type of variable pointer-to-const
* fix: replace insert with try_emplace
* fix: implicit conversion may lose precision
* fix: use init-statement to reduce variable scope
* chore: mark unused return value with (void)
* feat: add tr_strbuf class for building tmp strings
Based on fmt::basic_memory_buf, this is a growable string buffer that
has an initial size that's large enough to build most filenames or URLs
without needing heap allocations.
Adds a couple of extra helpers such as a `c_str()` method to make dealing
with old zero-terminated string APIs easier.
* fix: break will never be executed
* refactor: compile the name fallback string
* fix: replace redundant type with auto
* fix: use init-statement to reduce variable scope
* fix: implicit conversion loses precision
* fix: use in-class initializer
* fix: make variable a pointer-to-const
* fix: local variable name shadows class variable
* fix: implicit conversion may lose precision
Add a getter/setter for torrent announce URLs as text that can be copied
and pasted: one URL per line, with a blank line between tiers.
C API: tr_torrentGetTrackerList() and tr_torrentSetTrackerList()
RPC APi: `trackerList` in `torrent-get` and `torrent-set`.
This deprecates `trackerAdd`, `trackerRemove`, and `trackerEdit`
from the RPC API.
* fix: make variable a pointer-to-const
* fix: use init-statement to reduce variable scope
* fix: implicit conversion from long to int
* fix: refactor to not nest more than 3 if|for|do|while|switch statements
* fix: make tr_session::setSocketTos() const
* fix: use array.prototype.some instead of a for loop
* refactor: use nullptr instead of NULL
* fix: oops
* refactor: add fetch options object to tr_webRun()
Fold `tr_webRun()`, `tr_webRunWithCookies()`, and `tr_webRunWebseed()`
into a single API that takes an options argument that callers can
customize to their needs.
Also does a surface cleanup pass to the tr_webseed and tr_web internal
structures, e.g. making fields const where possible, not using raw
pointers, and making some fields private.
This revision is still full of code smells. Refactoring the entire
system is overwhelming, so instead I'm doing it in incremental steps.
Fixes#154. The current 'corrupt' label can confuse users to think that
there is corrupt data on the disk. The phrasing has been changed:
- Downloaded: 1.91 GB
- Corrupt DL: 22.02 MB
+ Downloaded: 1.91 GB (+22.02 MB discarded after failed checksum)
* refactor: prefer constexpr over enum for GUI_PAD values
* refactor: prefer constexpr over enum for PrefsDialog values
* refactor: prefer constexpr over enum for StatsDialog values
* refactor: use enum class for GtrUnicode types
* refactor: prefer constexpr over enum for BT peer msg codes
* refactor: use enum class for TrMakemetaResult
* refactor: prefer constexpr over enum for BT metadata message types
* refactor: use enum class for AwaitingBt
* refactor: use enum class for EncryptionPreference
* refactor: use enum class for TrFormat in rpcimpl
* refactor: prefer constexpr over enum for QApp intervals
* refactor: prefer constexpr over enum for tr_resume bitfields
* refactor: prefer constexpr over enum for Qt/TrFileModel bitfields
* refactor: remove obsolete TODO comment in announce-list