202 |
202 |
203 |
203 |
204 /*! |
204 /*! |
205 Set new int value for the given key |
205 Set new int value for the given key |
206 */ |
206 */ |
207 CxeError::Id CxeSettingsImp::set(const QString& key,int newValue) |
207 CxeError::Id CxeSettingsImp::set(const QString &key, int newValue) |
208 { |
208 { |
209 CX_DEBUG_ENTER_FUNCTION(); |
209 CX_DEBUG_ENTER_FUNCTION(); |
210 |
210 |
211 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %d", |
211 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %d", |
212 key.toAscii().data(), newValue)); |
212 key.toAscii().data(), newValue)); |
213 |
213 |
214 CxeError::Id err = mSettingsModel.set(key, newValue); |
214 CxeError::Id error = mSettingsModel.set(key, newValue); |
215 emit settingValueChanged(key, newValue); |
215 if (error == CxeError::None) { |
216 |
216 emit settingValueChanged(key, newValue); |
217 CX_DEBUG_EXIT_FUNCTION(); |
217 } |
218 |
218 |
219 return err; |
219 CX_DEBUG_EXIT_FUNCTION(); |
|
220 |
|
221 return error; |
220 } |
222 } |
221 |
223 |
222 |
224 |
223 |
225 |
224 /*! |
226 /*! |
225 Set new int value for the given key |
227 Set new int value for the given key |
226 */ |
228 */ |
227 CxeError::Id CxeSettingsImp::set(const QString& key,qreal newValue) |
229 CxeError::Id CxeSettingsImp::set(const QString &key, qreal newValue) |
228 { |
230 { |
229 CX_DEBUG_ENTER_FUNCTION(); |
231 CX_DEBUG_ENTER_FUNCTION(); |
230 |
232 |
231 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %f", |
233 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %f", |
232 key.toAscii().data(), newValue)); |
234 key.toAscii().data(), newValue)); |
233 |
235 |
234 CxeError::Id err = mSettingsModel.set(key, newValue); |
236 CxeError::Id error = mSettingsModel.set(key, newValue); |
235 emit settingValueChanged(key, newValue); |
237 |
236 |
238 if (error == CxeError::None) { |
237 CX_DEBUG_EXIT_FUNCTION(); |
239 emit settingValueChanged(key, newValue); |
238 |
240 } |
239 return err; |
241 |
|
242 CX_DEBUG_EXIT_FUNCTION(); |
|
243 |
|
244 return error; |
240 } |
245 } |
241 |
246 |
242 |
247 |
243 /*! |
248 /*! |
244 Set new string value for the given key |
249 Set new string value for the given key |
245 */ |
250 */ |
246 CxeError::Id CxeSettingsImp::set(const QString& key,const QString& newValue) |
251 CxeError::Id CxeSettingsImp::set(const QString &key, const QString &newValue) |
247 { |
252 { |
248 CX_DEBUG_ENTER_FUNCTION(); |
253 CX_DEBUG_ENTER_FUNCTION(); |
249 |
254 |
250 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %s", |
255 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %s", |
251 key.toAscii().data(), newValue.toAscii().data())); |
256 key.toAscii().data(), newValue.toAscii().data())); |
252 |
257 |
253 CxeError::Id err = setSceneMode(key, newValue); |
258 CxeError::Id error = setSceneMode(key, newValue); |
254 |
259 |
255 if (err == CxeError::NotFound) { |
260 if (error == CxeError::NotFound) { |
256 // not scene mode setting, try setting value to settings store |
261 // not scene mode setting, try setting value to settings store |
257 mSettingsModel.set(key, newValue); |
262 mSettingsModel.set(key, newValue); |
258 emit settingValueChanged(key, newValue); |
263 emit settingValueChanged(key, newValue); |
259 } |
264 } |
260 |
265 |
261 CX_DEBUG_EXIT_FUNCTION(); |
266 CX_DEBUG_EXIT_FUNCTION(); |
262 |
267 |
263 return err; |
268 return error; |
264 } |
269 } |
265 |
270 |
266 |
271 |
267 |
272 |
268 /*! |
273 /*! |
269 Set the current scene mode setting value for the given key |
274 Set the current scene mode setting value for the given key |
270 */ |
275 */ |
271 CxeError::Id CxeSettingsImp::setSceneMode( |
276 CxeError::Id CxeSettingsImp::setSceneMode( |
272 const QString& key,const QString& newValue) |
277 const QString &key,const QString &newValue) |
273 { |
278 { |
274 CX_DEBUG_ENTER_FUNCTION(); |
279 CX_DEBUG_ENTER_FUNCTION(); |
275 |
280 |
276 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %s", |
281 CX_DEBUG(("CxeSettingsImp::set - key: %s value: %s", |
277 key.toAscii().data(), newValue.toAscii().data())); |
282 key.toAscii().data(), newValue.toAscii().data())); |
278 |
283 |
279 CxeError::Id err = CxeError::None; |
284 CxeError::Id error = CxeError::None; |
280 CxeScene scene; |
285 CxeScene scene; |
281 |
286 |
282 if(CxeSettingIds::IMAGE_SCENE == key) { |
287 if(CxeSettingIds::IMAGE_SCENE == key) { |
283 err = mSettingsModel.setImageScene(newValue); |
288 error = mSettingsModel.setImageScene(newValue); |
284 scene = mSettingsModel.currentImageScene(); |
289 scene = mSettingsModel.currentImageScene(); |
285 } else if(CxeSettingIds::VIDEO_SCENE == key) { |
290 } else if(CxeSettingIds::VIDEO_SCENE == key) { |
286 err = mSettingsModel.setVideoScene(newValue); |
291 error = mSettingsModel.setVideoScene(newValue); |
287 scene = mSettingsModel.currentVideoScene(); |
292 scene = mSettingsModel.currentVideoScene(); |
288 } else { |
293 } else { |
289 err = CxeError::NotFound; |
294 error = CxeError::NotFound; |
290 } |
295 } |
291 |
296 |
292 if (err == CxeError::None) { |
297 if (error == CxeError::None) { |
293 // scene mode set, inform clients about scene mode change |
298 // scene mode set, inform clients about scene mode change |
294 emit sceneChanged(scene); |
299 emit sceneChanged(scene); |
295 } |
300 } |
296 |
301 |
297 CX_DEBUG_EXIT_FUNCTION(); |
302 CX_DEBUG_EXIT_FUNCTION(); |
298 |
303 |
299 return err; |
304 return error; |
300 } |
305 } |
301 |
306 |
302 /*! |
307 /*! |
303 Reset static settings (persistent settings) |
308 Reset static settings (persistent settings) |
304 */ |
309 */ |