Fixed bug with using internet applet. Some code cleaning made.
authorbiedro <marcin.biedron@gmail.com>
Mon, 21 Jan 2008 08:48:27 +0000 (08:48 +0000)
committerbiedro <marcin.biedron@gmail.com>
Mon, 21 Jan 2008 08:48:27 +0000 (08:48 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@238 5bde0345-f819-0410-ac75-e5045f9217cc

src/gui/include/ws_gui_utils.h [new file with mode: 0644]
src/gui/makefile
src/gui/src/ws_gui_callbacks.c
src/gui/src/ws_gui_utils.c [new file with mode: 0644]
src/manager/src/ws_mng_callbacks.c

diff --git a/src/gui/include/ws_gui_utils.h b/src/gui/include/ws_gui_utils.h
new file mode 100644 (file)
index 0000000..b54ad13
--- /dev/null
@@ -0,0 +1,49 @@
+/*******************************************************************************
+This file is part of mdictionary.
+
+mdictionary is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+mdictionary is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with mdictionary; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+*******************************************************************************/
+/** \addtogroup GUI */
+/*@{*/
+/** \file ws_gui_utils.h
+ * \brief File with functions used in GUI - header.
+ */
+#ifndef _WS_GUI_UTILS
+#define _WS_GUI_UTILS
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \brief Function that checks if given char is hex
+ */
+gboolean ws_gui_is_hex ( char tchar );
+
+/**
+ * \brief Function that changes all hex characters into asci code.
+ */
+void ws_gui_word_conversion( osso_rpc_t* osso_data );
+
+/*@}*/
+#ifdef __cplusplus
+}
+#endif
+#endif
+/*@}*/
+
+//end of file
index 9db8c48..178db92 100644 (file)
@@ -21,26 +21,29 @@ SOURCES = src
 BINARIES = bin
 MAIN_BINARIES = ../../bin
 
-${EXECUTABLE}: ${BINARIES}/ws_gui.o ${BINARIES}/ws_gui_callbacks.o ${BINARIES}/ws_gui_layout.o ${MAIN_BINARIES}/ws_dbus.o
-               ${CC} ${DEBUG}   -o ${BINARIES}/${EXECUTABLE} ${BINARIES}/ws_gui.o ${BINARIES}/ws_gui_callbacks.o ${BINARIES}/ws_gui_layout.o ${MAIN_BINARIES}/ws_dbus.o ${LIBS} ${CFLAGS} ${DEFINES}
+${EXECUTABLE}: ${BINARIES}/ws_gui.o ${BINARIES}/ws_gui_callbacks.o ${BINARIES}/ws_gui_layout.o ${BINARIES}/ws_gui_utils.o ${MAIN_BINARIES}/ws_dbus.o
+               ${CC} ${DEBUG}   -o ${BINARIES}/${EXECUTABLE} ${BINARIES}/ws_gui.o ${BINARIES}/ws_gui_callbacks.o ${BINARIES}/ws_gui_layout.o ${BINARIES}/ws_gui_utils.o ${MAIN_BINARIES}/ws_dbus.o ${LIBS} ${CFLAGS} ${DEFINES}
                @cp ${BINARIES}/${EXECUTABLE} ${MAIN_BINARIES}
 
 ${BINARIES}/ws_gui.o: ${SOURCES}/ws_gui.c ${INCLUDE_GUI}/ws_gui.h ${INCLUDE_GUI}/ws_gui_callbacks.h ${INCLUDE_GUI}/ws_gui_layout.h ${INCLUDE_DBUS_WRAPPER}/ws_dbus.h
                ${CC} ${DEBUG} -c ${SOURCES}/ws_gui.c -o ${BINARIES}/ws_gui.o ${CFLAGS}  ${DEFINES}
 
