mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Fixed several issues detected during testing / review (refs #304)
* MS report 1-5 https://dev.vatsim-germany.org/issues/304#change-1800 * Clang warning https://dev.vatsim-germany.org/boards/22/topics/1982?r=1997#message-1997 * Wrong indexes for dockable widgets, RW: https://dev.vatsim-germany.org/issues/304#note-13 * Fixed wrong offset in Fsuipc class * Improved position handling for floating widgets opened 1st time
This commit is contained in:
@@ -34,7 +34,7 @@ namespace BlackMisc
|
||||
CIconList(const CSequence<CIcon> &other);
|
||||
|
||||
//! Find by index
|
||||
CIcon findByIndex(CIcons::IconIndexes index) const;
|
||||
CIcon findByIndex(CIcons::IconIndex index) const;
|
||||
|
||||
//! \copydoc CValueObject::asQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
@@ -126,24 +126,18 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
//! Icon for given index
|
||||
static const CIcon &iconForIndex(CIcons::IconIndexes index)
|
||||
static const CIcon &iconForIndex(CIcons::IconIndex index)
|
||||
{
|
||||
// remark, find by is copy, need reference of icon
|
||||
int s = allIcons().size();
|
||||
for (int i = 0; i < s; i++)
|
||||
{
|
||||
if (allIcons()[i].getIndex() == index)
|
||||
{
|
||||
return allIcons()[i];
|
||||
}
|
||||
}
|
||||
auto foundRange = allIcons().findBy(&CIcon::getIndex, index);
|
||||
if (!foundRange.isEmpty()) { return foundRange.front(); }
|
||||
Q_ASSERT_X(false, "iconForIndex", "Missing index");
|
||||
return iconForIndex(CIcons::StandardIconUnknown16);
|
||||
}
|
||||
|
||||
//! Icon for given index
|
||||
static const CIcon &iconForIndex(int index) {
|
||||
return iconForIndex(static_cast<CIcons::IconIndexes>(index));
|
||||
static const CIcon &iconForIndex(int index)
|
||||
{
|
||||
return iconForIndex(static_cast<CIcons::IconIndex>(index));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user