Drop Qt 4 support

This commit is contained in:
Eugene Shalygin 2017-01-19 13:10:09 +01:00
parent 60998a68eb
commit e64bb1de8c
67 changed files with 48 additions and 8809 deletions

View file

@ -65,10 +65,6 @@ namespace
Boolean = 14,
Float = 15
};
#ifndef QBT_USES_QT5
Q_IPV6ADDR createMappedAddress(quint32 ip4);
#endif
}
struct DataFieldDescriptor
@ -166,13 +162,7 @@ QDateTime GeoIPDatabase::buildEpoch() const
QString GeoIPDatabase::lookup(const QHostAddress &hostAddr) const
{
#ifndef QBT_USES_QT5
Q_IPV6ADDR addr = hostAddr.protocol() == QAbstractSocket::IPv4Protocol
? createMappedAddress(hostAddr.toIPv4Address())
: hostAddr.toIPv6Address();
#else
Q_IPV6ADDR addr = hostAddr.toIPv6Address();
#endif
const uchar *ptr = m_data;
@ -496,25 +486,3 @@ QVariant GeoIPDatabase::readArrayValue(quint32 &offset, quint32 count) const
return array;
}
namespace
{
#ifndef QBT_USES_QT5
Q_IPV6ADDR createMappedAddress(quint32 ip4)
{
Q_IPV6ADDR ip6;
memset(&ip6, 0, sizeof(ip6));
int i;
for (i = 15; ip4 != 0; i--) {
ip6[i] = ip4 & 0xFF;
ip4 >>= 8;
}
ip6[11] = 0xFF;
ip6[10] = 0xFF;
return ip6;
}
#endif
}