#include <pkgmgr_installer_info.h>
#include "system_settings.h"
-
#define FONT_SERVICE_TAG "FONT_SERVICE"
#define DEBUG_LOG(frmt, args...) \
do { SLOG(LOG_DEBUG,FONT_SERVICE_TAG, "[font_service] %s: "frmt"\n",\
static const char *DOWNLOAD_PATH = "/opt/share/fonts/download";
static const char *PRELOADED_PATH = "/opt/share/fonts/preloaded";
-static const char *ELM_PROFILE_CFG = "/opt/home/app/.elementary/config/profile.cfg";
#define MAX_FILE_LEN 4096
#define APP_OWNER_ID 5001
#define APP_GROUP_ID 100
if (fs)
{
int j;
+
for (j = 0; j < fs->nfont; j++)
{
FcChar8 *file = NULL;
if (FcPatternGetString(fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch)
{
- DEBUG_LOG("file =%s\n",file);
- if (strncmp((const char*)file , deletedir , deletedir_len) == 0 )
+ DEBUG_LOG("file =%s, deletedir =%s\n", file, deletedir);
+ if (strncmp((const char*)file, deletedir, deletedir_len) == 0)
{
DEBUG_LOG("change to default font\n");
char *default_font_name = NULL;
}
DEBUG_LOG("default_font_name = %s \n",default_font_name);
- setenv("HOME", "/opt/home/app", 1);
-
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, default_font_name);
if (ret < 0)
{
break;
}
- char *elm_profile_path = (char*)elm_config_profile_dir_get(elm_config_profile_get(), EINA_TRUE);
-
- setenv("HOME", "/root", 1);
-
- ret = chown(ELM_PROFILE_CFG, APP_OWNER_ID, APP_GROUP_ID);
- if (ret < 0)
- {
- chmod (ELM_PROFILE_CFG, 0777);
- }
-
- DIR *d = NULL;
- struct dirent *e;
-
- if (elm_profile_path)
- d = opendir (elm_profile_path);
-
- if (d)
- {
- while ((e = readdir (d)))
- {
- if (e->d_name[0] != '.' && (strstr(e->d_name, ".cfg") != 0 || strstr(e->d_name, ".CFG") != 0))
- {
- char file_full_path[100];
-
- sprintf(file_full_path, "%s/%s", elm_profile_path, e->d_name);
-
- ret = chown(file_full_path, APP_OWNER_ID, APP_GROUP_ID);
- if (ret < 0)
- {
- DEBUG_LOG("chown is failed %s", file_full_path);
- chmod (file_full_path, 0777);
- }
- }
- }
-
- closedir (d);
- }
-
free(default_font_name);
- free(elm_profile_path);
DEBUG_LOG("success change to default font\n");
break;
}