1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 07:18:08 +00:00

Avoid string lookup when setting row color

PR #17665.
This commit is contained in:
Tyler Dunn 2022-09-03 02:58:53 -04:00 committed by GitHub
parent 6263c4786b
commit 6f88609d60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,13 +95,13 @@ TrackerListWidget::TrackerListWidget(PropertiesWidget *properties)
// Set DHT, PeX, LSD items // Set DHT, PeX, LSD items
m_DHTItem = new QTreeWidgetItem({ u""_qs, u"** [DHT] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs }); m_DHTItem = new QTreeWidgetItem({ u""_qs, u"** [DHT] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
insertTopLevelItem(0, m_DHTItem); insertTopLevelItem(0, m_DHTItem);
setRowColor(0, QColor("grey")); setRowColor(0, QColorConstants::Svg::grey);
m_PEXItem = new QTreeWidgetItem({ u""_qs, u"** [PeX] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs }); m_PEXItem = new QTreeWidgetItem({ u""_qs, u"** [PeX] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
insertTopLevelItem(1, m_PEXItem); insertTopLevelItem(1, m_PEXItem);
setRowColor(1, QColor("grey")); setRowColor(1, QColorConstants::Svg::grey);
m_LSDItem = new QTreeWidgetItem({ u""_qs, u"** [LSD] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs }); m_LSDItem = new QTreeWidgetItem({ u""_qs, u"** [LSD] **"_qs, u""_qs, u"0"_qs, u""_qs, u""_qs, u"0"_qs });
insertTopLevelItem(2, m_LSDItem); insertTopLevelItem(2, m_LSDItem);
setRowColor(2, QColor("grey")); setRowColor(2, QColorConstants::Svg::grey);
// Set static items alignment // Set static items alignment
const Qt::Alignment alignment = (Qt::AlignRight | Qt::AlignVCenter); const Qt::Alignment alignment = (Qt::AlignRight | Qt::AlignVCenter);