hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=a360601aa437fabe4adff2a0b3a8ea82b4706964

commit a360601aa437fabe4adff2a0b3a8ea82b4706964
Author: Taehyub Kim <taehyub....@samsung.com>
Date:   Fri Apr 1 16:12:20 2016 +0900

    console: hide unnecessary console error line
    
    Summary:
    Actually it is unnecessary error log below the first line.
    so I skipped the log
    
    Test Plan:
    1. launch enventor
    2. make an error
    3. see the console log in single line
    
    Reviewers: Jaehyun_Cho, NikaWhite, Hermet
    
    Reviewed By: Hermet
    
    Differential Revision: https://phab.enlightenment.org/D3845
---
 src/bin/console.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/bin/console.c b/src/bin/console.c
index 29e7b33..8f5b21d 100644
--- a/src/bin/console.c
+++ b/src/bin/console.c
@@ -32,9 +32,9 @@ error_word_select(Evas_Object *console)
 
    //parse error word
    if ((error_token = strstr(console_text, "keyword")))
-     token_value_get(error_token, "keyword", '<', 1, error_word);
+     token_value_get(error_token, "keyword", '\0', 1, error_word);
    else if ((error_token = strstr(console_text, "name")))
-     token_value_get(error_token, "name", '<', 1, error_word);
+     token_value_get(error_token, "name", '\0', 1, error_word);
    else return;
 
     //find error word position
@@ -63,6 +63,17 @@ error_word_select(Evas_Object *console)
     enventor_object_select_region_set(base_enventor_get(), start, end);
 }
 
+static void
+make_single_error_msg(const char *src, char *dst)
+{
+   /* We cut a error messages since it contains unnecessary information.
+      Most of the time, first one line has a practical information. */
+   const char *new_line  = "<br/>";
+   const char *eol = strstr(src, new_line);
+   if (!eol) return;
+   strncpy(dst, src, eol - src);
+   dst[eol - src] = '\0';
+}
 /*****************************************************************************/
 /* Externally accessible calls                                               */
 /*****************************************************************************/
@@ -70,7 +81,11 @@ error_word_select(Evas_Object *console)
 void
 console_text_set(Evas_Object *console, const char *text)
 {
-   elm_entry_entry_set(console, text);
+   char * single_error_msg = NULL;
+   single_error_msg = alloca(strlen(text) + 1);
+   if (!single_error_msg) return;
+   make_single_error_msg(text, single_error_msg);
+   elm_entry_entry_set(console, single_error_msg);
    error_word_select(console);
 }
 

-- 


Reply via email to