Diffstat (limited to 'libopie2/opiecore/device/odevice_simpad.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 65 |
1 files changed, 22 insertions, 43 deletions
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 6630763..6d4624b 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -1,36 +1,36 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "odevice_simpad.h" | 30 | #include "odevice_simpad.h" |
31 | 31 | ||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
@@ -125,46 +125,25 @@ void SIMpad::init(const QString&) | |||
125 | d->m_modelstr = "SL4"; | 125 | d->m_modelstr = "SL4"; |
126 | d->m_model = Model_SIMpad_SL4; | 126 | d->m_model = Model_SIMpad_SL4; |
127 | 127 | ||
128 | switch ( d->m_model ) { | 128 | switch ( d->m_model ) { |
129 | default: | 129 | default: |
130 | d->m_rotation = Rot0; | 130 | d->m_rotation = Rot0; |
131 | d->m_direction = CCW; | 131 | d->m_direction = CCW; |
132 | d->m_holdtime = 1000; // 1000ms | 132 | d->m_holdtime = 1000; // 1000ms |
133 | 133 | ||
134 | break; | 134 | break; |
135 | } | 135 | } |
136 | 136 | ||
137 | f. setName ( "/etc/familiar-version" ); | 137 | //Distribution detecting code is now in base class |
138 | if ( f. open ( IO_ReadOnly )) { | ||
139 | d->m_systemstr = "Familiar"; | ||
140 | d->m_system = System_Familiar; | ||
141 | |||
142 | QTextStream ts ( &f ); | ||
143 | d->m_sysverstr = ts. readLine(). mid ( 10 ); | ||
144 | |||
145 | f. close(); | ||
146 | } else { | ||
147 | f. setName ( "/etc/oz_version" ); | ||
148 | |||
149 | if ( f. open ( IO_ReadOnly )) { | ||
150 | d->m_systemstr = "OpenEmbedded/SIMpad"; | ||
151 | d->m_system = System_OpenZaurus; | ||
152 | |||
153 | QTextStream ts ( &f ); | ||
154 | ts.setDevice ( &f ); | ||
155 | d->m_sysverstr = ts. readLine(); | ||
156 | f. close(); | ||
157 | } | ||
158 | } | ||
159 | 138 | ||
160 | m_leds [0] = m_leds [1] = Led_Off; | 139 | m_leds [0] = m_leds [1] = Led_Off; |
161 | 140 | ||
162 | m_power_timer = 0; | 141 | m_power_timer = 0; |
163 | 142 | ||
164 | } | 143 | } |
165 | 144 | ||
166 | void SIMpad::initButtons() | 145 | void SIMpad::initButtons() |
167 | { | 146 | { |
168 | if ( d->m_buttons ) | 147 | if ( d->m_buttons ) |
169 | return; | 148 | return; |
170 | 149 | ||