Ignore:
Timestamp:
Sep 29, 2010 11:02:24 AM (3 years ago)
Author:
laurent, Dmitriy.Trt
Branch:
default
Message:

utf8 support

File:
1 edited

Legend:

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

    r645 r666  
    5858        frame->setScrollBarPolicy(Qt::Horizontal,Qt::ScrollBarAlwaysOff); 
    5959 
    60         QString path = QString::fromStdString(config.getResourcesDir()) + "pics/avatars/default-avatar.png"; 
     60        QString path = QString::fromUtf8(config.getResourcesDir().c_str()) + "pics/avatars/default-avatar.png"; 
    6161#if defined(OS_WINDOWS) 
    6262        path = path.replace("\\","/"); 
     
    9191         
    9292        page()->mainFrame()->addToJavaScriptWindowObject("parent",this); 
    93         QFile file_base(QString::fromStdString(config.getResourcesDir())+"chat/base.html"); 
     93        QFile file_base(QString::fromUtf8(config.getResourcesDir().c_str())+"chat/base.html"); 
    9494        file_base.open(QIODevice::ReadOnly); 
    9595         
     
    109109 
    110110        QString filePath = QFileDialog::getSaveFileName(this, tr("Save As"),  
    111                 QString::fromStdString(config.getLastChatHistorySaveDir()), "HTML (*.htm *.html)"); 
     111                QString::fromUtf8(config.getLastChatHistorySaveDir().c_str()), "HTML (*.htm *.html)"); 
    112112 
    113113        if(filePath.length() > 0) { 
     
    120120 
    121121                QFile fileToSave(filePath); 
    122                 config.set(Config::LAST_CHAT_HISTORY_SAVE_DIR_KEY, QFileInfo(fileToSave).absolutePath().toStdString()); 
     122                config.set(Config::LAST_CHAT_HISTORY_SAVE_DIR_KEY, std::string(QFileInfo(fileToSave).absolutePath().toUtf8())); 
    123123                fileToSave.open(QIODevice::WriteOnly); 
    124                 fileToSave.write(contentToSave.toStdString().c_str(), (long long)contentToSave.length()); 
     124                fileToSave.write(contentToSave.toUtf8().data(), (long long)contentToSave.length()); 
    125125                fileToSave.close(); 
    126126        } 
     
    133133                url = url.remove(_theme->getCurrentThemePath()); 
    134134 
    135         WebBrowser::openUrl(url.toStdString()); 
     135        WebBrowser::openUrl(std::string(url.toUtf8())); 
    136136} 
    137137 
     
    146146                 
    147147                Config & config = ConfigManager::getInstance().getCurrentConfig(); 
    148                 QString lang = QString::fromStdString(config.getTranslationReceived()); 
     148                QString lang = QString::fromUtf8(config.getTranslationReceived().c_str()); 
    149149                QString script = QString("translate(\"%1\",\"%2\",\"%3\",\"%4\",\"%5\")").arg(contactId).arg(senderName).arg(text).arg(time.toString()).arg(lang); 
    150150                page ()->currentFrame ()->evaluateJavaScript(script); 
     
    270270void QtChatHistoryWidget::setAvatarPixmap(const QString& name, const QPixmap& pixmap)  
    271271{ 
    272         QDir dir(QString::fromStdString(Config::getConfigDir())); 
     272        QDir dir(QString::fromUtf8(Config::getConfigDir().c_str())); 
    273273         
    274274        if(!dir.exists("cache")) 
Note: See TracChangeset for help on using the changeset viewer.