SET(INC_DIR include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${INC_DIR})
-SET(dependents "dlog capi-base-common vconf glib-2.0 libtzplatform-config")
+SET(dependents "dlog capi-base-common vconf glib-2.0 libtzplatform-config capi-system-system-settings")
SET(pc_dependents "capi-base-common")
INCLUDE(FindPkgConfig)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libtzplatform-config)
+BuildRequires: pkgconfig(capi-system-system-settings)
%description
development package of library to get storage
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <system_settings.h>
#include "common.h"
#include "list.h"
[STORAGE_DIRECTORY_MUSIC] = "Music",
[STORAGE_DIRECTORY_DOCUMENTS] = "Documents",
[STORAGE_DIRECTORY_OTHERS] = "Others",
- [STORAGE_DIRECTORY_SYSTEM_RINGTONES] = "/usr/apps/org.tizen.setting/shared/res/settings/Ringtones",
+ [STORAGE_DIRECTORY_SYSTEM_RINGTONES] = "",
};
static dd_list *st_head;
const struct storage_ops *st;
const char *root;
char temp[PATH_MAX];
+ char *temp2, *end;
+ int ret;
if (!path) {
_E("Invalid parameger");
}
root = st->root();
- if (type == STORAGE_DIRECTORY_SYSTEM_RINGTONES)
- snprintf(temp, PATH_MAX, "%s", dir_path[type]);
- else
+ if (type == STORAGE_DIRECTORY_SYSTEM_RINGTONES) {
+ ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &temp2);
+ if (ret < 0) {
+ _E("Failed to get ringtone path : %d", ret);
+ return STORAGE_ERROR_OPERATION_FAILED;
+ }
+ end = strrchr(temp2, '/');
+ if (end)
+ *end = '\0';
+ snprintf(temp, PATH_MAX, "%s", temp2);
+ free(temp2);
+ } else
snprintf(temp, PATH_MAX, "%s/%s", root, dir_path[type]);
*path = strdup(temp);