Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ | 1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ |
2 /* vim:set et sts=4: */ | 2 /* vim:set et sts=4: */ |
3 /* bus - The Input Bus | 3 /* bus - The Input Bus |
4 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com> | 4 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com> |
5 * Copyright (C) 2008-2010 Red Hat, Inc. | 5 * Copyright (C) 2008-2010 Red Hat, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 } | 626 } |
627 | 627 |
628 if (engines_node) { | 628 if (engines_node) { |
629 ibus_xml_free (engines_node); | 629 ibus_xml_free (engines_node); |
630 } | 630 } |
631 } | 631 } |
632 | 632 |
633 static void | 633 static void |
634 ibus_component_parse_observed_paths (IBusComponent *component, | 634 ibus_component_parse_observed_paths (IBusComponent *component, |
635 XMLNode *node, | 635 XMLNode *node, |
636 gboolean access_fs) | 636 gboolean access_fs) |
Peng
2012/10/25 20:37:36
You changed align back?
Daiki Ueno
2012/10/26 01:35:04
Fixed this too.
| |
637 { | 637 { |
638 g_assert (IBUS_IS_COMPONENT (component)); | 638 g_assert (IBUS_IS_COMPONENT (component)); |
639 g_assert (node); | 639 g_assert (node); |
640 | 640 |
641 if (g_strcmp0 (node->name, "observed-paths") != 0) { | 641 if (g_strcmp0 (node->name, "observed-paths") != 0) { |
642 return; | 642 return; |
643 } | 643 } |
644 | 644 |
645 GList *p; | 645 GList *p; |
646 for (p = node->sub_nodes; p != NULL; p = p->next) { | 646 for (p = node->sub_nodes; p != NULL; p = p->next) { |
647 IBusObservedPath *path; | 647 IBusObservedPath *path; |
648 | 648 |
649 path = ibus_observed_path_new_from_xml_node ((XMLNode *)p->data, access_ fs); | 649 path = ibus_observed_path_new_from_xml_node ((XMLNode *)p->data, access_ fs); |
650 g_object_ref_sink (path); | 650 g_object_ref_sink (path); |
651 component->priv->observed_paths = g_list_append (component->priv->observ ed_paths, path); | 651 component->priv->observed_paths = g_list_append (component->priv->observ ed_paths, path); |
652 | 652 |
653 if (access_fs && path->is_dir && path->is_exist) { | 653 if (access_fs && path->is_dir && path->is_exist) { |
654 component->priv->observed_paths = | 654 component->priv->observed_paths = |
655 g_list_concat(component->priv->observed_paths, | 655 g_list_concat (component->priv->observed_paths, |
656 ibus_observed_path_traverse(path)); | 656 ibus_observed_path_traverse (path, TRUE)); |
657 } | 657 } |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 #define IBUS_COMPONENT_GET_PROPERTY(property, return_type) \ | 661 #define IBUS_COMPONENT_GET_PROPERTY(property, return_type) \ |
662 return_type \ | 662 return_type \ |
663 ibus_component_get_ ## property (IBusComponent *component) \ | 663 ibus_component_get_ ## property (IBusComponent *component) \ |
664 { \ | 664 { \ |
665 return component->priv->property; \ | 665 return component->priv->property; \ |
666 } | 666 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
783 { | 783 { |
784 IBusObservedPath *p; | 784 IBusObservedPath *p; |
785 | 785 |
786 p = ibus_observed_path_new (path, access_fs); | 786 p = ibus_observed_path_new (path, access_fs); |
787 g_object_ref_sink (p); | 787 g_object_ref_sink (p); |
788 component->priv->observed_paths = | 788 component->priv->observed_paths = |
789 g_list_append (component->priv->observed_paths, p); | 789 g_list_append (component->priv->observed_paths, p); |
790 | 790 |
791 if (access_fs && p->is_dir && p->is_exist) { | 791 if (access_fs && p->is_dir && p->is_exist) { |
792 component->priv->observed_paths = | 792 component->priv->observed_paths = |
793 g_list_concat(component->priv->observed_paths, | 793 g_list_concat (component->priv->observed_paths, |
794 ibus_observed_path_traverse(p)); | 794 ibus_observed_path_traverse (p, TRUE)); |
795 } | 795 } |
796 } | 796 } |
797 | 797 |
798 void | 798 void |
799 ibus_component_add_engine (IBusComponent *component, | 799 ibus_component_add_engine (IBusComponent *component, |
800 IBusEngineDesc *engine) | 800 IBusEngineDesc *engine) |
801 { | 801 { |
802 g_assert (IBUS_IS_COMPONENT (component)); | 802 g_assert (IBUS_IS_COMPONENT (component)); |
803 g_assert (IBUS_IS_ENGINE_DESC (engine)); | 803 g_assert (IBUS_IS_ENGINE_DESC (engine)); |
804 | 804 |
(...skipping 14 matching lines...) Expand all Loading... | |
819 g_assert (IBUS_IS_COMPONENT (component)); | 819 g_assert (IBUS_IS_COMPONENT (component)); |
820 | 820 |
821 GList *p; | 821 GList *p; |
822 | 822 |
823 for (p = component->priv->observed_paths; p != NULL; p = p->next) { | 823 for (p = component->priv->observed_paths; p != NULL; p = p->next) { |
824 if (ibus_observed_path_check_modification ((IBusObservedPath *)p->data)) | 824 if (ibus_observed_path_check_modification ((IBusObservedPath *)p->data)) |
825 return TRUE; | 825 return TRUE; |
826 } | 826 } |
827 return FALSE; | 827 return FALSE; |
828 } | 828 } |
829 | |
830 GList * | |
831 ibus_component_get_observed_paths (IBusComponent *component) | |
832 { | |
833 g_assert (IBUS_IS_COMPONENT (component)); | |
834 return g_list_copy (component->priv->observed_paths); | |
835 } | |
OLD | NEW |