-rw-r--r-- | libopie/ohwinfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/ohwinfo.cpp b/libopie/ohwinfo.cpp index ae07c6c..30c47c8 100644 --- a/libopie/ohwinfo.cpp +++ b/libopie/ohwinfo.cpp | |||
@@ -1,84 +1,84 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <qtextstream.h> | 2 | #include <qtextstream.h> |
3 | 3 | ||
4 | #include "ohwinfo.h" | 4 | #include "ohwinfo.h" |
5 | 5 | ||
6 | 6 | ||
7 | struct OHwInfoData { | 7 | struct OHwInfoData { |
8 | QString m_vendorstr; | 8 | QString m_vendorstr; |
9 | OHwVendor m_vendor; | 9 | OHwVendor m_vendor; |
10 | 10 | ||
11 | QString m_modelstr; | 11 | QString m_modelstr; |
12 | OHwModel m_model; | 12 | OHwModel m_model; |
13 | }; | 13 | }; |
14 | 14 | ||
15 | 15 | ||
16 | OHwInfo *OHwInfo::inst ( ) | 16 | OHwInfo *OHwInfo::inst ( ) |
17 | { | 17 | { |
18 | static OHwInfo *inf = 0; | 18 | static OHwInfo *inf = 0; |
19 | 19 | ||
20 | if ( !inf ) { | 20 | if ( !inf ) { |
21 | inf = new OHwInfo ( ); | 21 | inf = new OHwInfo ( ); |
22 | } | 22 | } |
23 | return inf; | 23 | return inf; |
24 | } | 24 | } |
25 | 25 | ||
26 | OHwInfo::OHwInfo ( ) | 26 | OHwInfo::OHwInfo ( ) |
27 | { | 27 | { |
28 | m_data = new OHwInfoData ( ); | 28 | m_data = new OHwInfoData ( ); |
29 | 29 | ||
30 | QFile f ( "/proc/hal/model" ); | 30 | QFile f ( "/proc/hal/model" ); |
31 | 31 | ||
32 | if ( f. open ( IO_ReadOnly )) { | 32 | if ( f. open ( IO_ReadOnly )) { |
33 | QTextStream ts ( &f ); | 33 | QTextStream ts ( &f ); |
34 | m_data-> m_modelstr = ts. readLine ( ); | 34 | m_data-> m_modelstr = "H" + ts. readLine ( ); |
35 | 35 | ||
36 | if ( m_data-> m_modelstr == "H3100" ) | 36 | if ( m_data-> m_modelstr == "H3100" ) |
37 | m_data-> m_model = OMODEL_iPAQ_H31xx; | 37 | m_data-> m_model = OMODEL_iPAQ_H31xx; |
38 | else if ( m_data-> m_modelstr == "H3600" ) | 38 | else if ( m_data-> m_modelstr == "H3600" ) |
39 | m_data-> m_model = OMODEL_iPAQ_H36xx; | 39 | m_data-> m_model = OMODEL_iPAQ_H36xx; |
40 | else if ( m_data-> m_modelstr == "H3700" ) | 40 | else if ( m_data-> m_modelstr == "H3700" ) |
41 | m_data-> m_model = OMODEL_iPAQ_H37xx; | 41 | m_data-> m_model = OMODEL_iPAQ_H37xx; |
42 | else if ( m_data-> m_modelstr == "H3800" ) | 42 | else if ( m_data-> m_modelstr == "H3800" ) |
43 | m_data-> m_model = OMODEL_iPAQ_H38xx; | 43 | m_data-> m_model = OMODEL_iPAQ_H38xx; |
44 | else | 44 | else |
45 | m_data-> m_model = OMODEL_Unknown; | 45 | m_data-> m_model = OMODEL_Unknown; |
46 | 46 | ||
47 | m_data-> m_vendorstr = "HP"; | 47 | m_data-> m_vendorstr = "HP"; |
48 | m_data-> m_vendor = OVENDOR_HP; | 48 | m_data-> m_vendor = OVENDOR_HP; |
49 | 49 | ||
50 | f. close ( ); | 50 | f. close ( ); |
51 | } | 51 | } |
52 | else { | 52 | else { |
53 | m_data-> m_modelstr = "Unknown"; | 53 | m_data-> m_modelstr = "Unknown"; |
54 | m_data-> m_model = OMODEL_Unknown; | 54 | m_data-> m_model = OMODEL_Unknown; |
55 | m_data-> m_vendorstr = "Unkown"; | 55 | m_data-> m_vendorstr = "Unkown"; |
56 | m_data-> m_vendor = OVENDOR_Unknown; | 56 | m_data-> m_vendor = OVENDOR_Unknown; |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | OHwInfo::~OHwInfo ( ) | 60 | OHwInfo::~OHwInfo ( ) |
61 | { | 61 | { |
62 | delete m_data; | 62 | delete m_data; |
63 | } | 63 | } |
64 | 64 | ||
65 | QString OHwInfo::vendorString ( ) | 65 | QString OHwInfo::vendorString ( ) |
66 | { | 66 | { |
67 | return m_data-> m_vendorstr; | 67 | return m_data-> m_vendorstr; |
68 | } | 68 | } |
69 | 69 | ||
70 | OHwVendor OHwInfo::vendor ( ) | 70 | OHwVendor OHwInfo::vendor ( ) |
71 | { | 71 | { |
72 | return m_data-> m_vendor; | 72 | return m_data-> m_vendor; |
73 | } | 73 | } |
74 | 74 | ||
75 | QString OHwInfo::modelString ( ) | 75 | QString OHwInfo::modelString ( ) |
76 | { | 76 | { |
77 | return m_data-> m_modelstr; | 77 | return m_data-> m_modelstr; |
78 | } | 78 | } |
79 | 79 | ||
80 | OHwModel OHwInfo::model ( ) | 80 | OHwModel OHwInfo::model ( ) |
81 | { | 81 | { |
82 | return m_data-> m_model; | 82 | return m_data-> m_model; |
83 | } | 83 | } |
84 | 84 | ||