1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-02 21:16:04 +00:00
Commit graph

726 commits

Author SHA1 Message Date
Charles Kerr
aa9b752cd9
refactor: don't load the same stock more than once (#1041)
* refactor: don't load the same stock more than once

Some actions share an icon -- for example, "start all", "start now", and
"start" each use "media-playback-start". When this happens, get the icon
once and cache it to avoid hitting the disk more often than necessary.

In addition, the statusbar's network transfer icon was being reloaded in
a periodic upkeep timer, reloading with QIcon::fromTheme each time. Only
give icons are needed, so load them once and cache them.

* refactor: better lookup of torrent mime-type icons

filename-to-mime-type and mime-type-to-icon lookups are both expensive,
so do a better job of detecting top-level folders and caching the icons
based on file suffixes.

This also lets find a good mime icon even if the torrent doesn't have
its 'files' property populated yet from RPC.
2019-11-06 15:09:04 -06:00
Charles Kerr
abac811dd2
fix: gcc warnings in libtransmission/ and utils/ (#843)
* fix: __attribute__(__printf__) warnings

* fix: implicit fallthrough warning

* fixup! fix: implicit fallthrough warning

* fix: disable warnings for 3rd party code

Since we want to leave upstream code as-is

* fixup! fix: disable warnings for 3rd party code

* fixup! fix: disable warnings for 3rd party code

* silence spurious alignment warning

Xrefs
Discussion: https://stackoverflow.com/a/35554349
Macro inspiration: 90ac46f710/f/src/util/util_safealign.h (_35)

* fixup! fix: disable warnings for 3rd party code

* fixup! fix: implicit fallthrough warning

* make uncrustify happy

* remove uncrustify-test.sh

that's probably off-topic for this PR

* fixup! fix: __attribute__(__printf__) warnings

* Update libtransmission/CMakeLists.txt

Co-Authored-By: ckerr <ckerr@github.com>

* fixup! silence spurious alignment warning

* use -w for DISABLE_WARNINGS in Clang

* refactor: fix libtransmission deprecation warnings

* fix: pthread_create's start_routine's return value

This was defined as `void` on non-Windows but should have been `void*`

* chore: uncrustify

* fix: add DISABLE_WARNINGS option for SunPro Studio

* fix "unused in lambda capture" warnings by clang++

* fix 'increases required alignment' warning

Caused from storing int16_t's in a char array.

* fix net.c 'increases required alignment' warning

The code passes in a `struct sockaddr_storage*` which is a padded struct
large enough for the necessary alignment. Unfortunately it was recast as
a `struct sockaddr*` which has less padding and a smaller alignment. The
warning occrred because of these differing alignments.

* make building quieter so warnings are more visible

* fixup! fix 'increases required alignment' warning

* Fix -Wcast-function-type warnings in GTK+ app code

https://gitlab.gnome.org/GNOME/gnome-terminal/issues/96 talks about both
the issue and its solution.

GCC 8's -Wcast-function-type, enabled by -Wextra, is problematic in glib
applications because it's idiomatic there to recast function signatures,
e.g. `g_slist_free(list, (GFunc)g_free, NULL);`.

Disabling the warning with pragmas causes "unrecognized pragma" warnings
on clang and older versions of gcc, and disabling the warning could miss
actual bugs. GCC defines `void (*)(void)` as a special case that matches
anything so we can silence warnings by double-casting through GCallback.

In the previous example, the warning is silenced by changing the code to
read `g_slist_free(list, (GFunc)(GCallback)g_free, NULL);`).

* fixup! fix "unused in lambda capture" warnings by clang++

* fixup! fix "unused in lambda capture" warnings by clang++

* fix two more libtransmission compiler warnings

* fix: in watchdir, use TR_ENABLE_ASSERTS not NDEBUG
2019-11-06 11:27:03 -06:00
Mike Gelfand
eef4799388 Update Uncrustify config to 0.69 2019-07-15 02:30:41 +03:00
Mike Gelfand
10cdd7f790 Use explicit boolean conversions 2019-07-14 16:25:07 +03:00
Mike Gelfand
f3951faf3d Actually add new languages to the build 2019-03-13 23:35:16 +03:00
Mike Gelfand
95dd630ed4 Add new translations from Transifex (95% and higher)
GTK client: Portuguese (Portugal).

Qt client: Afrikaans, Catalan, Danish, Greek, Norwegian Bokmål, Slovenian.

Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
2019-03-06 03:14:15 +03:00
Mike Gelfand
3debbc7cb8 Sync existing translations with Transifex 2019-03-06 03:12:51 +03:00
Mike Gelfand
82df3a87f4 Update to Uncrustify 0.68.1
Tweak a few rules in the process. Now all code in cli, daemon, gtk,
libtransmission, qt, and utils is properly formatted with no manual
intervention.
2019-02-15 09:21:48 +03:00
Charles Kerr
7058f37bed
Merge pull request #816 from PeterDaveHello/improve-shellscript
fix shell script syntax errors and spacing inconsistencies
2019-02-01 22:36:54 -06:00
Peter Dave Hello
7a0d2e63c7 Refactor shell scripts with syntax and styling fixes 2019-01-16 03:22:29 +08:00
fetzu
3c0cb395c5 Updated copyright strings to 2019
Updated Transmission Project copyright dates to 2005-2019 in headers and code.
2019-01-11 19:36:19 +01:00
dubhater
e19ab0b7a9
Qt: Fix bad downloaded percentage in DetailsDialog
It was always 0.0% as long as the torrent was not finished.
2018-03-08 14:12:52 +02:00
Mike Gelfand
991f066618 Fix progress bar width with Breeze style (Qt client)
In compact torrents view, use BAR_WIDTH as groove area width instead of
total progress bar width, to improve the appearance in case progress text
is drawn outside of the groove area (because of style settings).