-${BINARIES}/ws_gui_callbacks.o: ${SOURCES}/ws_gui_callbacks.c ${INCLUDE_GUI}/ws_gui_callbacks.h ${INCLUDE_GUI}/ws_gui.h ${INCLUDE_DBUS_WRAPPER}/ws_dbus.h
+${BINARIES}/ws_gui_callbacks.o: ${SOURCES}/ws_gui_callbacks.c ${INCLUDE_GUI}/ws_gui_callbacks.h ${INCLUDE_GUI}/ws_gui.h  ${INCLUDE_GUI}/ws_gui_utils.h ${INCLUDE_DBUS_WRAPPER}/ws_dbus.h
                ${CC} ${DEBUG} -c ${SOURCES}/ws_gui_callbacks.c -o ${BINARIES}/ws_gui_callbacks.o ${CFLAGS}  ${DEFINES}
 
 ${BINARIES}/ws_gui_layout.o: ${SOURCES}/ws_gui_layout.c ${INCLUDE_GUI}/ws_gui_layout.h ${INCLUDE_GUI}/ws_gui.h ${INCLUDE_DBUS_WRAPPER}/ws_dbus.h
                ${CC} ${DEBUG} -DWS_VERSION=\"${APP_VER}\" -c ${SOURCES}/ws_gui_layout.c -o ${BINARIES}/ws_gui_layout.o ${CFLAGS}  ${DEFINES}
 
+${BINARIES}/ws_gui_utils.o: ${SOURCES}/ws_gui_utils.c ${INCLUDE_GUI}/ws_gui_utils.h
+               ${CC} ${DEBUG} -DWS_VERSION=\"${APP_VER}\" -c ${SOURCES}/ws_gui_utils.c -o ${BINARIES}/ws_gui_utils.o ${CFLAGS}  ${DEFINES}
+
 ${MAIN_BINARIES}/ws_dbus.o:
                cd ../dbus_wrapper && make
 
 
 dyn:
-               ${BINARIES}/wsl_gui.o ${BINARIES}/wsl_gui_callbacks.o ${BINARIES}/wsl_gui_layout.o 
-               @{CC} ${DEBUG} -shared -fPIC -o ${EXECUTABLE}.so ${BINARIES}/wsl_gui.o ${BINARIES}/wsl_gui_callbacks.o ${BINARIES}/wsl_gui_layout.o dbus/ws_dbus.o ${LIBS} ${CFLAGS} ${DEFINES}
+               ${BINARIES}/wsl_gui.o ${BINARIES}/wsl_gui_callbacks.o ${BINARIES}/wsl_gui_layout.o ${BINARIES}/wsl_gui_utils.o
+               @{CC} ${DEBUG} -shared -fPIC -o ${EXECUTABLE}.so ${BINARIES}/wsl_gui.o ${BINARIES}/wsl_gui_callbacks.o ${BINARIES}/wsl_gui_layout.o ${BINARIES}/wsl_gui_utils.o dbus/ws_dbus.o ${LIBS} ${CFLAGS} ${DEFINES}
 
 ${BINARIES}/wsl_gui.o: ${SOURCES}/ws_gui.c ${INCLUDE_GUI}/ws_gui.h ${INCLUDE_GUI}/ws_gui_callbacks.h ${INCLUDE_GUI}/ws_gui_layout.h ${INCLUDE_DBUS_WRAPPER}/ws_dbus.h
                @{CC} ${DEBUG} -fPIC -c ${SOURCES}/ws_gui.c -o ${BINARIES}/wsl_gui.o ${CFLAGS} ${DEFINES}
@@ -51,6 +54,8 @@ ${BINARIES}/wsl_gui_callbacks.o: ${SOURCES}/ws_gui_callbacks.c ${INCLUDE_GUI}/ws
 ${BINARIES}/wsl_gui_layout.o: ${SOURCES}/ws_gui_layout.c ${INCLUDE_GUI}/ws_gui_layout.h ${INCLUDE_GUI}/ws_gui.h ${INCLUDE_DBUS_WRAPPER}/ws_dbus.h
                @{CC} ${DEBUG} -fPIC -c ${SOURCES}/ws_gui_layout.c -o ${BINARIES}/wsl_gui_layout.o ${CFLAGS} ${DEFINES}
 
