Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/gui/transferlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation
case TR_ETA: return tr("ETA", "i.e: Estimated Time of Arrival / Time left");
case TR_CATEGORY: return tr("Category");
case TR_TAGS: return tr("Tags");
case TR_CREATE_DATE: return tr("Created On", "Torrent was initially created on 01/01/2010 08:00");
case TR_ADD_DATE: return tr("Added On", "Torrent was added to transfer list on 01/01/2010 08:00");
case TR_SEED_DATE: return tr("Completed On", "Torrent was completed on 01/01/2010 08:00");
case TR_TRACKER: return tr("Tracker");
Expand Down Expand Up @@ -399,6 +400,8 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
return torrent->category();
case TR_TAGS:
return Utils::String::joinIntoString(torrent->tags(), u", "_s);
case TR_CREATE_DATE:
return QLocale().toString(torrent->creationDate().toLocalTime(), QLocale::ShortFormat);
case TR_ADD_DATE:
return QLocale().toString(torrent->addedTime().toLocalTime(), QLocale::ShortFormat);
case TR_SEED_DATE:
Expand Down Expand Up @@ -480,6 +483,8 @@ QVariant TransferListModel::internalValue(const BitTorrent::Torrent *torrent, co
return torrent->category();
case TR_TAGS:
return QVariant::fromValue(torrent->tags());
case TR_CREATE_DATE:
return torrent->creationDate();
case TR_ADD_DATE:
return torrent->addedTime();
case TR_SEED_DATE:
Expand Down
1 change: 1 addition & 0 deletions src/gui/transferlistmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class TransferListModel final : public QAbstractListModel
TR_POPULARITY,
TR_CATEGORY,
TR_TAGS,
TR_CREATE_DATE,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC you can only add new values to the end of the list, otherwise it affects existing user's setting. Something like user will see the visible columns are not the same columns as before.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had thought about that and wasn't sure if something like that might be an issue, but after looking at the ordering/grouping of the current values, it seemed like similar things were being grouped together and putting this in with the other date-based values would be the "right" answer. I also didn't have any issues in testing, although my testing wasn't very thorough and was using "out-of-the-box" setup.

I can move this if needed (it doesn't make me any difference) but it might be good to clarify if it's really necessary since that would go against how things are currently setup here (with all date-based values being grouped together).

TR_ADD_DATE,
TR_SEED_DATE,
TR_TRACKER,
Expand Down
1 change: 1 addition & 0 deletions src/gui/transferlistsortmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ int TransferListSortModel::compare(const QModelIndex &left, const QModelIndex &r
case TransferListModel::TR_STATUS:
return threeWayCompare(leftValue.toInt(), rightValue.toInt());

case TransferListModel::TR_CREATE_DATE:
case TransferListModel::TR_ADD_DATE:
case TransferListModel::TR_SEED_DATE:
case TransferListModel::TR_SEEN_COMPLETE_DATE:
Expand Down
1 change: 1 addition & 0 deletions src/gui/transferlistwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ TransferListWidget::TransferListWidget(IGUIApplication *app, QWidget *parent)
// Default hidden columns
if (!columnLoaded)
{
setColumnHidden(TransferListModel::TR_CREATE_DATE, true);
setColumnHidden(TransferListModel::TR_ADD_DATE, true);
setColumnHidden(TransferListModel::TR_SEED_DATE, true);
setColumnHidden(TransferListModel::TR_UPLIMIT, true);
Expand Down
Loading