--- a/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettingsstore.cpp Tue Jul 06 14:04:02 2010 +0300
+++ b/camerauis/cameraxui/cxengine/tsrc/fakeclasses/cxefakesettingsstore.cpp Wed Aug 18 09:37:18 2010 +0300
@@ -24,13 +24,23 @@
CxeFakeSettingsStore::CxeFakeSettingsStore()
{
- // all supported settings are initialized here.
+ resetSettings();
+}
+
+CxeFakeSettingsStore::~CxeFakeSettingsStore()
+{
+}
+
+void CxeFakeSettingsStore::resetSettings()
+{
+ // This part should be synchronized with the current settings
+ // supported by camera and defined in cxenamespace
mSettingKeyHash.clear();
mSettingKeyHash.insert(CxeSettingIds::FNAME_FOLDER_SUFFIX, QVariant("_Nokia"));
mSettingKeyHash.insert(CxeSettingIds::FNAME_MONTH_FOLDER, QVariant("08042009"));
mSettingKeyHash.insert(CxeSettingIds::FNAME_IMAGE_COUNTER, QVariant(0));
mSettingKeyHash.insert(CxeSettingIds::FNAME_VIDEO_COUNTER, QVariant(0));
-
+
mSettingKeyHash.insert(CxeSettingIds::CAMERA_MODE, QVariant(0));
mSettingKeyHash.insert(CxeSettingIds::FLASH_MODE, QVariant(0));
mSettingKeyHash.insert(CxeSettingIds::IMAGE_SCENE, QVariant("image_scene_auto"));
@@ -38,17 +48,27 @@
mSettingKeyHash.insert(CxeSettingIds::STILL_SHOWCAPTURED, QVariant(0));
mSettingKeyHash.insert(CxeSettingIds::VIDEO_SHOWCAPTURED, QVariant(0));
mSettingKeyHash.insert(CxeSettingIds::VIDEO_MUTE_SETTING, QVariant(0));
-
+
mSettingKeyHash.insert(CxeSettingIds::GEOTAGGING, QVariant(0));
mSettingKeyHash.insert(CxeSettingIds::GEOTAGGING_DISCLAIMER, QVariant(1));
mSettingKeyHash.insert(CxeSettingIds::FACE_TRACKING, QVariant(1));
mSettingKeyHash.insert(CxeSettingIds::IMAGE_QUALITY, QVariant(0));
mSettingKeyHash.insert(CxeSettingIds::VIDEO_QUALITY, QVariant(0));
-}
-
-CxeFakeSettingsStore::~CxeFakeSettingsStore()
-{
+ mSettingKeyHash.insert(CxeSettingIds::FOCAL_RANGE, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::WHITE_BALANCE, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::LIGHT_SENSITIVITY, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::EXPOSURE_MODE, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::SHARPNESS, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::COLOR_TONE, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::EV_COMPENSATION_VALUE, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::CONTRAST, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::BRIGHTNESS, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::FRAME_RATE, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::SCENE_ID, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::SECONDARY_CAMERA, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::SELF_TIMER, QVariant(0));
+ mSettingKeyHash.insert(CxeSettingIds::CAPTURE_SOUND_ALWAYS_ON, QVariant(0));
}
/*!
@@ -61,8 +81,8 @@
CxeError::Id error = CxeError::None;
if(mSettingKeyHash.contains(key)) {
value = mSettingKeyHash[key];
- } else if(mRuntimeKeyHash.contains(key)) {
- value = mRuntimeKeyHash[key];
+ } else if(mVariationKeyHash.contains(key)) {
+ value = mVariationKeyHash[key];
} else {
error = CxeError::NotFound;
}
@@ -82,29 +102,30 @@
Q_UNUSED(uid);
Q_UNUSED(key);
Q_UNUSED(type);
- Q_UNUSED(value);
- // no support yet
+ // Instead of emulating cenrep functionality
+ // we just return a test value for verification
+ value = 42;
}
/*!
-* Reads/loads all run-time settings values from cenrep
-* @param QList<QString> contains list of all runtime key ids which we use to load values from cenrep.
+* Reads/loads all variation settings values from cenrep
+* @param QList<QString> contains list of all variation key ids which we use to load values from cenrep.
* returns: QHash container, "contains" values associated with each key that are read from cenrep
-* NOTE: loading runtime settings should be done only ONCE at start-up.
+* NOTE: loading variation settings should be done only ONCE at start-up.
*/
-QHash<QString, QVariantList> CxeFakeSettingsStore::loadRuntimeSettings(QList<QString>& keylist)
+QHash<QString, QVariantList> CxeFakeSettingsStore::loadVariationSettings(QList<QString> &settingKeys)
{
QVariant data;
CxeError::Id err = CxeError::None;
QVariantList list;
QHash<QString, QVariantList> settings;
- mRuntimeKeyHash.clear();
+ mVariationKeyHash.clear();
- foreach (QString key, keylist) {
+ foreach (QString key, settingKeys) {
// before we read from get function we set values to the key
- mRuntimeKeyHash.insert(key, QVariant(1));
+ mVariationKeyHash.insert(key, QVariant(1));
// read the data from cenrep
err = get(key, data);
@@ -141,5 +162,6 @@
*/
void CxeFakeSettingsStore::reset()
{
+ resetSettings();
}