+${BINARIES}/wsl_gui_utils.o: ${SOURCES}/ws_gui_utils.c ${INCLUDE_GUI}/ws_gui_utils.h
+               @{CC} ${DEBUG} -fPIC -c ${SOURCES}/ws_gui_utils.c -o ${BINARIES}/wsl_gui_utils.o ${CFLAGS} ${DEFINES}
 
 clean:
        rm -f ${BINARIES}/*
index 60ca83d..864c0b7 100644 (file)
@@ -32,6 +32,7 @@ Copyright 2006 ComArch S.A.
 #include <ws_gui_callbacks.h>
 #include <ws_gui.h>
 #include <ws_gui_layout.h>
+#include <ws_gui_utils.h>
 #include <ws_dbus.h>
 
 /** \brief show how much time did take a callback of another function
@@ -404,12 +405,15 @@ void ws_gui_search_home_handler(GError *error, GArray *word, gpointer user_data)
        WSGuiApp *data = (WSGuiApp*) user_data;
        osso_rpc_t* osso_data = NULL;
 
-       //get the word passed by dbus 
+       /*get the word passed by dbus*/
        osso_data = &g_array_index (word, osso_rpc_t, 0); 
 
-       //free memory used by last searched word
+       /*free memory used by last searched word*/
        gchar* tmp = NULL;
        tmp = g_strdup(osso_data->value.s + 11);
+
+       /* check for special characters in text starting with % */      
+       ws_gui_word_conversion( osso_data );
        
        g_object_set(G_OBJECT(data->ws_gui_hildon_find_toolbar),
                "prefix",
@@ -447,18 +451,15 @@ void ws_dbus_progress_bar(GError *error, GArray *words, gpointer user_data)
 */
 void ws_gui_clear_list (GtkListStore* list, gpointer user_data) 
 {
-       //WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
        GtkTreeIter iter;
        gboolean tmp;
        
-       //g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n\nws_gui_clear_list\n\n");   
        tmp = gtk_tree_model_get_iter_first(
                        GTK_TREE_MODEL(list),
                        &iter); 
 
        while (tmp == TRUE)
        {
-       //      g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\n\nws_gui_clear_list2\n\n");
                tmp = gtk_list_store_remove(list, &iter);
                
        }
@@ -499,17 +500,9 @@ void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data)
                g_array_append_val(tmp, tmp_word);
        }
        
-       //g_assert(ws_gui_app->ws_gui_banner_list_searching);
-       //gtk_widget_hide(GTK_WIDGET(ws_gui_app->ws_gui_banner_list_searching));
-
        ws_gui_app->loading = FALSE;
        ws_gui_set_toolbar_avail(ws_gui_app);
 
-       //ws_gui_app->ws_gui_banner_flag = FALSE;
-
-       //ws_gui_clear_list(ws_gui_app->ws_gui_w_list->ws_gui_store);
-
-
        ws_gui_app->ws_gui_w_list->ws_gui_model = 
                                        create_and_fill_model(tmp, ws_gui_app);
        
@@ -589,12 +582,7 @@ void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data)
        ws_gui_app->html_flag = TRUE;
        g_value_unset (&value);
        }
