Switch Linux HDID code to Qt shenanigans (#879)
* Replace legacy Linux HDID code This should, I guess, fix t * Bump zlib version * Libbass changed the folder structure, it seems. * Should update the rest too. * Add default HDID
This commit is contained in:
parent
8a0404f424
commit
1aca9a19db
@ -50,30 +50,18 @@ QString get_hdid()
|
|||||||
}
|
}
|
||||||
#elif QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
#elif QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
||||||
#if (defined(LINUX) || defined(__linux__))
|
#if (defined(LINUX) || defined(__linux__))
|
||||||
|
#include <QSysInfo>
|
||||||
|
|
||||||
#include <QFile>
|
QByteArray machineId;
|
||||||
#include <QTextStream>
|
|
||||||
|
|
||||||
QString get_hdid()
|
QString get_hdid()
|
||||||
{
|
{
|
||||||
QFile fstab_file("/etc/fstab");
|
machineId = QSysInfo::machineUniqueId();
|
||||||
if (!fstab_file.open(QIODevice::ReadOnly))
|
|
||||||
return "uxcps32sa9fnwic92mfbs0";
|
|
||||||
|
|
||||||
QTextStream in(&fstab_file);
|
if (machineId.isEmpty()) {
|
||||||
|
return "gxsps32sa9fnwic92mfbs2";
|
||||||
while (!in.atEnd()) {
|
|
||||||
QString line = in.readLine();
|
|
||||||
|
|
||||||
if (line.startsWith("UUID")) {
|
|
||||||
QStringList line_elements = line.split("=");
|
|
||||||
|
|
||||||
if (line_elements.size() > 1)
|
|
||||||
return line_elements.at(1).left(23).trimmed();
|
|
||||||
}
|
}
|
||||||
}
|
return QString(machineId);
|
||||||
|
|
||||||
return "uxcpz32sa9fnwic92mfbs1";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined __APPLE__
|
#elif defined __APPLE__
|
||||||
|
Loading…
Reference in New Issue
Block a user