Ignore:
Timestamp:
Oct 16, 2010 12:20:08 PM (3 years ago)
Author:
laurent@…
Branch:
default
Message:

bug fix : "\n" in chat message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qutecom/src/presentation/qt/chat/QtChatHistoryWidget.cpp

    r666 r674  
    142142        { 
    143143                QString text = message; 
    144                 text = text.replace("\"","\\\""); 
    145                 text = text.replace("\'","\\\'"); 
     144                text = text.replace('\"',"\\\""); 
     145                text = text.replace('\'',"\\\'"); 
    146146                 
    147147                Config & config = ConfigManager::getInstance().getCurrentConfig(); 
     
    169169                { 
    170170                        QString footer =  _theme->getFooter(); 
    171                         footer = footer.replace("\n",""); 
    172                         footer = footer.replace("\r",""); 
    173                         footer = footer.replace("\t",""); 
    174                         footer = footer.replace("\"","\\\""); 
    175                         footer = footer.replace("\'","\\\'"); 
     171                        footer = footer.replace('\n',""); 
     172                        footer = footer.replace('\r',""); 
     173                        footer = footer.replace('\t',""); 
     174                        footer = footer.replace('\"',"\\\""); 
     175                        footer = footer.replace('\'',"\\\'"); 
    176176                        page ()->currentFrame ()->evaluateJavaScript("insertMessage(\"\")"); 
    177177                        page ()->currentFrame ()->evaluateJavaScript("insertMessage(\""+footer+"\")"); 
     
    211211        //updateHtml(); 
    212212 
    213         html = html.replace("\n",""); 
    214         html = html.replace("\r",""); 
    215         html = html.replace("\t",""); 
    216         html = html.replace("\"","\\\""); 
    217         html = html.replace("\'","\\\'"); 
     213        html = html.replace('\n',""); 
     214        html = html.replace('\r',""); 
     215        html = html.replace('\t',""); 
     216        html = html.replace('\"',"\\\""); 
     217        html = html.replace('\'',"\\\'"); 
    218218         
    219219        if(position == QtChatTheme::First) 
     
    256256        QtChatTheme::setKeywordValue(html, "time", time.toString("HH:mm")); 
    257257         
    258         html = html.replace("\n",""); 
    259         html = html.replace("\r",""); 
    260         html = html.replace("\t",""); 
    261         html = html.replace("\"","\\\""); 
    262         html = html.replace("\'","\\\'"); 
     258        html = html.replace('\n',""); 
     259        html = html.replace('\r',""); 
     260        html = html.replace('\t',""); 
     261        html = html.replace('\"',"\\\""); 
     262        html = html.replace('\'',"\\\'"); 
    263263        page ()->currentFrame ()->evaluateJavaScript("insertMessage(\"\")"); 
    264264        page ()->currentFrame ()->evaluateJavaScript("insertMessage(\""+html+"\")"); 
Note: See TracChangeset for help on using the changeset viewer.