-       
-       
-/*     g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "Dlugosc tempa to: %d", tmp->len);
-       g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "w tempie mamy: %s", tmp_word);*/
-       //if (&& ws_gui_app->stop_clicked != TRUE )
-       
+               
        if ((tmp->len == 0 || tmp_word == NULL) && ws_gui_app->stop_clicked != TRUE )
        {
                        hildon_banner_show_information(GTK_WIDGET(
@@ -602,8 +590,6 @@ void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data)
                                        NULL,
                        _("ws_ni_no_words_found"));
                
-               //ws_gui_fill_html(" ", ws_gui_app);
-               //ws_gui_app->html_flag = FALSE;
                if (ws_gui_app->dictionary_selection_changed == TRUE)
                {
                        ws_gui_clear_list(ws_gui_app->ws_gui_w_list->ws_gui_store, ws_gui_app);
@@ -655,7 +641,6 @@ void ws_gui_dbus_return_translation (GError *error,
        g_free(html_content);
        ws_gui_app->html_flag = TRUE;
        
-       //gtk_widget_hide(ws_gui_app->ws_gui_banner_translation_loading);
        ws_gui_app->loading = FALSE;
        ws_gui_set_toolbar_avail(ws_gui_app);
 
@@ -968,7 +953,6 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
                gchar *tmp = g_array_index(ws_gui_app->ws_gui_history, 
                                        gchar*, 
                                        i);
-               //tmp_iter = gtk_tree_model_get_string_from_iter (GTK_TREE_MODEL(ws_gui_app->ws_gui_w_list->ws_gui_model), &ws_gui_app->ws_gui_w_list->ws_gui_iter);
        
                if (previous_word != NULL && 
                strcmp(previous_word, new_word) != 0)
@@ -1053,7 +1037,7 @@ void ws_gui_history_back(GtkButton *button, gpointer user_data)
                ws_gui_app->ws_gui_history_cur_pos = 
                                        ws_gui_app->ws_gui_history_cur_pos - 1;
 
-               //set object's property
+               /*set object's property*/
                g_object_set(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar),
                        "prefix",
                        (g_array_index(ws_gui_app->ws_gui_history_list,
@@ -1066,8 +1050,6 @@ void ws_gui_history_back(GtkButton *button, gpointer user_data)
                                        gchar*, 
                                        ws_gui_app->ws_gui_history_cur_pos))
                                        );
-               //gtk_widget_hide(ws_gui_app->ws_gui_list_hbox);
-               //gtk_widget_show(ws_gui_app->ws_gui_banner_translation_loading);
                ws_gui_app->loading = TRUE;
                ws_gui_set_toolbar_avail(ws_gui_app);
        }
@@ -1104,7 +1086,7 @@ void ws_gui_history_next(GtkButton *button, gpointer user_data)
                        ws_gui_app->ws_gui_history_cur_pos + 1;
 
 
-               //set object's property
+               /*set object's property*/
                g_object_set(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar),
                        "prefix",
                        (g_array_index(ws_gui_app->ws_gui_history_list,
@@ -1119,19 +1101,17 @@ void ws_gui_history_next(GtkButton *button, gpointer user_data)
                                        ws_gui_app->ws_gui_history_cur_pos))
                                        );
                
-               //gtk_widget_hide(ws_gui_app->ws_gui_list_hbox);
-               //gtk_widget_show(ws_gui_app->ws_gui_banner_translation_loading);
                ws_gui_app->loading = TRUE;
                ws_gui_set_toolbar_avail(ws_gui_app);
        }
        else 
        {
-               //make forward button inactive
+               /*make forward button inactive*/
                gtk_widget_set_sensitive(
                        GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_forward),
                        FALSE);
 
-               //make find next button inactive
+               /*make find next button inactive*/
                gtk_widget_set_sensitive(
                GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_next),
                FALSE);
@@ -1257,7 +1237,6 @@ GtkTreeModel * create_and_fill_model (GArray *words_list, gpointer user_data)
                
        if (ws_gui_app->history_flag == FALSE && tmp != NULL)
        {
-               //gtk_widget_show(ws_gui_app->ws_gui_banner_translation_loading);
                ws_dbus_client_find_translation(ws_gui_app->dbus_data, tmp);
                ws_gui_history_add(tmp, ws_gui_app);
 
@@ -1368,13 +1347,12 @@ void ws_gui_popup_search(GtkMenuItem *menuitem, gpointer user_data)
        g_strstrip(temp);
        if (temp != NULL || strcmp(temp, " "))
        {
-               //set object's property
+               /*set object's property*/
                g_object_set(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar),
                                "prefix",
                                temp,
                                NULL);
                ws_dbus_client_find_word (ws_gui_app->dbus_data, temp);
-               //gtk_widget_hide(ws_gui_app->ws_gui_list_hbox);
        }
        else
        {
@@ -1541,8 +1519,6 @@ void ws_gui_search(GtkWidget * widget, gpointer user_data)
        
        ws_gui_app->stop_clicked = FALSE;
 
-// if (ws_gui_app->ws_gui_banner_flag == FALSE) 
-       //{
        gchar* ws_gui_text = NULL;
        g_object_get(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar),
                "prefix",
@@ -1570,16 +1546,9 @@ void ws_gui_search(GtkWidget * widget, gpointer user_data)
        g_strstrip(ws_gui_text);
        if (strlen(ws_gui_text) != 0) 
        {
-               //gtk_widget_show(ws_gui_app->ws_gui_banner_list_searching);
-               
                ws_gui_app->loading = TRUE;
                ws_gui_set_toolbar_avail(ws_gui_app);
-
-               //ws_gui_app->ws_gui_banner_flag = TRUE;
-               //ws_gui_fill_html(" ", ws_gui_app);
-               //ws_gui_app->html_flag = FALSE;
                ws_dbus_client_find_word (ws_gui_app->dbus_data, ws_gui_text);
-               //gtk_widget_hide(GTK_WIDGET(ws_gui_app->ws_gui_list_hbox));
                
                g_free(ws_gui_text);
        }
@@ -1592,7 +1561,6 @@ void ws_gui_search(GtkWidget * widget, gpointer user_data)
        }
        g_free(ws_gui_app->last_word);
        ws_gui_app->last_word=NULL;
