diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2020-05-22 17:02:32 -0500 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2020-05-22 17:02:32 -0500 |
| commit | 156a760ebab6839c53f9c613881f0937e814414a (patch) | |
| tree | fd9fafecd25fbd66f0e4f8101f856c8cf68b790e /src/hardware_functions.cpp | |
| parent | d89a4370a753f6e1da22349866b1b00f638884a6 (diff) | |
Full revert to tag 2.6.2
Due to a countless number of changes made to the core that were not
fully understood, tested, or documented, it was decided to roll
everything back to the last known stable version (2.6.2).
Changes dropped include:
- Witness needed
- Shake
- Frame SFX
- Multiple custom objections
- Multithreaded thumbnail generation
- Looping
- Various translation additions
- "Mirror IC"
- Color in IC log
- An invocation of clang-format
Next time, work together and split your big fork into independently
testable feature branches.
Diffstat (limited to 'src/hardware_functions.cpp')
| -rw-r--r-- | src/hardware_functions.cpp | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/src/hardware_functions.cpp b/src/hardware_functions.cpp index 96c72eb5..5d6b6ffa 100644 --- a/src/hardware_functions.cpp +++ b/src/hardware_functions.cpp @@ -2,7 +2,7 @@ #include <QDebug> -#if (defined(_WIN32) || defined(_WIN64)) +#if (defined (_WIN32) || defined (_WIN64)) #include <windows.h> static DWORD dwVolSerial; @@ -10,18 +10,17 @@ static BOOL bIsRetrieved; QString get_hdid() { - bIsRetrieved = GetVolumeInformation(TEXT("C:\\"), nullptr, 0, &dwVolSerial, - nullptr, nullptr, nullptr, 0); + bIsRetrieved = GetVolumeInformation(TEXT("C:\\"), nullptr, 0, &dwVolSerial, nullptr, nullptr, nullptr, 0); if (bIsRetrieved) return QString::number(dwVolSerial, 16); else - // a totally random string - // what could possibly go wrong + //a totally random string + //what could possibly go wrong return "gxsps32sa9fnwic92mfbs0"; } -#elif (defined(LINUX) || defined(__linux__)) +#elif (defined (LINUX) || defined (__linux__)) #include <QFile> #include <QTextStream> @@ -34,10 +33,12 @@ QString get_hdid() QTextStream in(&fstab_file); - while (!in.atEnd()) { + while(!in.atEnd()) + { QString line = in.readLine(); - if (line.startsWith("UUID")) { + if (line.startsWith("UUID")) + { QStringList line_elements = line.split("="); if (line_elements.size() > 1) @@ -49,30 +50,10 @@ QString get_hdid() } #elif defined __APPLE__ -#include <CoreFoundation/CoreFoundation.h> -#include <IOKit/IOKitLib.h> - QString get_hdid() { - CFStringRef serial; - char buffer[64] = {0}; - QString hdid; - io_service_t platformExpert = IOServiceGetMatchingService( - kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice")); - if (platformExpert) { - CFTypeRef serialNumberAsCFString = IORegistryEntryCreateCFProperty( - platformExpert, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault, - 0); - if (serialNumberAsCFString) { - serial = (CFStringRef)serialNumberAsCFString; - } - if (CFStringGetCString(serial, buffer, 64, kCFStringEncodingUTF8)) { - hdid = buffer; - } - - IOObjectRelease(platformExpert); - } - return hdid; + //hdids are broken at this point anyways + return "just a mac passing by"; } #else |
