Ejemplo n.º 1
0
FCITX_EXPORT_API
FcitxStringMap* fcitx_string_map_new(const char* str, char delim)
{
    FcitxStringMap* map = fcitx_utils_new(FcitxStringMap);
    if (str) {
        fcitx_string_map_from_string(map, str, delim);
    }
    return map;
}
Ejemplo n.º 2
0
void ChttransEnabledForIMFilter(FcitxGenericConfig* config, FcitxConfigGroup* group, FcitxConfigOption* option, void* value, FcitxConfigSync sync, void* arg)
{
    FcitxChttrans* chttrans = (FcitxChttrans*) config;
    char** enableForIM = (char**) value;
    if (sync == Value2Raw) {
        fcitx_utils_free(*enableForIM);
        *enableForIM = fcitx_string_map_to_string(chttrans->enableIM, ',');
    } else if (sync == Raw2Value) {
        if (*enableForIM) {
            fcitx_string_map_from_string(chttrans->enableIM, *enableForIM, ',');
        }
    }
}
Ejemplo n.º 3
0
static void
FcitxNotifyLoadDConfig(FcitxNotify *notify)
{
    FILE *fp;
    fcitx_string_map_clear(notify->hide_notify);
    fp = FcitxXDGGetFileUserWithPrefix("conf", "fcitx-notify.config",
                                       "r", NULL);
    if (fp) {
        if (fcitx_desktop_file_load_fp(&notify->dconfig, fp)) {
            FcitxDesktopGroup *grp;
            grp = fcitx_desktop_file_ensure_group(&notify->dconfig,
                                                  "Notify/Notify");
            FcitxDesktopEntry *ety;
            ety = fcitx_desktop_group_ensure_entry(grp, "HiddenNotify");
            if (ety->value) {
                fcitx_string_map_from_string(notify->hide_notify,
                                             ety->value, ';');
            }
        }
        fclose(fp);
    }
}