-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to display torrent "privateness" in UI #20951
base: master
Are you sure you want to change the base?
Conversation
23addbd
to
b512076
Compare
This comment was marked as resolved.
This comment was marked as resolved.
You have to add the column to Problem in General tab in GUI only:
|
23c4cf8
to
7ed56f3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Add a magnet link to session and pause it before its metadata are retrieved. |
532d603
to
42a56f6
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This can also be done by adding a non-existent magnet link or you can use an existing one by changing a few characters. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This will take care of it: #20951 (comment) |
bb61f0e
to
ec5d3a7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
124f60d
to
0b83a97
Compare
@stalkerok - is the Windows version still crashing after the additional changes from @Chocobo1 ? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as outdated.
This comment was marked as outdated.
@stalkerok Can you grab/install latest Microsoft Visual C++ Redistributable & see if crash still happens. |
@@ -512,6 +525,8 @@ QVariant TransferListModel::internalValue(const BitTorrent::Torrent *torrent, co | |||
return QVariant::fromValue(torrent->infoHash().v2()); | |||
case TR_REANNOUNCE: | |||
return torrent->nextAnnounce(); | |||
case TR_PRIVATE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate value corresponding to "n/a" state should be provided in order to sort by "Private" column properly. I believe -1
could do the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - would this work?4595dda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - would this work?4595dda
No.
Did I suggest returning its string representation?
Isn't it obvious that internalValue()
should provide something else (except, of course, the cases when the data itself is string)?
IMO, I made it clear that it is only necessary to add some third value that would correspond to the case when the "privateness" is not available (due to the lack of metadata).
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
aa3c086
to
4595dda
Compare
Shall we tag this to milestone 5.0? |
I don't think this is a good idea for a PR that doesn't have a predictable completion date. It may not make it to v5.0 in time. |
@glassez - I was under the impression that this one is pretty much done. Do you see remaining items that need to be addressed? |
Yes. At least #20951 (comment). |
d803edd
to
d60c77c
Compare
0c31d08
to
dcd1132
Compare
+Changes from code review
4794b61
to
f565c33
Compare
@@ -199,6 +199,7 @@ int TransferListSortModel::compare(const QModelIndex &left, const QModelIndex &r | |||
case TransferListModel::TR_POPULARITY: | |||
return customCompare(leftValue.toReal(), rightValue.toReal()); | |||
|
|||
case TransferListModel::TR_PRIVATE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to add the following function:
int customCompare(const QVariant &left, const QVariant &right)
{
const bool isLeftValid = left.isValid();
const bool isRightValid = right.isValid();
if (isLeftValid == isRightValid)
return threeWayCompare(left, right);
return isLeftValid ? -1 : 1;
}
...and use it to compare "privateness":
case TransferListModel::TR_PRIVATE:
return customCompare(leftValue, rightValue);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to add the following function:
int customCompare(const QVariant &left, const QVariant &right) { const bool isLeftValid = left.isValid(); const bool isRightValid = right.isValid(); if (isLeftValid == isRightValid) return threeWayCompare(left, right); return isLeftValid ? -1 : 1; }
Or maybe convert an existing one into a template:
// this
int customCompare(const QDateTime &left, const QDateTime &right)
// into
template <typename T>
int customCompare(const T &left, const T &right)
Adds private flag to GUI that is available in /info and /properties response