sound: Relocate macro related to parse 24/302524/1
authorYunhee Seo <yuni.seo@samsung.com>
Thu, 30 Nov 2023 01:06:49 +0000 (10:06 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Fri, 8 Dec 2023 04:27:51 +0000 (13:27 +0900)
With the sound-parser separated out, there was no need to place macros on sound.c
It is correct to place conf file path in sound-parser that actually uses the path.
Furthermore, unnecessary function parameter pass has also been deleted.

Change-Id: Ib9e66f01261e51152a6a5d0b41231922ae2d1f1d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/sound-parser.c
src/sound-parser.h
src/sound.c

index 7a367e3..ba3c865 100644 (file)
@@ -28,6 +28,8 @@
 #include "sound-theme-manager.h"
 
 #define INITIAL_DEFAULT_SOUND_THEME_ID                         -1
+#define SOUND_CONF_FILE FEEDBACK_SYS_RO_SHARE"/feedback/sound.conf"
+
 static int default_sound_theme_id = INITIAL_DEFAULT_SOUND_THEME_ID;
 
 static GHashTable *g_hash_table_to_check_id_duplicated;
@@ -136,14 +138,14 @@ out_parsing_fail:
        return -EPERM;
 }
 
-int sound_parser_init(const char* sound_file_path)
+int sound_parser_init(void)
 {
        int ret = 0;
 
        g_hash_table_to_check_id_duplicated = g_hash_table_new_full(g_int_hash, g_int_equal,
                                                                        g_free, g_free);
 
-       ret = syscommon_config_parse_by_section(sound_file_path, parse_sound_theme_section, NULL);
+       ret = syscommon_config_parse_by_section(SOUND_CONF_FILE, parse_sound_theme_section, NULL);
 
        if (!is_default_theme_id_set()) {
                _E("Failed to parse sound conf file. There is no default sound theme id");
index f72791d..b54fcf7 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef __SOUND_PARSER_H__
 #define __SOUND_PARSER_H__
 
-int sound_parser_init(const char* sound_file_path);
+int sound_parser_init(void);
 void sound_parser_exit(void);
 
 #endif
\ No newline at end of file
index d73f423..1f6d33d 100644 (file)
@@ -40,8 +40,6 @@
 #include "sound-parser.h"
 #include "sound-theme-manager.h"
 
-#define SOUND_CONF_FILE FEEDBACK_SYS_RO_SHARE"/feedback/sound.conf"
-#define SOUND_NAME                             "Sound"
 /* Temporary keys */
 #ifndef VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL
 #define VCONFKEY_SETAPPL_BUTTON_SOUNDS_BOOL "db/setting/sound/button_sounds"
@@ -149,7 +147,7 @@ static void sound_init(void)
                sound_thememan_exit();
        }
 
-       ret = sound_parser_init(SOUND_CONF_FILE);
+       ret = sound_parser_init();
        if (ret < 0) {
                _E("Failed to parsing sound config file(%d)", ret);
                sound_thememan_exit();