Initial patch provided by dubhater.

Fixes: #491
2018-02-03 22:36:54 +03:00
dubhater
1e850cd874
Qt: Fix assert with one-letter root folder names
An assertion failure happens shortly after opening the
"Torrent properties" dialog if the torrent's root folder has
a one-letter name, e. g.
A/
A/Some Linux distro.iso
A/Some other Linux distro.iso

Off by one errors are great, eh?

This fixes https://trac.transmissionbt.com/ticket/6141
2018-01-30 23:44:12 +02:00
Mike Gelfand
94be7dbd9b Merge branch '2.9x' 2018-01-25 03:07:52 +03:00
Mike Gelfand
aa2730d47c Switch to HTTPS links, adjust wiki links where possible
Fixes #39
2018-01-16 01:12:59 +03:00
Robert Vehse
a6ef87b92d Update all instances of the donation link. Fixes #26. 2018-01-15 23:57:46 +03:00
cantabile
ecefb992a1 Show file names in tooltips in Torrent Properties
File names are often too long to fit. Hovering is much easier than
resizing the column and possibly the window.
2017-09-30 20:26:49 +03:00
Mike Gelfand
d2acb0fada Don't force debug configuration in qmake project 2017-07-21 01:39:55 +03:00
Mike Gelfand
88134ea62f Make version text in about dialog selectable/copyable (Qt client)
Closes: #326
2017-07-17 23:38:19 +03:00
Mike Gelfand
375f2642c8 Revert dd538539aa, fix RPC queue processing
Queue callback for items returning no new future was never called leaving
queue alive and leading to memory leak in Qt client.
2017-07-15 08:46:31 +03:00
Mike Gelfand
7e6f1a8dc8 Set idle seed limit range to 1..40320 (4 weeks tops) in all clients
Fixes: #212
2017-07-05 21:07:16 +03:00
Fish2
b0e3d4c37d lossless compression of images saved 72KB 2017-06-03 23:52:34 +01:00
Mike Gelfand
82722476aa Fix some issues reported by Coverity 2017-05-20 23:31:56 +03:00
Mike Gelfand
80cebdd296 Sync Qt translations with Transifex 2017-05-20 00:15:53 +03:00
Mike Gelfand
fe1e88f843 Sync Qt translations with code 2017-05-19 23:11:47 +03:00
Mike Gelfand
69aa2f9491 Move pl_PL translations to pl 2017-05-19 23:11:06 +03:00
Mike Gelfand
5dc1192792 Move tr_TR translations to tr, sync list in qtr.pro 2017-05-19 21:49:04 +03:00
Mike Gelfand
6b0229a546 Fix some issues reported by Coverity 2017-05-16 21:37:00 +03:00
Mike Gelfand
dd538539aa Fix torrent file trashing upon addition (Qt client) 2017-05-02 21:35:56 +03:00
Thomas Hines
b3e30c0502 Added queue up/down hotkeys to the Qt interface. 2017-05-01 18:57:06 +03:00
Mike Gelfand
14370e5353 Fix a number of other style inconsistencies met along the way (part 2) 2017-05-01 18:47:49 +03:00
Mike Gelfand
e1d53855f4 Avoid declaring multiple variables on the same line 2017-05-01 18:46:41 +03:00
Mike Gelfand
f1656bc209 Don't return NaN from Torrent::percentComplete (Qt client) 2017-05-01 12:55:52 +03:00
Mike Gelfand
c5e730c63a Only compare magnet state if not yet different 2017-05-01 12:45:09 +03:00
Christian Muehlhaeuser
6dd034b826 Fix sorting by progress (Qt client)
Magnet transfers caused the by-progress sorting to become non-stable, as their
percentComplete() could return NaN. This patch fixes this by preferring active
downloads over magnet transfers, then sorting them by percentComplete().
2017-05-01 12:44:47 +03:00
Mike Gelfand
fbd8d4c79f Fix a number of other style inconsistencies met along the way 2017-04-30 19:33:55 +03:00
Mike Gelfand
a762c770f2 Make conditional expressions explicitly boolean 2017-04-30 19:26:01 +03:00
Mike Gelfand
6da99c05e2 Use nullptr consistencty instead of 0 and NULL (Qt client) 2017-04-30 19:26:01 +03:00
Mike Gelfand
7bfd7f5863 Avoid declaring variables inside conditional expressions (Qt client) 2017-04-30 19:25:57 +03:00
Mike Gelfand
4f9d9ad92b Code style change leftovers
For some reason, GTK client wasn't fully processed. All the rest of changes
are mostly in comments.
2017-04-21 10:40:57 +03: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
c77946e49a Set icon for "Open URL" action (Qt client) 2017-02-18 21:22:34 +03:00
Mike Gelfand
c6bfe9de15 Use QtWinExtras instead of importing private Qt function to get QPixmap from HICON 2017-02-11 20:48:13 +03:00
Mike Gelfand
4b397ebfc0 Switch from deprecated QStyleOptionViewItemV* to QStyleOptionViewItem 2017-02-11 14:04:26 +03:00
Mike Gelfand
03034b5015 Remove supporting code for Qt < 5.2 2017-02-11 13:44:34 +03:00
Mike Gelfand
8dc6fb48b1 Bump minimum required Qt version to 5.2 2017-02-11 13:24:42 +03:00
Mike Gelfand
caf3b7653c Improve Qt client look on hi-dpi displays 2017-02-08 01:06:28 +03:00
Mike Gelfand
13e111a89a Use default (instead of system) locale to be more flexible (Qt client) 2017-02-07 02:24:47 +03:00