[screen reader utils] fun generate_description_for_subtrees() removed 63/94163/1
authorLukasz Wlazly <l.wlazly@partner.samsung.com>
Thu, 27 Oct 2016 08:00:06 +0000 (10:00 +0200)
committerLukasz Wlazly <l.wlazly@partner.samsung.com>
Thu, 27 Oct 2016 08:04:50 +0000 (10:04 +0200)
Change-Id: Idb41ea21af0a6cd09a4cf1f8e29395d5ad00d701

src/navigator.c

index 1017e380d3907befe99c23fc44cf4aaa82dd4034..1454de1e4de03d76185900f51102f6c4988c9314 100644 (file)
@@ -345,61 +345,6 @@ static void display_info_about_object(AtspiAccessible *obj, bool display_parent_
        g_free(description);
 }
 
-char *generate_description_for_subtrees(AtspiAccessible *obj)
-{
-       DEBUG("START");
-
-       if (!obj)
-               return strdup("");
-       return strdup("");
-       /*
-          AtspiRole role;
-          int child_count;
-          int i;
-          char *name = NULL;
-          char *below = NULL;
-          char ret[TTS_MAX_TEXT_SIZE] = "\0";
-          AtspiAccessible *child = NULL;
-
-          int child_count = atspi_accessible_get_child_count(obj, NULL);
-
-          role = atspi_accessible_get_role(obj, NULL);
-
-          // Do not generate that for popups
-          if (role == ATSPI_ROLE_POPUP_MENU || role == ATSPI_ROLE_DIALOG)
-          return strdup("");
-
-          child_count = atspi_accessible_get_child_count(obj, NULL);
-
-          DEBUG("There is %d children inside this object", child_count);
-          if (!child_count)
-          return strdup("");
-
-          for (i=0; i < child_count; i++)
-          {
-          child = atspi_accessible_get_child_at_index(obj, i, NULL);
-          name = atspi_accessible_get_name(child, NULL);
-          DEBUG("%d child name:%s", i, name);
-          if (name && strncmp(name, "\0", 1))
-          {
-          strncat(ret, name, sizeof(ret) - strlen(ret) - 1);
-          }
-          strncat(ret, " ", sizeof(ret) - strlen(ret) - 1);
-          below = generate_description_for_subtrees(child);
-          DEBUG("%s from below", below);
-          if (strncmp(below, "\0", 1))
-          {
-          strncat(ret, below, sizeof(ret) - strlen(ret) - 1);
-          }
-
-          g_object_unref(child);
-          free(below);
-          free(name);
-          }
-          return strdup(ret);
-        */
-}
-
 static int _check_list_children_count(AtspiAccessible *obj)
 {
        int list_count = 0;
@@ -920,7 +865,6 @@ static char *generate_what_to_read(AtspiAccessible * obj, Screen_Reader_Vconf_Da
        char *names = NULL;
        char *description = NULL;
        char *role_name = NULL;
-       char *other = NULL;
        char *text = NULL;
        char ret[TTS_MAX_TEXT_SIZE] = "\0";
        char *description_from_relation = NULL;
@@ -978,7 +922,6 @@ static char *generate_what_to_read(AtspiAccessible * obj, Screen_Reader_Vconf_Da
        if (hash_table) g_hash_table_unref(hash_table);
        if (attribute & ACCESSIBLE_READING_INFO_TYPE_NAME) {
                name = atspi_accessible_get_name(obj, NULL);
-               other = generate_description_for_subtrees(obj);
                name_from_relation = generate_text_for_relation_objects(obj,
                                ATSPI_RELATION_LABELLED_BY, generate_name_from_relation_object);
                AtspiText *iface_text = atspi_accessible_get_text_iface(obj);
@@ -988,8 +931,6 @@ static char *generate_what_to_read(AtspiAccessible * obj, Screen_Reader_Vconf_Da
                }
                if (name && strncmp(name, "\0", 1))
                        names = strdup(name);
-               else if (other && strncmp(other, "\0", 1))
-                       names = strdup(other);
                if (text) {
                        strncat(ret, text, sizeof(ret) - strlen(ret) - 1);
                }
@@ -1004,10 +945,9 @@ static char *generate_what_to_read(AtspiAccessible * obj, Screen_Reader_Vconf_Da
                                strncat(ret, ", ", sizeof(ret) - strlen(ret) - 1);
                        strncat(ret, name_from_relation, sizeof(ret) - strlen(ret) - 1);
                }
-               DEBUG("WIDGET GAINED HIGHLIGHT: %s, %s", name, other);
+               DEBUG("WIDGET GAINED HIGHLIGHT: %s", name);
                SCREEN_READER_SAFE_FREE(text, free);
                SCREEN_READER_SAFE_FREE(name, free);
-               SCREEN_READER_SAFE_FREE(other, free);
                SCREEN_READER_SAFE_FREE(name_from_relation, free);
                SCREEN_READER_SAFE_FREE(names, free);
        }