Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSInfo: add Windows 10 displayable version string. #2447

Merged
merged 1 commit into from Jul 20, 2016

Conversation

@mkrautz
Copy link
Member

commented Jul 18, 2016

Fixes #1916

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Jul 18, 2016

releaseId = QString::fromWCharArray(buf, static_cast<int>(len / sizeof(buf[0])));

len = sizeof(buf);
err = RegQueryValueEx(key, L"CurrentBuild", NULL, NULL, reinterpret_cast<LPBYTE>(&buf[0]), &len);

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jul 18, 2016

Author Member

bad tab

/// to be returned. Because of that, it is safe to call
/// this function, and if it returns an empty/null string,
/// a legacy version string can be displayed.
static QString win10DisplayableVersion() {

This comment has been minimized.

Copy link
@Kissaki

Kissaki Jul 19, 2016

Member

Why not put this into the class?

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jul 19, 2016

Author Member

Why put it in the class?

This comment has been minimized.

Copy link
@mkrautz

mkrautz Jul 19, 2016

Author Member

In any case, it's just a style thing, I suppose.

I like headers to only expose the public API. I made it a static function to avoid polluting the header.

I'm open to suggestions why to prefer one over the other.

This comment has been minimized.

Copy link
@Kissaki

Kissaki Jul 19, 2016

Member

Yeah, thought as much. I’m conflicted as well. I was unsure if we generally did it like this. It’s fine I guess.

/// $ProductName $Arch $Version $Build.$Ubr
///
/// Of note, $Version is formatted as YYMM.
/// So, 1607 is a Windows 10 update released in July 2016.

This comment has been minimized.

Copy link
@hacst

hacst Jul 20, 2016

Member

TIL. That's neat.

QString ubr;
QString arch;

err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", NULL, KEY_READ, &key);

This comment has been minimized.

Copy link
@hacst

hacst Jul 20, 2016

Member

Key handle is never release

@hacst

This comment has been minimized.

Copy link
Member

commented Jul 20, 2016

See comment.

@mkrautz mkrautz force-pushed the mkrautz:win10osinfo branch from 38f4657 to 88e6647 Jul 20, 2016

@mkrautz

This comment has been minimized.

Copy link
Member Author

commented Jul 20, 2016

@hacst PTAL

@hacst

This comment has been minimized.

Copy link
Member

commented Jul 20, 2016

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.