qt: fix qt4 compile error

f0f50cf9c introduced a compile error on qt4 because qHash only takes
an int argument from qt5+. This fixes that by converting the seed
into a string and both prepending and appending the seed to the
datadir whenever compiling on qt4.
This commit is contained in:
Patrick Lodder 2024-02-18 08:55:18 -05:00
parent ad6a62b7ee
commit d53b640c2d
No known key found for this signature in database
GPG Key ID: 7C523F5FBABE80E7

View File

@ -87,7 +87,12 @@ static QString ipcServerName()
// Note that GetDataDir(true) returns a different path
// for -testnet versus main net
QString ddir(GUIUtil::boostPathToQString(GetDataDir(true)));
#if QT_VERSION >= 0x050000
name.append(QString::number(qHash(ddir, IPC_SOCKET_HASH)));
#else
QString rseed = QString::number(IPC_SOCKET_HASH);
name.append(QString::number(qHash(rseed + ddir + rseed)));
#endif //QT_VERSION >= 0x050000
return name;
}