Compare commits
7 Commits
b76bd73056
...
aedcb202f1
Author | SHA1 | Date |
---|---|---|
Cœur | aedcb202f1 | |
Cœur | e9bc4bea4d | |
Cœur | 5a7dd36f12 | |
Christian Muehlhaeuser | db713ee6fa | |
Pooyan Khanjankhani | 821a6816ef | |
Dzmitry Neviadomski | ef18816b7f | |
Dzmitry Neviadomski | 0e25584e78 |
|
@ -41,7 +41,7 @@ On macOS, Transmission is usually built with Xcode. Everywhere else, it's CMake
|
|||
- Prefer `enum class` over `enum`
|
||||
- Prefer new-style headers, e.g. `<cstring>` over `<string.h>`
|
||||
- Fix any warnings in new code before merging
|
||||
- Run `./code-style.sh` on your code to ensure the whole codebase has consistent indentation.
|
||||
- Run `./code_style.sh` on your code to ensure the whole codebase has consistent indentation.
|
||||
|
||||
Note that Transmission existed in C for over a decade and those idioms don't change overnight. "Follow the C++ core guidelines" can be difficult when working with older code, and the maintainers will understand that when reviewing your PRs. :smiley:
|
||||
|
||||
|
|
|
@ -404,7 +404,7 @@ struct tr_socket_address
|
|||
};
|
||||
|
||||
template<>
|
||||
class std::hash<tr_socket_address>
|
||||
struct std::hash<tr_socket_address>
|
||||
{
|
||||
public:
|
||||
std::size_t operator()(tr_socket_address const& socket_address) const noexcept
|
||||
|
|
|
@ -103,21 +103,8 @@ bool TorrentFilter::lessThan(QModelIndex const& left, QModelIndex const& right)
|
|||
|
||||
switch (prefs_.get<SortMode>(Prefs::SORT_MODE).mode())
|
||||
{
|
||||
case SortMode::SORT_BY_NAME:
|
||||
val = -tr_compare_3way(!a->hasMetadata(), !b->hasMetadata());
|
||||
if (val == 0)
|
||||
{
|
||||
val = -a->name().compare(b->name(), Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case SortMode::SORT_BY_QUEUE:
|
||||
val = compareState(a, b);
|
||||
if (val == 0)
|
||||
{
|
||||
val = -tr_compare_3way(a->queuePosition(), b->queuePosition());
|
||||
}
|
||||
val = -tr_compare_3way(a->queuePosition(), b->queuePosition());
|
||||
|
||||
break;
|
||||
|
||||
|
@ -136,9 +123,12 @@ bool TorrentFilter::lessThan(QModelIndex const& left, QModelIndex const& right)
|
|||
|
||||
break;
|
||||
|
||||
case SortMode::SORT_BY_STATE:
|
||||
case SortMode::SORT_BY_ETA:
|
||||
val = a->compareETA(*b);
|
||||
|
||||
[[fallthrough]];
|
||||
|
||||
case SortMode::SORT_BY_ACTIVITY:
|
||||
val = compareState(a, b);
|
||||
if (val == 0)
|
||||
{
|
||||
val = tr_compare_3way(a->downloadSpeed() + a->uploadSpeed(), b->downloadSpeed() + b->uploadSpeed());
|
||||
|
@ -153,12 +143,15 @@ bool TorrentFilter::lessThan(QModelIndex const& left, QModelIndex const& right)
|
|||
|
||||
[[fallthrough]];
|
||||
|
||||
case SortMode::SORT_BY_PROGRESS:
|
||||
case SortMode::SORT_BY_STATE:
|
||||
if (val == 0)
|
||||
{
|
||||
val = compareState(a, b);
|
||||
}
|
||||
|
||||
[[fallthrough]];
|
||||
|
||||
case SortMode::SORT_BY_PROGRESS:
|
||||
if (val == 0)
|
||||
{
|
||||
val = tr_compare_3way(a->metadataPercentDone(), b->metadataPercentDone());
|
||||
|
@ -190,15 +183,12 @@ bool TorrentFilter::lessThan(QModelIndex const& left, QModelIndex const& right)
|
|||
|
||||
break;
|
||||
|
||||
case SortMode::SORT_BY_ETA:
|
||||
val = compareState(a, b);
|
||||
if (val == 0)
|
||||
{
|
||||
val = a->compareETA(*b);
|
||||
}
|
||||
|
||||
case SortMode::SORT_BY_NAME:
|
||||
// nothing to do: sorting by name is done after the switch
|
||||
break;
|
||||
|
||||
// TODO(coeur): SORT_BY_TRACKER
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ Get a file list for the current torrent(s)
|
|||
.It Fl g Fl -get Ar all | file-index | files
|
||||
Mark file(s) for download.
|
||||
.Ar all
|
||||
marks all all of the torrent's files for downloading,
|
||||
marks all of the torrent's files for downloading,
|
||||
.Ar file-index
|
||||
adds a single file to the download list, and
|
||||
.Ar files
|
||||
|
|
Loading…
Reference in New Issue