From 6f0bad34f4b7cc40813ef37ddfa071a380fb7542 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Thu, 17 May 2018 11:41:09 +0200 Subject: [PATCH] Qt: remove trophy_tree_widget_item.h --- rpcs3/rpcs3.vcxproj | 1 - rpcs3/rpcs3.vcxproj.filters | 3 -- rpcs3/rpcs3qt/trophy_tree_widget_item.h | 49 ------------------------- 3 files changed, 53 deletions(-) delete mode 100644 rpcs3/rpcs3qt/trophy_tree_widget_item.h diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index 9d8b4966ad..f0d9450ce8 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -1663,7 +1663,6 @@ - diff --git a/rpcs3/rpcs3.vcxproj.filters b/rpcs3/rpcs3.vcxproj.filters index 6014226b63..449a4a11d4 100644 --- a/rpcs3/rpcs3.vcxproj.filters +++ b/rpcs3/rpcs3.vcxproj.filters @@ -709,9 +709,6 @@ Gui\trophy - - Gui\trophy - Io\evdev diff --git a/rpcs3/rpcs3qt/trophy_tree_widget_item.h b/rpcs3/rpcs3qt/trophy_tree_widget_item.h deleted file mode 100644 index 5252d048cb..0000000000 --- a/rpcs3/rpcs3qt/trophy_tree_widget_item.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#include - -#include - - -class trophy_tree_widget_item : public QTreeWidgetItem -{ -public: - trophy_tree_widget_item(QTreeWidget* parent) : QTreeWidgetItem(parent) {}; - trophy_tree_widget_item(QTreeWidgetItem* parent) : QTreeWidgetItem(parent) {}; -private: - bool operator<(const QTreeWidgetItem &other) const override - { - auto GetTrophyRank = [](const QString& name) - { - if (name.toLower() == "bronze") - { - return 0; - } - else if (name.toLower() == "silver") - { - return 1; - } - else if (name.toLower() == "gold") - { - return 2; - } - else if (name.toLower() == "platinum") - { - return 3; - } - return -1; - }; - - int column = treeWidget()->sortColumn(); - switch (column) - { - case TrophyColumns::Name: return text(TrophyColumns::Name).toLower() < other.text(TrophyColumns::Name).toLower(); - case TrophyColumns::Description: return text(TrophyColumns::Description).toLower() < other.text(TrophyColumns::Description).toLower(); - case TrophyColumns::Type: return GetTrophyRank(text(TrophyColumns::Type)) < GetTrophyRank(other.text(TrophyColumns::Type)); - case TrophyColumns::IsUnlocked: return text(TrophyColumns::IsUnlocked).toLower() > other.text(TrophyColumns::IsUnlocked).toLower(); - case TrophyColumns::Id: - default: - return text(TrophyColumns::Id).toInt() < other.text(TrophyColumns::Id).toInt(); - } - } -};