-       //}
 }
 
 /** stop search process
@@ -1671,7 +1639,7 @@ void ws_gui_fill_html(char *html_context, gpointer user_data)
        
        gtk_html_set_editable (GTK_HTML(ws_gui_app->ws_gui_html), FALSE);
 
-       //Load welcome screen or translation string
+       /*Load welcome screen or translation string*/
        if (ws_gui_app->first_run == TRUE && ws_gui_app->bookmark_mode==FALSE)
        {
        gtk_html_load_from_string(GTK_HTML(ws_gui_app->ws_gui_html),
@@ -2142,7 +2110,6 @@ void ws_gui_dictionary_remove_bookmark(GtkMenuItem *menuitem,
                                &temp,
                                NULL);
                ws_dbus_client_find_word (ws_gui_app->dbus_data, temp);
-               //gtk_widget_hide(ws_gui_app->ws_gui_list_hbox);
                
        }
        else
@@ -2258,7 +2225,7 @@ void ws_gui_set_bookmarks_sensitivity(gpointer user_data)
                }
        }
 
-       //setting sensitivity of components
+       /*setting sensitivity of components*/
        gtk_widget_set_sensitive(
                GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_open_bookmark),
                FALSE);
@@ -2297,7 +2264,7 @@ void ws_gui_set_bookmarks_sensitivity(gpointer user_data)
                }
        }
 
-       //setting sensitivity of components
+       /*setting sensitivity of components*/
        gtk_widget_set_sensitive(
                GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_open_bookmark),
                TRUE);
