Ticket #277: 277.diff
File 277.diff, 2.6 KB (added by , 12 years ago) |
---|
-
src/corelib/global/qglobal.cpp
1271 1271 \value OV_ECS_1_1 eComStation 1.1 1272 1272 \value OV_ECS_1_2 eComStation 1.2 1273 1273 \value OV_ECS_2_0 eComStation 2.0 (either any of RCs or GA) 1274 \value OV_ECS_2_1 eComStation 2.1 (either any of RCs or GA) 1275 \value OV_ECS_2_2 eComStation 2.2 (either any of RCs or GA) 1274 1276 1275 1277 The following masks can be used for detecting properties common to a group 1276 1278 of versions: … … 1986 1988 return success; 1987 1989 } 1988 1990 1991 // beginning from ecs 2.1 they changed the detection scheme once more 1992 // the information is now in the ecs_inst.flg file as plain text 1993 static bool getFLGVersion(const QByteArray &fileName, char (*version)[3]) 1994 { 1995 bool success = false; 1996 FILE *f = fopen(fileName, "rb"); 1997 if (!f) 1998 return success; 1999 // skip eComStation_ and read then 2000 if ((success = fseek(f, 0x0C, SEEK_SET) == 0)) { 2001 // read in tree bytes 2002 success = fread(*version, 1, 3, f) == 3; 2003 } 2004 fclose(f); 2005 return success; 2006 } 2007 1989 2008 QSysInfo::Os2Version QSysInfo::os2Version() 1990 2009 { 1991 2010 static QSysInfo::Os2Version os2ver = OV_Unknown; … … 2058 2077 // detect eCS >= 1.2 2059 2078 if (sys_ecs_ver[0] == 0x12 && sys_ecs_ver[1] == 0x00) 2060 2079 return os2ver = OV_ECS_1_2; 2061 if (sys_ecs_ver[0] == 0x20 && sys_ecs_ver[1] == 0x00) 2062 return os2ver = OV_ECS_2_0; 2080 if (sys_ecs_ver[0] >= 0x20 && sys_ecs_ver[1] == 0x00) 2081 { 2082 os2ver = OV_ECS_2_0; 2083 // read ecs_inst.flg 2084 char flg_ecs_ver[3]; 2085 fn = QByteArray("A:\\ECS\\ECS_INST.FLG"); 2086 fn.data()[0] += buf[0] - 1; 2087 if (getFLGVersion(fn, &flg_ecs_ver)) { 2088 if (flg_ecs_ver[0] == '2' && flg_ecs_ver[2] == '1') 2089 os2ver = OV_ECS_2_1; 2090 if (flg_ecs_ver[0] == '2' && flg_ecs_ver[2] == '2') 2091 os2ver = OV_ECS_2_2; 2092 } 2093 return os2ver; 2094 } 2063 2095 2064 2096 return os2ver = OV_ECS_Unknown; 2065 2097 } -
src/corelib/global/qglobal.h
1566 1566 OV_ECS_1_1 = 0x06010100, 1567 1567 OV_ECS_1_2 = 0x06010200, 1568 1568 OV_ECS_2_0 = 0x06020000, 1569 OV_ECS_2_1 = 0x06020100, 1570 OV_ECS_2_2 = 0x06020200, 1569 1571 1570 1572 /* version masks */ 1571 1573 OV_WARP3 = 0x01000000,