mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 18:53:28 +01:00
Qt: remove trophy_tree_widget_item.h
This commit is contained in:
parent
d275c36e0a
commit
6f0bad34f4
@ -1663,7 +1663,6 @@
|
||||
<ClInclude Include="rpcs3qt\trophy_manager_dialog.h" />
|
||||
<ClInclude Include="rpcs3qt\trophy_notification_frame.h" />
|
||||
<ClInclude Include="rpcs3qt\trophy_notification_helper.h" />
|
||||
<ClInclude Include="rpcs3qt\trophy_tree_widget_item.h" />
|
||||
<ClInclude Include="xinput_pad_handler.h" />
|
||||
<ClInclude Include="\rpcs3qt\*.h" />
|
||||
</ItemGroup>
|
||||
|
@ -709,9 +709,6 @@
|
||||
<ClInclude Include="rpcs3qt\trophy_manager_dialog.h">
|
||||
<Filter>Gui\trophy</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="rpcs3qt\trophy_tree_widget_item.h">
|
||||
<Filter>Gui\trophy</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="evdev_joystick_handler.h">
|
||||
<Filter>Io\evdev</Filter>
|
||||
</ClInclude>
|
||||
|
@ -1,49 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <rpcs3/rpcs3qt/trophy_manager_dialog.h>
|
||||
|
||||
#include <QTreeWidgetItem>
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user