Merge lp:~3v1n0/unity/opengl-version-check into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1301
Proposed branch: lp:~3v1n0/unity/opengl-version-check
Merge into: lp:unity
Prerequisite: lp:~3v1n0/unity/scroll-api-merge
Diff against target: 16 lines (+3/-2)
1 file modified
plugins/unityshell/src/unityshell.cpp (+3/-2)
To merge this branch: bzr merge lp:~3v1n0/unity/opengl-version-check
Reviewer Review Type Date Requested Status
Gord Allott (community) Approve
Andrea Azzarone (community) Approve
Review via email: mp+67867@code.launchpad.net

Description of the change

This allows to check for OpenGL version strings which are in the form X,Y due to some locale settings I guess.

I've just tried to run the current unity in a natty VirtualBox and it wasn't running due to the version mismatch, since the version string there is "2,0 Chromium 1,9". This small patch fixes the issue.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Looks good, approve.

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

On Thu, 14 Jul 2011 05:13:21 you wrote:
> Treviño (Marco Trevisan) has proposed merging
> lp:~3v1n0/unity/opengl-version-check into lp:unity with
> lp:~3v1n0/unity/scroll-api-merge as a prerequisite.
>
> Requested reviews:
> Unity Team (unity-team)
>
> For more details, see:
> https://code.launchpad.net/~3v1n0/unity/opengl-version-check/+merge/67867
>
> This allows to check for OpenGL version strings which are in the form X,Y
> due to some locale settings I guess.
>
> I've just tried to run the current unity in a natty VirtualBox and it
> wasn't running due to the version mismatch, since the version string there
> is "2,0 Chromium 1,9". This small patch fixes the issue.

What are the chances you'd like to practice writing some tests?

I'd be keen to help you get this going. Unity has a test directory, and has
the google-test infrastructure for testing this.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Mh, was this a mail or a merge comment? :)

Revision history for this message
Gord Allott (gordallott) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2011-07-10 14:16:30 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2011-07-13 17:54:29 +0000
4@@ -1166,9 +1166,10 @@
5 for (i = 0; isdigit (version_string[i]); i++)
6 version = version * 10.0f + (version_string[i] - 48);
7
8- if (version_string[i++] == '.')
9+ if ((version_string[i] == '.' || version_string[i] == ',') &&
10+ isdigit (version_string[i+1]))
11 {
12- version = version * 10.0f + (version_string[i] - 48);
13+ version = version * 10.0f + (version_string[i+1] - 48);
14 return (version + 0.1f) * 0.1f;
15 }
16 else