diff --git a/launcher/InstanceList.cpp b/launcher/InstanceList.cpp index 2565c25d5..d7fcdff7b 100644 --- a/launcher/InstanceList.cpp +++ b/launcher/InstanceList.cpp @@ -141,8 +141,8 @@ QVariant InstanceList::headerData(int section, Qt::Orientation orientation, int case Icon: return tr("Icon"); case Name: return tr("Name"); case GameVersion: return tr("Game Version"); - case LastPlayed: return tr("Last played"); case PlayTime: return tr("Play time"); + case LastPlayed: return tr("Last played"); default: return QVariant(); } } @@ -172,6 +172,14 @@ QVariant InstanceList::data(const QModelIndex& index, int role) const { return inst->getMainVersion(); break; } + case PlayTime: { + QString foo = Time::prettifyDuration(inst->totalTimePlayed()); + if (role == Qt::DisplayRole) + return foo; + if (role == Qt::ToolTipRole) + return tr("Total played for %1").arg(foo); + break; + } case LastPlayed: { QString foo = Time::prettifyDuration(inst->lastTimePlayed()); QDateTime bar = QDateTime::fromMSecsSinceEpoch(inst->lastLaunch()); @@ -181,14 +189,6 @@ QVariant InstanceList::data(const QModelIndex& index, int role) const { return tr("Last played for %1").arg(foo); break; } - case PlayTime: { - QString foo = Time::prettifyDuration(inst->totalTimePlayed()); - if (role == Qt::DisplayRole) - return foo; - if (role == Qt::ToolTipRole) - return tr("Total played for %1").arg(foo); - break; - } default: break; } diff --git a/launcher/InstanceList.h b/launcher/InstanceList.h index 29001b679..4217000ec 100644 --- a/launcher/InstanceList.h +++ b/launcher/InstanceList.h @@ -78,8 +78,8 @@ public: Icon = 0, Name, GameVersion, - LastPlayed, PlayTime, + LastPlayed, ColumnCount }; diff --git a/launcher/ui/instanceview/InstanceView.cpp b/launcher/ui/instanceview/InstanceView.cpp index e7ffdd654..d0a58300b 100644 --- a/launcher/ui/instanceview/InstanceView.cpp +++ b/launcher/ui/instanceview/InstanceView.cpp @@ -78,8 +78,8 @@ void InstanceView::createTable() { header->setSectionResizeMode(InstanceList::Icon, QHeaderView::Fixed); header->setSectionResizeMode(InstanceList::Name, QHeaderView::Stretch); header->setSectionResizeMode(InstanceList::GameVersion, QHeaderView::Interactive); - header->setSectionResizeMode(InstanceList::LastPlayed, QHeaderView::Interactive); header->setSectionResizeMode(InstanceList::PlayTime, QHeaderView::Interactive); + header->setSectionResizeMode(InstanceList::LastPlayed, QHeaderView::Interactive); m_table->setColumnWidth(InstanceList::Icon, m_rowHeight + 3 + 3); // padding left and right m_table->verticalHeader()->setDefaultSectionSize(m_rowHeight + 1 + 1); // padding top and bottom