mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #314, calculcate hash for QList<int>
This commit is contained in:
@@ -321,6 +321,30 @@ uint BlackMisc::calculateHash(const QList<uint> &values, const char *className)
|
||||
return hash;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add hash values
|
||||
*/
|
||||
uint BlackMisc::calculateHash(const QList<int> &values, const char *className)
|
||||
{
|
||||
QList<uint> list;
|
||||
uint s = 0;
|
||||
foreach(int i, values)
|
||||
{
|
||||
|
||||
if (i >= 0)
|
||||
{
|
||||
list.append(static_cast<uint>(i));
|
||||
}
|
||||
else
|
||||
{
|
||||
list.append(static_cast<uint>(i));
|
||||
list.append(s++);
|
||||
}
|
||||
}
|
||||
return calculateHash(list, className);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Fix QVariant if it comes from DBus and contains QDBusArgument
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user