EmailSettingView *view;
} ListItemData;
-#define SETTING_DEFAULT_ALERT_PATH "/opt/usr/share/settings/Alerts"
-#define MYFILE_SILENT_RINGTON_VALUE "silent"
+#define SETTING_DEFAULT_ALERT_PATH "/opt/share/settings/Alerts"
+#define SETTING_SILENT_RINGTON_VALUE "silent"
+#define SETTING_DATA_DEF_SUBSTITUTION "default_substitution"
-#define APP_CONTROL_RINGTONE_IS_DEFAULT "is_default"
-#define APP_CONTROL_RINGTONE_TRUE "true"
+#define SETTING_APP_CONTROL_RINGTONE_IS_DEF "is_default"
+#define SETTING_APP_CONTROL_RINGTONE_TRUE "true"
void create_notification_setting_view(EmailSettingModule *module)
{
email_params_h params = NULL;
const char *alert_folder_path = SETTING_DEFAULT_ALERT_PATH;
const char *ringtone_file_path = view->account_data->options.alert_ringtone_path;
+ const char *def_ringtone_file_path = DEFAULT_EMAIL_RINGTONE_PATH;
if (email_params_create(¶ms)
&& email_params_add_str_array(params, APP_CONTROL_DATA_PATH, &alert_folder_path, 1)
+ && email_params_add_str(params, SETTING_DATA_DEF_SUBSTITUTION, def_ringtone_file_path)
&& (view->account_data->options.default_ringtone_status || !STR_VALID(ringtone_file_path)
|| email_params_add_str_array(params, APP_CONTROL_DATA_SELECTED, &ringtone_file_path, 1))) {
email_launched_app_listener_t listener = { 0 };
debug_secure("ringtone_path: %s", ringtone_path);
const char *is_ringtone_def = NULL;
- if (!email_params_get_str(reply, APP_CONTROL_RINGTONE_IS_DEFAULT, &is_ringtone_def)) {
+ if (!email_params_get_str(reply, SETTING_APP_CONTROL_RINGTONE_IS_DEF, &is_ringtone_def)) {
debug_log("ringtone is not default");
}
- if (!g_strcmp0(APP_CONTROL_RINGTONE_TRUE, is_ringtone_def)) {
+ if (!g_strcmp0(SETTING_APP_CONTROL_RINGTONE_TRUE, is_ringtone_def)) {
if (li->index == ALERT_RINGTONE_LIST_ITEM) {
view->account_data->options.default_ringtone_status = 1;
FREE(view->account_data->options.alert_ringtone_path);
view->account_data->options.alert_ringtone_path = strdup(DEFAULT_EMAIL_RINGTONE_PATH);
}
- } else if (!g_strcmp0(MYFILE_SILENT_RINGTON_VALUE, ringtone_path)) {
+ } else if (!g_strcmp0(SETTING_SILENT_RINGTON_VALUE, ringtone_path)) {
if (li->index == ALERT_RINGTONE_LIST_ITEM) {
view->account_data->options.default_ringtone_status = 0;
FREE(view->account_data->options.alert_ringtone_path);