Changeset 666:2852829a2283 in qutecom-2.2 for qutecom/src/presentation/qt/chat/QtChatHistoryWidget.cpp
Legend:
- Unmodified
- Added
- Removed
-
qutecom/src/presentation/qt/chat/QtChatHistoryWidget.cpp
r645 r666 58 58 frame->setScrollBarPolicy(Qt::Horizontal,Qt::ScrollBarAlwaysOff); 59 59 60 QString path = QString::from StdString(config.getResourcesDir()) + "pics/avatars/default-avatar.png";60 QString path = QString::fromUtf8(config.getResourcesDir().c_str()) + "pics/avatars/default-avatar.png"; 61 61 #if defined(OS_WINDOWS) 62 62 path = path.replace("\\","/"); … … 91 91 92 92 page()->mainFrame()->addToJavaScriptWindowObject("parent",this); 93 QFile file_base(QString::from StdString(config.getResourcesDir())+"chat/base.html");93 QFile file_base(QString::fromUtf8(config.getResourcesDir().c_str())+"chat/base.html"); 94 94 file_base.open(QIODevice::ReadOnly); 95 95 … … 109 109 110 110 QString filePath = QFileDialog::getSaveFileName(this, tr("Save As"), 111 QString::from StdString(config.getLastChatHistorySaveDir()), "HTML (*.htm *.html)");111 QString::fromUtf8(config.getLastChatHistorySaveDir().c_str()), "HTML (*.htm *.html)"); 112 112 113 113 if(filePath.length() > 0) { … … 120 120 121 121 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())); 123 123 fileToSave.open(QIODevice::WriteOnly); 124 fileToSave.write(contentToSave.to StdString().c_str(), (long long)contentToSave.length());124 fileToSave.write(contentToSave.toUtf8().data(), (long long)contentToSave.length()); 125 125 fileToSave.close(); 126 126 } … … 133 133 url = url.remove(_theme->getCurrentThemePath()); 134 134 135 WebBrowser::openUrl( url.toStdString());135 WebBrowser::openUrl(std::string(url.toUtf8())); 136 136 } 137 137 … … 146 146 147 147 Config & config = ConfigManager::getInstance().getCurrentConfig(); 148 QString lang = QString::from StdString(config.getTranslationReceived());148 QString lang = QString::fromUtf8(config.getTranslationReceived().c_str()); 149 149 QString script = QString("translate(\"%1\",\"%2\",\"%3\",\"%4\",\"%5\")").arg(contactId).arg(senderName).arg(text).arg(time.toString()).arg(lang); 150 150 page ()->currentFrame ()->evaluateJavaScript(script); … … 270 270 void QtChatHistoryWidget::setAvatarPixmap(const QString& name, const QPixmap& pixmap) 271 271 { 272 QDir dir(QString::from StdString(Config::getConfigDir()));272 QDir dir(QString::fromUtf8(Config::getConfigDir().c_str())); 273 273 274 274 if(!dir.exists("cache"))
Note: See TracChangeset
for help on using the changeset viewer.
