Commit Graph

21 Commits

Author SHA1 Message Date
Charles Kerr 07d96036d9
refactor: Values pt. 6 - remove deprecated API (#6250) 2023-11-14 17:23:51 -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
Mike Gelfand a89b181f2c
Include individual headers (GTK client) (#4477)
This results in up to 15% single-threaded build time reduction.
2022-12-27 01:43:20 +00:00
Mike Gelfand 5fd0aff818
Automatically (re)order include directives (GTK client) (#4475)
* Automatically (re)order include directives (GTK client)

Include our headers first to ease IWYU enforcement.

* Fix includes missing from headers (GTK client)

* Fix build on Mac after includes reordering
2022-12-26 21:13:21 +00:00
Mike Gelfand 49ce12ce38
Fix issues reported by clang-tidy `cppcoreguidelines` checks (GTK client) (#4158)
* Fix `cppcoreguidelines-pro-type-cstyle-cast` clang-tidy issues

* Fix `cppcoreguidelines-pro-type-member-init` clang-tidy issues

* Fix `cppcoreguidelines-prefer-member-initializer` clang-tidy issues

* Introduce `PageBase` for `PrefsDialog` pages

This is in preparation for next PR fixing `Glib::Timer` memory
management.

* Fix `cppcoreguidelines-owning-memory` clang-tidy issues

* Fix `cppcoreguidelines-pro-bounds-array-to-pointer-decay` clang-tidy issues

* Fix `cppcoreguidelines-special-member-functions` clang-tidy issues

* Fix `cppcoreguidelines-init-variables` clang-tidy issues

* Fix `cppcoreguidelines-macro-usage` clang-tidy issues

* Fix `cppcoreguidelines-pro-bounds-constant-array-index` clang-tidy issues

* Fix `cppcoreguidelines-non-private-member-variables-in-classes` clang-tidy issues

* Fix `cppcoreguidelines-pro-type-vararg` clang-tidy issues

* Fix `cppcoreguidelines-pro-bounds-pointer-arithmetic` clang-tidy issue

* Fix `cppcoreguidelines-pro-type-reinterpret-cast` clang-tidy issues

* Fix `cppcoreguidelines-pro-type-static-cast-downcast` clang-tidy issues

* Extend clang-tidy configuration

Enable all `cppcoreguidelines` checks except for three (`avoid-magic-
numbers`, `avoid-non-const-global-variables`, `narrowing-conversions`)
which require [more] extensive refactoring and were left for later.
2022-11-13 17:36:16 +00:00
Mike Gelfand da27c3d18d
Prefer ayatana-appindicator over appindicator, if present (#4001) 2022-10-20 18:15:13 +01:00
Mike Gelfand c75c6bf5c8
Add support for GTK 4 (#3916)
* 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
2022-10-09 01:50:03 +03:00
Charles Kerr 29f57bc296
chore: iwyu headers (#3661) 2022-08-17 11:08:36 -05:00
Charles Kerr 205abbbcce
refactor: iwyu string, vector, cstdint (#2898)
* refactor: use cstdint for intX_t types

* refactor: iwyu sstring_view

* refactor: iwyu <cstring>

* refactor: iwyu <vector>
2022-04-07 20:50:26 -05:00
Charles Kerr ffda5bb68a
refactor: remove tr_strip_positional_args() (#2881)
* 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>
2022-04-07 08:23:04 -05:00
Charles Kerr ebb2ab6aee
chore: update license spdx abbreviations (#2582)
Use SPDX license list 3.0 terminology: replace deprecated identifiers
GPL-2.0" and "GPL-3.0" with "GPL-3.0-only" and "GPL-3.0-only".
2022-02-07 10:25:02 -06:00
Charles Kerr e908193027
fix: some use-init-statement sonarcloud warnings (#2563) 2022-02-01 19:09:11 -06:00
Charles Kerr 878405f862
Revert "fix: sonarcloud (#2558)" (#2562)
This reverts commit 8b9483f7fb.
2022-02-01 11:30:51 -06:00
Charles Kerr 8b9483f7fb
fix: sonarcloud (#2558)
* fix: add const modifier for functions

* fix: many sonarcloud use-init-statement warnings
2022-01-31 22:46:27 -06:00
Charles Kerr df1cca9b57
chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Mike Gelfand d8d361e491
Make some utility functions return std::string to simplify code (#2368)
* tr_formatter_speed_KBps returns std::string

* tr_formatter_mem_B returns std::string

* tr_formatter_size_B returns std::string

* tr_strpercent/tr_strratio returns std::string
2021-12-31 03:30:21 +03: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
Mike Gelfand 82b3da0a54
Don't use deprecated GTK APIs (#2129)
* Don't use deprecated Glib::Thread

* Don't use deprecated stock ID APIs

* Don't use deprecated operator const void* in IconInfo

* Don't use deprecated Gtk::TreeView::set_rules_hint()

* Don't use deprecated Gtk::Widget::set_margin_left()

* Don't use deprecated Gtk::UIManager

* Don't use deprecated sigc::mem_ptr accepting object pointer

* Enable {GDK,GIO,GLIB,GTK,PANGO,SIGCXX}MM deprecation guards

* Enable GTK deprecation guard

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-11-12 12:12:50 +03:00
Mike Gelfand c95616eb26
Bump minimum GTK version to 3.24 (#2112) 2021-11-07 13:08:17 +03:00
Mike Gelfand eaeed301fa
Rename GTK client files to match the classes they contain (#2073)
This also brings naming closer to Qt client which simplifies things a
bit.
2021-11-01 03:11:23 +03:00
Renamed from gtk/tr-icon.cc (Browse further)