author | sandman <sandman> | 2002-07-27 22:45:04 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-07-27 22:45:04 (UTC) |
commit | 9cc89b6a54ee267953b0422c4607097d075ecab9 (patch) (unidiff) | |
tree | 4bde48d162a97ef74cf9e276c0194b8138fb4e0c | |
parent | dac5c073c3e04ceb6900aeb72e53cf6d7350c3c9 (diff) | |
download | opie-9cc89b6a54ee267953b0422c4607097d075ecab9.zip opie-9cc89b6a54ee267953b0422c4607097d075ecab9.tar.gz opie-9cc89b6a54ee267953b0422c4607097d075ecab9.tar.bz2 |
Small extension to read the system version
(currently only functional for familiar)
-rw-r--r-- | libopie/odevice.cpp | 16 | ||||
-rw-r--r-- | libopie/odevice.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 9931684..bc8014a 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -34,12 +34,14 @@ public: | |||
34 | QString m_modelstr; | 34 | QString m_modelstr; |
35 | OModel m_model; | 35 | OModel m_model; |
36 | 36 | ||
37 | QString m_systemstr; | 37 | QString m_systemstr; |
38 | OSystem m_system; | 38 | OSystem m_system; |
39 | 39 | ||
40 | QString m_sysverstr; | ||
41 | |||
40 | OLedState m_leds [4]; // just for convenience ... | 42 | OLedState m_leds [4]; // just for convenience ... |
41 | }; | 43 | }; |
42 | 44 | ||
43 | class ODeviceIPAQ : public ODevice { | 45 | class ODeviceIPAQ : public ODevice { |
44 | protected: | 46 | protected: |
45 | virtual void init ( ); | 47 | virtual void init ( ); |
@@ -96,12 +98,13 @@ ODevice::ODevice ( ) | |||
96 | d-> m_modelstr = "Unknown"; | 98 | d-> m_modelstr = "Unknown"; |
97 | d-> m_model = OMODEL_Unknown; | 99 | d-> m_model = OMODEL_Unknown; |
98 | d-> m_vendorstr = "Unkown"; | 100 | d-> m_vendorstr = "Unkown"; |
99 | d-> m_vendor = OVENDOR_Unknown; | 101 | d-> m_vendor = OVENDOR_Unknown; |
100 | d-> m_systemstr = "Unkown"; | 102 | d-> m_systemstr = "Unkown"; |
101 | d-> m_system = OSYSTEM_Unknown; | 103 | d-> m_system = OSYSTEM_Unknown; |
104 | d-> m_sysverstr = "0.0"; | ||
102 | } | 105 | } |
103 | 106 | ||
104 | void ODevice::init ( ) | 107 | void ODevice::init ( ) |
105 | { | 108 | { |
106 | } | 109 | } |
107 | 110 | ||
@@ -137,12 +140,17 @@ QString ODevice::systemString ( ) | |||
137 | 140 | ||
138 | OSystem ODevice::system ( ) | 141 | OSystem ODevice::system ( ) |
139 | { | 142 | { |
140 | return d-> m_system; | 143 | return d-> m_system; |
141 | } | 144 | } |
142 | 145 | ||
146 | QString ODevice::systemVersionString ( ) | ||
147 | { | ||
148 | return d-> m_sysverstr; | ||
149 | } | ||
150 | |||
143 | void ODevice::alarmSound ( ) | 151 | void ODevice::alarmSound ( ) |
144 | { | 152 | { |
145 | #ifndef QT_QWS_EBX | 153 | #ifndef QT_QWS_EBX |
146 | #ifndef QT_NO_SOUND | 154 | #ifndef QT_NO_SOUND |
147 | static Sound snd ( "alarm" ); | 155 | static Sound snd ( "alarm" ); |
148 | 156 | ||
@@ -223,15 +231,21 @@ void ODeviceIPAQ::init ( ) | |||
223 | else | 231 | else |
224 | d-> m_model = OMODEL_Unknown; | 232 | d-> m_model = OMODEL_Unknown; |
225 | 233 | ||
226 | f. close ( ); | 234 | f. close ( ); |
227 | } | 235 | } |
228 | 236 | ||
229 | if ( QFile::exists ( "/etc/familiar-version" )) { | 237 | f. setName ( "/etc/familiar-version" ); |
238 | if ( f. open ( IO_ReadOnly )) { | ||
230 | d-> m_systemstr = "Familiar"; | 239 | d-> m_systemstr = "Familiar"; |
231 | d-> m_system = OSYSTEM_Familiar; | 240 | d-> m_system = OSYSTEM_Familiar; |
241 | |||
242 | QTextStream ts ( &f ); | ||
243 | d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); | ||
244 | |||
245 | f. close ( ); | ||
232 | } | 246 | } |
233 | 247 | ||
234 | d-> m_leds [0] = OLED_Off; | 248 | d-> m_leds [0] = OLED_Off; |
235 | } | 249 | } |
236 | 250 | ||
237 | #include <unistd.h> | 251 | #include <unistd.h> |
diff --git a/libopie/odevice.h b/libopie/odevice.h index b40abe7..b54e576 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -75,12 +75,13 @@ public: | |||
75 | QString vendorString ( ); | 75 | QString vendorString ( ); |
76 | OVendor vendor ( ); | 76 | OVendor vendor ( ); |
77 | 77 | ||
78 | QString systemString ( ); | 78 | QString systemString ( ); |
79 | OSystem system ( ); | 79 | OSystem system ( ); |
80 | 80 | ||
81 | QString systemVersionString ( ); | ||
81 | 82 | ||
82 | // input / output | 83 | // input / output |
83 | 84 | ||
84 | virtual void alarmSound ( ); | 85 | virtual void alarmSound ( ); |
85 | virtual void keySound ( ); | 86 | virtual void keySound ( ); |
86 | virtual void touchSound ( ); | 87 | virtual void touchSound ( ); |