-rw-r--r-- | library/qpeapplication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 5f61c0c..cf437da 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -151,70 +151,70 @@ public: | |||
151 | if ( !r ) { | 151 | if ( !r ) { |
152 | int sl = abs_name.length(); | 152 | int sl = abs_name.length(); |
153 | do { | 153 | do { |
154 | sl = abs_name.findRev('/',sl-1); | 154 | sl = abs_name.findRev('/',sl-1); |
155 | QString name = sl>=0 ? abs_name.mid(sl+1) : abs_name; | 155 | QString name = sl>=0 ? abs_name.mid(sl+1) : abs_name; |
156 | int dot = name.findRev('.'); | 156 | int dot = name.findRev('.'); |
157 | if ( dot >= 0 ) | 157 | if ( dot >= 0 ) |
158 | name = name.left(dot); | 158 | name = name.left(dot); |
159 | QImage img = Resource::loadImage(name); | 159 | QImage img = Resource::loadImage(name); |
160 | if ( !img.isNull() ) | 160 | if ( !img.isNull() ) |
161 | r = new QImageDrag(img); | 161 | r = new QImageDrag(img); |
162 | } while (!r && sl>0); | 162 | } while (!r && sl>0); |
163 | } | 163 | } |
164 | return r; | 164 | return r; |
165 | } | 165 | } |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static int muted=0; | 168 | static int muted=0; |
169 | static int micMuted=0; | 169 | static int micMuted=0; |
170 | 170 | ||
171 | static void setVolume(int t=0, int percent=-1) | 171 | static void setVolume(int t=0, int percent=-1) |
172 | { | 172 | { |
173 | switch (t) { | 173 | switch (t) { |
174 | case 0: { | 174 | case 0: { |
175 | Config cfg("Sound"); | 175 | Config cfg("qpe"); |
176 | cfg.setGroup("System"); | 176 | cfg.setGroup("Volume"); |
177 | if ( percent < 0 ) | 177 | if ( percent < 0 ) |
178 | percent = cfg.readNumEntry("Volume",50); | 178 | percent = cfg.readNumEntry("VolumePercent",50); |
179 | int fd = 0; | 179 | int fd = 0; |
180 | if ((fd = open("/dev/mixer", O_RDWR))>=0) { | 180 | if ((fd = open("/dev/mixer", O_RDWR))>=0) { |
181 | int vol = muted ? 0 : percent; | 181 | int vol = muted ? 0 : percent; |
182 | // set both channels to same volume | 182 | // set both channels to same volume |
183 | vol |= vol << 8; | 183 | vol |= vol << 8; |
184 | ioctl(fd, MIXER_WRITE(0), &vol); | 184 | ioctl(fd, MIXER_WRITE(0), &vol); |
185 | ::close(fd); | 185 | ::close(fd); |
186 | } | 186 | } |
187 | } break; | 187 | } break; |
188 | } | 188 | } |
189 | } | 189 | } |
190 | 190 | ||
191 | static void setMic(int t=0, int percent=-1) | 191 | static void setMic(int t=0, int percent=-1) |
192 | { | 192 | { |
193 | switch (t) { | 193 | switch (t) { |
194 | case 0: { | 194 | case 0: { |
195 | Config cfg("Sound"); | 195 | Config cfg("qpe"); |
196 | cfg.setGroup("System"); | 196 | cfg.setGroup("Volume"); |
197 | if ( percent < 0 ) | 197 | if ( percent < 0 ) |
198 | percent = cfg.readNumEntry("Mic",50); | 198 | percent = cfg.readNumEntry("Mic",50); |
199 | 199 | ||
200 | int fd = 0; | 200 | int fd = 0; |
201 | int mic = micMuted ? 0 : percent; | 201 | int mic = micMuted ? 0 : percent; |
202 | if ((fd = open("/dev/mixer", O_RDWR))>=0) { | 202 | if ((fd = open("/dev/mixer", O_RDWR))>=0) { |
203 | ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &mic); | 203 | ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &mic); |
204 | ::close(fd); | 204 | ::close(fd); |
205 | } | 205 | } |
206 | } break; | 206 | } break; |
207 | } | 207 | } |
208 | } | 208 | } |
209 | 209 | ||
210 | int qpe_sysBrightnessSteps() | 210 | int qpe_sysBrightnessSteps() |
211 | { | 211 | { |
212 | #if defined(QT_QWS_IPAQ) | 212 | #if defined(QT_QWS_IPAQ) |
213 | return 255; | 213 | return 255; |
214 | #elif defined(QT_QWS_EBX) | 214 | #elif defined(QT_QWS_EBX) |
215 | return 4; | 215 | return 4; |
216 | #else | 216 | #else |
217 | return 255; // ? | 217 | return 255; // ? |
218 | #endif | 218 | #endif |
219 | } | 219 | } |
220 | 220 | ||