@@ -2406,7 +2373,6 @@ void ws_gui_view_cursor_changed(GtkTreeView *treeview, gpointer user_data)
                                -1);
        if (string != NULL)
                {
-               //gtk_widget_show(ws_gui_app->ws_gui_banner_translation_loading);
                ws_gui_app->loading = TRUE;
                ws_gui_set_toolbar_avail(ws_gui_app);
 
@@ -2471,7 +2437,7 @@ void ws_refresh_search_results(gpointer user_data) {
        
        WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
 
-       //refreshing the words list and translation pane
+       /*efreshing the words list and translation pane*/
        gchar *temp;
        g_object_get(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar),
                                "prefix",
@@ -2482,7 +2448,5 @@ void ws_refresh_search_results(gpointer user_data) {
        {
                ws_dbus_client_find_word (ws_gui_app->dbus_data, temp);
        }
-       //gtk_widget_hide(ws_gui_app->ws_gui_list_hbox);
-       //-----------------------------------------------
 }
 /*@}*/
diff --git a/src/gui/src/ws_gui_utils.c b/src/gui/src/ws_gui_utils.c
new file mode 100644 (file)
index 0000000..6b5945f
--- /dev/null
@@ -0,0 +1,109 @@
+/*******************************************************************************
+This file is part of mdictionary.
+
+mdictionary is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+mdictionary is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with mdictionary; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+*******************************************************************************/
+/** \addtogroup GUI
+ */
+/*@{*/
+/** \file ws_gui_utils.c
+ * \brief File with functions used in GUI.
+ *
+ * Functions used in GUI like hex conversion etc.
+ * \author Marcin Biedron \<marcin.biedron\@comarch.com\>
+ * \date 18-01-2008
+ * \version 1.0.0
+ */
+
+#include <ws_gui_callbacks.h>
+#include <ws_gui.h>
+#include <ws_gui_layout.h>
+#include <ws_gui_utils.h>
+#include <ws_dbus.h>
+
+/**
+ * Function that checks if given char is hex.
+ * \param tchar char that is being checked 
+ */
+gboolean ws_gui_is_hex ( char tchar )
+{
+       if (    (( 'a' <= tchar ) && ( tchar <= 'f')) || 
+               (( 'A' <= tchar ) && ( tchar <= 'F')) || 
+               (( '0' <= tchar ) && ( tchar <= '9')))
+       {
+               return TRUE;
+       }
+       else 
+       {
+               return FALSE;
+       }
+}
+
+/**
+ * Function that changes all hex characters into asci code.
+ * \param word word to search
+ * \param user_data user data passed to function
+ */
+void ws_gui_word_conversion( osso_rpc_t* osso_data )
+{
+       
+       /* Looking for '%' char */      
+       char* pch = strchr(osso_data->value.s, '%');
+       while ( pch != NULL )
+       {       
+               g_debug( "[L-word] -> %s: Found percentage character in string...", __FUNCTION__ );
+               /* Check if it is a hexdecimal number */
+               if ((   ( pch+1 != NULL ) && ( pch+2 != NULL ) ) && 
+                       ( ws_gui_is_hex ( pch[1] ) && ws_gui_is_hex ( pch[2] )))
+               {
+                       char convertedWord[strlen(osso_data->value.s)];
+                       char tempLetterHex[2];
+                       char tempLetterASCI;
+                       int tempLetterInteger;
+                       tempLetterHex[0] = pch[1];
+                       tempLetterHex[1] = pch[2];
+                       int sscanfReturn = 0;
+                       sscanfReturn = sscanf(tempLetterHex, "%x", &tempLetterInteger);
+                       if (sscanfReturn == 1) 
+                       {
+                               tempLetterASCI = (char)(tempLetterInteger);
+                               int actualChar = pch - osso_data->value.s;
+                               int stringLength = strlen(osso_data->value.s);
+                               int i = 0;
+                               for ( i = 0; i < stringLength; i++)
+                               {
+                                       if (i < actualChar) { convertedWord[i] = osso_data->value.s[i]; }
+                                       if (i == actualChar) { convertedWord[ i ] = tempLetterASCI; }
+                                       if (i > actualChar) { convertedWord[i] = osso_data->value.s[ i + 2 ]; }
+                               }
+                       }
+               strcpy(osso_data->value.s, convertedWord);
+               }
+               pch = strchr( pch + 1, '%' );
+       }
+       
+       /* Looking for '+' char */      
+       pch = strchr(osso_data->value.s, '+');
+       while ( pch != NULL )
+       {       
+               g_debug( "[L-word] -> %s: Found plus character in string...", __FUNCTION__ );
+               pch[0] = ' ';
+               pch = strchr( pch + 1, '+' );
+       }
+}
+
+//end of file
index 4c79198..aa1bdfb 100644 (file)
@@ -40,8 +40,6 @@ void ws_mng_progress_bar( double progress,
        ws_dbus_server_update_progressbar(data->dbus_data, progress);
 }
 
-
-
 /**
  * \param word word to search
  * \param error error messages
@@ -57,7 +55,7 @@ void ws_mng_on_search_word( GError *error,
 
        /* ---> CRITICAL SECTION for this function */
        g_static_mutex_lock( search->thread_creation );
-
+       
        /* get the word passed by dbus */
        osso_data = &g_array_index (word, osso_rpc_t, 0);
        gchar* tmp = NULL;