21 Commits

Author SHA1 Message Date
Charles Kerr
bfa1950fbe feat: native icons in Qt client (#7819)
* chore: savepoint

* chore: code style

* refactor: add std::string_view constructor for NativeIcon::Spec

* chore: add TODO comment

* feat: honor per-desktop HIG on when to show menu icons

* chore: remove Faenza system-run icon

unused since b58e95910b

* chore: remove Faenza view-refresh icon

not needed due to b58e95910b

* chore: remove Faenza media-playback-pause icon

not needed due to b58e95910b

* chore: remove Faenza media-playback-start icon

not needed due to b58e95910b

* chore: add a safeguard against merging with incomplete TODO items

* feat: add more icons

refactor: remove some tracer cerr statements

* refactor: remove IconCache use from MainWindow

* chore: remove Faenza icon set

* chore: re-enable remote session network icon

* fix: FTBFS on Windows

* refactor: use symbolic names for Segoe icons

* docs: add links to Segoe MDL2 Assets icon list

* chore: savepoint

segoe icons work

still a WIP; includes test code that should not ship

* feat: use segoe::FastForward for action_StartNow

feat: use segoe::Move for action_SetLocation

refactor: make it easier for devs to force a font at compile time for development work

segoe license does not allow bundling but does allow dev work

chore: code_style.sh

* refactor: remove unused addEmblem()

* docs: add code comment on how to force an icon font

* fix: Win 10, 11 icons play nicely with dark mode

* chore: savepoint

add draft of SF Symbol -> QPixmap loader

* chore: remove dangling font reference from qrc file

* fix: FTBFS

* refactor: use bribri code for NSImage -> QPixmap

* feat: support dark, light mode when rendering SF Symbol monochrome icons

* fixup! feat: support dark, light mode when rendering SF Symbol monochrome icons

fix: fail gracefully on macOS 11

* chore: code style

* chore: tweak some SF Symbol icon choices

* chore: consistent uppercase for hex segoe QChars

* chore: undefine DEV_FORCE_FONT_FAMILY and DEV_FORCE_FONT_RESOURCE

* chore: savepoint

* refactor: clean up NativeIcon impl

* refactor: remove unused MenuMode::Other

* refactor: DRY in FilterBar::createActivityCombo()

* chore: remove obsolete code comment

* refactor: rename icons::Facet as icons::Type

* fix: oops

* refactor: minor cleanup

* fix: tyop

* chore: remove unused #includes

* fix: add modes for some icons

* refactor: tweak some icon choices on macOS

* fix: ensure icons are visible on File, Help menus

fix: remove unused local variable

* refactor: tweak some icon choices for XDG

* refactor: remove the fallback QStyle::StandardPixmaps

These interfere with deciding whether an icon is well-defined and
unambiguous as per the macOS and Windows HIG guidelines.

If a standard or unambiguous icon exists in the native icon sets,
specify it with an SF Symbols name, a Segoe codepoint,
or XDG standard icon name. Otherwise, leave those fields blank.

* refactor: remove unused #includes

* docs: add "choosing icons" section in NativeIcons.cc

* refactor: simplify icons::shouldBeShownInMenu()

* refactor: reduce unnecessary code shear from main

* refactor: make TorrentDelegate::warning_emblem_ const

* refactor: extract-method MainWindow::updateActionIcons()

* feat: update MainWindow icons when light/dark theme changes

* feat: restore the QStyle::StandardPixmaps as fallbacks

Can be used on older Windows / macOS if Segoe or SF Symbols are unavailable

* refactor: add button text for add/edit/remove tracker buttons

QStyle::StandardPixmap doesn't have good icons for these,
so let's ensure that these buttons have visible text.

* fix: building NativeIconMac.mm on mac even if not clang

* chore: iwyu in new code

* docs: tweak the "Choosing Icons" comments again

* fix: handle changed QStyles in icons::icon()

do not cache point_sizes set between calls

refactor: const correctness

* fixup! refactor: simplify icons::shouldBeShownInMenu()

refactor: minor code tweak, declare vars in order that they are used
2025-11-30 10:09:20 -06:00
Charles Kerr
7820f54ba1 refactor: remove TR_DISABLE_COPY_MOVE macro (#7344) 2024-12-29 00:15:39 -06:00
Julien
8ac323d5d6 chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
Julien
4b8cfa2e57 chore: update copyrights to 2023 (#4834) 2023-02-11 14:49:42 -06:00
Charles Kerr
83ffa6bf1b chore: fix spdx abbreviations (#3602) 2022-08-08 13:05:39 -05:00
Charles Kerr
df1cca9b57 chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Mike Gelfand
3e072f9bd4 Fix most of critical issues reported by Sonar (GTK client) (#2309)
* (C++) Macros should not be used to define constants

* (C++) Memory should not be managed manually

* (C++) "void*" should not be used in typedefs, member variables, function parameters or return type

* (C++) When the "Rule-of-Zero" is not applicable, the "Rule-of-Five" should be followed

* (C++) "switch" statements should have "default" clauses

* (C++) "explicit" should be used on single-parameter constructors and conversiosn operators

* (C++) Non-const global variables should not be used
2021-12-14 11:43:27 +03: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
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
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
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
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
2cc5cfe3e3 feat: smart caching of TorrentDelegate::sizeHint() (#1026)
* feat: smart caching of TorrentDelegate::sizeHint()

* chore: bump c++ requirement to c++17 / c++1z
2019-11-06 18:17:48 -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
2248d3670f Get rid of $Id$ SVN keywords in source files 2016-09-02 23:10:15 +03:00
Jordan Lee
1af60ad6ad use '#pragma once' instead of #ifndef..#define..#endif guards 2016-03-29 16:37:21 +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