diff --git a/src/lib/data/indexer/IndexerCommandList.cpp b/src/lib/data/indexer/IndexerCommandList.cpp index ba2e11df..fbfe0024 100644 --- a/src/lib/data/indexer/IndexerCommandList.cpp +++ b/src/lib/data/indexer/IndexerCommandList.cpp @@ -10,14 +10,14 @@ void IndexerCommandList::addCommand(std::shared_ptr command) { std::lock_guard lock(m_commandsMutex); - std::string commandHash = command->getSourceFilePath().str() + std::to_string(command->getByteSize(1)); + std::wstring commandHash = command->getSourceFilePath().wstr() + std::to_wstring(command->getByteSize(1)); if (m_commandIndex.insert(commandHash).second == true) // Don't add duplicate indexer commands { m_commands.push_back(command); } else { - LOG_WARNING_STREAM(<< "Duplicate indexer command was ignored: " << commandHash); + LOG_WARNING(L"Duplicate indexer command was ignored: " + commandHash); } } diff --git a/src/lib/data/indexer/IndexerCommandList.h b/src/lib/data/indexer/IndexerCommandList.h index b4016b7f..a4055f30 100644 --- a/src/lib/data/indexer/IndexerCommandList.h +++ b/src/lib/data/indexer/IndexerCommandList.h @@ -24,7 +24,7 @@ private: std::deque> m_commands; std::mutex m_commandsMutex; - std::set m_commandIndex; + std::set m_commandIndex; }; #endif // INDEXER_COMMAND_LIST_H diff --git a/src/lib/data/indexer/TaskBuildIndex.cpp b/src/lib/data/indexer/TaskBuildIndex.cpp index b86e1272..6a8a5533 100644 --- a/src/lib/data/indexer/TaskBuildIndex.cpp +++ b/src/lib/data/indexer/TaskBuildIndex.cpp @@ -146,7 +146,7 @@ void TaskBuildIndex::doExit(std::shared_ptr blackboard) "conforms to the specified language standard and all necessary options are defined within your project " "setup.", path.wstr(), 1, 1, true, true )); - LOG_INFO_STREAM(<< "crashed translation unit: " << path.str()); + LOG_INFO(L"crashed translation unit: " + path.wstr()); } m_storageProvider->insert(is); } diff --git a/src/lib/data/location/SourceLocation.cpp b/src/lib/data/location/SourceLocation.cpp index 3bea1974..db0bd954 100644 --- a/src/lib/data/location/SourceLocation.cpp +++ b/src/lib/data/location/SourceLocation.cpp @@ -180,26 +180,26 @@ bool SourceLocation::isFullTextSearchMatch() const return m_type == LOCATION_FULLTEXT_SEARCH; } -std::ostream& operator<<(std::ostream& ostream, const SourceLocation& location) +std::wostream& operator<<(std::wostream& ostream, const SourceLocation& location) { if (location.isStartLocation()) { - ostream << '<'; + ostream << L'<'; } - ostream << location.getColumnNumber() << ":[ "; + ostream << location.getColumnNumber() << L":[ "; for (Id tokenId : location.getTokenIds()) { - ostream << '\b' << tokenId << ' '; + ostream << L'\b' << tokenId << L' '; } - ostream << "\b]"; + ostream << L"\b]"; if (location.isEndLocation()) { - ostream << '>'; + ostream << L'>'; } - ostream << ' '; + ostream << L' '; return ostream; } diff --git a/src/lib/data/location/SourceLocation.h b/src/lib/data/location/SourceLocation.h index 70dbaf10..71a6c904 100644 --- a/src/lib/data/location/SourceLocation.h +++ b/src/lib/data/location/SourceLocation.h @@ -61,6 +61,6 @@ private: const bool m_isStart; }; -std::ostream& operator<<(std::ostream& ostream, const SourceLocation& location); +std::wostream& operator<<(std::wostream& ostream, const SourceLocation& location); #endif // SOURCE_LOCATION_H diff --git a/src/lib/data/location/SourceLocationCollection.cpp b/src/lib/data/location/SourceLocationCollection.cpp index b224a380..44e4639c 100644 --- a/src/lib/data/location/SourceLocationCollection.cpp +++ b/src/lib/data/location/SourceLocationCollection.cpp @@ -118,9 +118,9 @@ SourceLocationFile* SourceLocationCollection::createSourceLocationFile(const Fil return filePtr.get(); } -std::ostream& operator<<(std::ostream& ostream, const SourceLocationCollection& base) +std::wostream& operator<<(std::wostream& ostream, const SourceLocationCollection& base) { - ostream << "Locations:\n"; + ostream << L"Locations:\n"; base.forEachSourceLocationFile([&ostream](std::shared_ptr f) { ostream << *(f.get()); diff --git a/src/lib/data/location/SourceLocationCollection.h b/src/lib/data/location/SourceLocationCollection.h index c96548c3..89f1129a 100644 --- a/src/lib/data/location/SourceLocationCollection.h +++ b/src/lib/data/location/SourceLocationCollection.h @@ -45,6 +45,6 @@ private: std::map> m_files; }; -std::ostream& operator<<(std::ostream& ostream, const SourceLocationCollection& base); +std::wostream& operator<<(std::wostream& ostream, const SourceLocationCollection& base); #endif // SOURCE_LOCATION_COLLECTION_H diff --git a/src/lib/data/location/SourceLocationFile.cpp b/src/lib/data/location/SourceLocationFile.cpp index 623a8cca..9e9b5e39 100644 --- a/src/lib/data/location/SourceLocationFile.cpp +++ b/src/lib/data/location/SourceLocationFile.cpp @@ -187,9 +187,9 @@ std::shared_ptr SourceLocationFile::getFilteredByType(Locati return ret; } -std::ostream& operator<<(std::ostream& ostream, const SourceLocationFile& file) +std::wostream& operator<<(std::wostream& ostream, const SourceLocationFile& file) { - ostream << "file \"" << file.getFilePath().str() << "\""; + ostream << L"file \"" << file.getFilePath().wstr() << L"\""; size_t line = 0; file.forEachSourceLocation( @@ -208,16 +208,16 @@ std::ostream& operator<<(std::ostream& ostream, const SourceLocationFile& file) line++; } - ostream << '\n' << line; + ostream << L'\n' << line; } - ostream << ": "; + ostream << L": "; } ostream << *location; } ); - ostream << '\n'; + ostream << L'\n'; return ostream; } diff --git a/src/lib/data/location/SourceLocationFile.h b/src/lib/data/location/SourceLocationFile.h index c967aa0a..38adc32a 100644 --- a/src/lib/data/location/SourceLocationFile.h +++ b/src/lib/data/location/SourceLocationFile.h @@ -63,6 +63,6 @@ private: std::map m_locationIndex; }; -std::ostream& operator<<(std::ostream& ostream, const SourceLocationFile& base); +std::wostream& operator<<(std::wostream& ostream, const SourceLocationFile& base); #endif // SOURCE_LOCATION_FILE_H diff --git a/src/lib/utility/file/FilePath.cpp b/src/lib/utility/file/FilePath.cpp index 61cfb2e4..f8f7fcb3 100644 --- a/src/lib/utility/file/FilePath.cpp +++ b/src/lib/utility/file/FilePath.cpp @@ -381,6 +381,11 @@ std::string FilePath::getBackslashedString() const return utility::replace(str(), "/", "\\"); } +std::wstring FilePath::getBackslashedWString() const +{ + return utility::replace(wstr(), L"/", L"\\"); +} + std::wstring FilePath::fileName() const { return m_path->filename().generic_wstring(); diff --git a/src/lib/utility/file/FilePath.h b/src/lib/utility/file/FilePath.h index 7c658e04..631a0557 100644 --- a/src/lib/utility/file/FilePath.h +++ b/src/lib/utility/file/FilePath.h @@ -51,6 +51,7 @@ public: std::string str() const; std::wstring wstr() const; std::string getBackslashedString() const; + std::wstring getBackslashedWString() const; std::wstring fileName() const; std::wstring extension() const; diff --git a/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.cpp b/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.cpp index 81e19d91..7d813754 100644 --- a/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.cpp @@ -20,7 +20,7 @@ CxxVerboseAstVisitor::CxxVerboseAstVisitor( std::shared_ptr canonicalFilePathCache ) : base(context, preprocessor, client, fileRegister, canonicalFilePathCache) - , m_currentFilePath("") + , m_currentFilePath(L"") , m_indentation(0) { } @@ -43,10 +43,10 @@ bool CxxVerboseAstVisitor::TraverseDecl(clang::Decl *d) ParseLocation loc = getParseLocation(d->getSourceRange()); stream << " <" << loc.startLineNumber << ":" << loc.startColumnNumber << ", " << loc.endLineNumber << ":" << loc.endColumnNumber << ">"; - if (m_currentFilePath != loc.filePath.str()) + if (m_currentFilePath != loc.filePath.wstr()) { - m_currentFilePath = loc.filePath.str(); - LOG_INFO_STREAM_BARE(<< "Indexer - Traversing \"" + m_currentFilePath + "\"" ); + m_currentFilePath = loc.filePath.wstr(); + LOG_INFO_BARE(L"Indexer - Traversing \"" + m_currentFilePath + L"\"" ); } LOG_INFO_STREAM_BARE(<< "Indexer - " << stream.str()); diff --git a/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.h b/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.h index 0b7c4925..f5e6cc55 100644 --- a/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.h +++ b/src/lib_cxx/data/parser/cxx/CxxVerboseAstVisitor.h @@ -48,7 +48,7 @@ private: return ""; } - std::string m_currentFilePath; + std::wstring m_currentFilePath; unsigned int m_indentation; }; diff --git a/src/lib_gui/platform_includes/includesWindows.h b/src/lib_gui/platform_includes/includesWindows.h index 34fedcc3..d4c1cc8a 100644 --- a/src/lib_gui/platform_includes/includesWindows.h +++ b/src/lib_gui/platform_includes/includesWindows.h @@ -35,7 +35,8 @@ void setupApp(int argc, char *argv[]) { appPath = appPath.substr(0, pos + 1); } - AppPath::setAppPath(FilePath(appPath)); + AppPath::setAppPath(FilePath(L"C:/sourcetrail/täst/Sourcetrail_2018_1_19_32bit")); + //AppPath::setAppPath(FilePath(appPath)); C:\sourcetrail\täst\Sourcetrail_2018_1_19_32bit } { diff --git a/src/lib_gui/qt/element/QtBookmark.cpp b/src/lib_gui/qt/element/QtBookmark.cpp index c6e89023..6ebd7e4d 100644 --- a/src/lib_gui/qt/element/QtBookmark.cpp +++ b/src/lib_gui/qt/element/QtBookmark.cpp @@ -55,7 +55,7 @@ QtBookmark::QtBookmark(ControllerProxy* controllerProxy) m_editButton->setToolTip("Edit bookmark"); m_editButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); m_editButton->setIconSize(QSize(20, 20)); - m_editButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_edit_icon.png").c_str())); + m_editButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_edit_icon.png").wstr()))); utility::setWidgetRetainsSpaceWhenHidden(m_editButton); m_editButton->hide(); buttonsLayout->addWidget(m_editButton); @@ -65,7 +65,7 @@ QtBookmark::QtBookmark(ControllerProxy* controllerProxy) m_deleteButton->setToolTip("Delete bookmark"); m_deleteButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); m_deleteButton->setIconSize(QSize(20, 20)); - m_deleteButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_delete_icon.png").c_str())); + m_deleteButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_delete_icon.png").wstr()))); utility::setWidgetRetainsSpaceWhenHidden(m_deleteButton); m_deleteButton->hide(); buttonsLayout->addWidget(m_deleteButton); diff --git a/src/lib_gui/qt/element/QtBookmarkCategory.cpp b/src/lib_gui/qt/element/QtBookmarkCategory.cpp index 19684159..361d0e70 100644 --- a/src/lib_gui/qt/element/QtBookmarkCategory.cpp +++ b/src/lib_gui/qt/element/QtBookmarkCategory.cpp @@ -25,7 +25,7 @@ QtBookmarkCategory::QtBookmarkCategory(ControllerProxy* cont m_expandButton->setObjectName("category_expand_button"); m_expandButton->setToolTip("Show/Hide bookmarks in this category"); m_expandButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); - m_expandButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/arrow_down.png").c_str())); + m_expandButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/arrow_down.png").wstr()))); m_expandButton->setIconSize(QSize(8, 8)); layout->addWidget(m_expandButton); @@ -42,7 +42,7 @@ QtBookmarkCategory::QtBookmarkCategory(ControllerProxy* cont m_deleteButton->setToolTip("Delete this Bookmark Category and the containing Bookmarks"); m_deleteButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); m_deleteButton->setIconSize(QSize(20, 20)); - m_deleteButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/bookmark_delete_icon.png").c_str())); + m_deleteButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/bookmark_delete_icon.png").wstr()))); utility::setWidgetRetainsSpaceWhenHidden(m_deleteButton); m_deleteButton->hide(); layout->addWidget(m_deleteButton); @@ -85,12 +85,12 @@ void QtBookmarkCategory::updateArrow() { if (m_treeItem->isExpanded()) { - QPixmap pixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/arrow_down.png").c_str()); + QPixmap pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/arrow_down.png").wstr())); m_expandButton->setIcon(QIcon(utility::colorizePixmap(pixmap, "black"))); } else { - QPixmap pixmap((ResourcePaths::getGuiPath().str() + "bookmark_view/images/arrow_right.png").c_str()); + QPixmap pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"bookmark_view/images/arrow_right.png").wstr())); m_expandButton->setIcon(QIcon(utility::colorizePixmap(pixmap, "black"))); } } diff --git a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp index 8f9de62d..326bf667 100644 --- a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp +++ b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp @@ -72,9 +72,9 @@ void QtCodeFileTitleButton::setIsComplete(bool isComplete) utility::decodeFromUtf8(ColorScheme::getInstance()->getColor("code/file/title/hatching")) + L".png" ); - setStyleSheet(( - "#title_button { background-image: url(" + hatchingFilePath.str() + "); }" - ).c_str()); + setStyleSheet(QString::fromStdWString( + L"#title_button { background-image: url(" + hatchingFilePath.wstr() + L"); }" + )); } else { diff --git a/src/lib_gui/qt/element/QtDirectoryListBox.cpp b/src/lib_gui/qt/element/QtDirectoryListBox.cpp index 045e59bf..c1352d1d 100644 --- a/src/lib_gui/qt/element/QtDirectoryListBox.cpp +++ b/src/lib_gui/qt/element/QtDirectoryListBox.cpp @@ -30,8 +30,9 @@ QtListItemWidget::QtListItemWidget(QtDirectoryListBox* list, QListWidgetItem* it m_data->setAcceptDrops(false); m_button = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/dots.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/dots_hover.png").c_str()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots_hover.png").wstr()) + ); m_button->setIconSize(QSize(16, 16)); m_button->setObjectName("dotsButton"); @@ -152,16 +153,18 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, const QString& listName, innerLayout->setSpacing(0); m_addButton = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/plus.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/plus_hover.png").c_str()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/plus.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/plus_hover.png").wstr()) + ); m_addButton->setIconSize(QSize(16, 16)); m_addButton->setObjectName("plusButton"); m_addButton->setToolTip("add line"); innerLayout->addWidget(m_addButton); m_removeButton = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/minus.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/minus_hover.png").c_str()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/minus.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/minus_hover.png").wstr()) + ); m_removeButton->setIconSize(QSize(16, 16)); m_removeButton->setObjectName("minusButton"); m_removeButton->setToolTip("remove line"); @@ -176,8 +179,9 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent, const QString& listName, innerLayout->addWidget(dropInfoText); QPushButton* editButton = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "code_view/images/edit.png").c_str(), - QString()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"code_view/images/edit.png").wstr()), + QString() + ); editButton->setIconSize(QSize(16, 16)); editButton->setObjectName("editButton"); editButton->setToolTip("edit plain text"); diff --git a/src/lib_gui/qt/element/QtLocationPicker.cpp b/src/lib_gui/qt/element/QtLocationPicker.cpp index 8b8afa96..59ec05fb 100644 --- a/src/lib_gui/qt/element/QtLocationPicker.cpp +++ b/src/lib_gui/qt/element/QtLocationPicker.cpp @@ -28,8 +28,9 @@ QtLocationPicker::QtLocationPicker(QWidget *parent) layout->addWidget(m_data); m_button = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/dots.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/dots_hover.png").c_str()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/dots_hover.png").wstr()) + ); m_button->setIconSize(QSize(16, 16)); m_button->setObjectName("dotsButton"); m_button->setToolTip("pick file"); @@ -123,7 +124,7 @@ void QtLocationPicker::handleButtonPress() const FilePath relPath = path.getRelativeTo(m_relativeRootDirectory); if (relPath.str().size() < path.str().size()) { - fileName = QString::fromStdString(relPath.str()); + fileName = QString::fromStdWString(relPath.wstr()); } } diff --git a/src/lib_gui/qt/utility/QtContextMenu.cpp b/src/lib_gui/qt/utility/QtContextMenu.cpp index 41125615..7e63128d 100644 --- a/src/lib_gui/qt/utility/QtContextMenu.cpp +++ b/src/lib_gui/qt/utility/QtContextMenu.cpp @@ -113,8 +113,8 @@ void QtContextMenu::redoActionTriggered() void QtContextMenu::copyFullPathActionTriggered() { - const std::string pathString = (QSysInfo::windowsVersion() != QSysInfo::WV_None) ? s_filePath.getBackslashedString() : s_filePath.str(); - QApplication::clipboard()->setText(pathString.c_str()); + const std::wstring pathString = (QSysInfo::windowsVersion() != QSysInfo::WV_None) ? s_filePath.getBackslashedWString() : s_filePath.wstr(); + QApplication::clipboard()->setText(QString::fromStdWString(pathString)); } void QtContextMenu::openContainingFolderActionTriggered() @@ -122,11 +122,11 @@ void QtContextMenu::openContainingFolderActionTriggered() FilePath dir = s_filePath.getParentDirectory(); if (dir.exists()) { - QDesktopServices::openUrl(QUrl(("file:///" + dir.str()).c_str(), QUrl::TolerantMode)); + QDesktopServices::openUrl(QUrl(QString::fromStdWString(L"file:///" + dir.wstr()), QUrl::TolerantMode)); } else { - LOG_ERROR("Unable to open directory: " + dir.str()); + LOG_ERROR(L"Unable to open directory: " + dir.wstr()); } } diff --git a/src/lib_gui/qt/utility/QtFileDialog.cpp b/src/lib_gui/qt/utility/QtFileDialog.cpp index 1aa9f53d..fcb751ff 100644 --- a/src/lib_gui/qt/utility/QtFileDialog.cpp +++ b/src/lib_gui/qt/utility/QtFileDialog.cpp @@ -10,7 +10,7 @@ QStringList QtFileDialog::getFileNamesAndDirectories(QWidget* parent, const FilePath& path) { - const QString dir = getDir(QString::fromStdString((path.isDirectory() ? path : path.getParentDirectory()).str())); + const QString dir = getDir(QString::fromStdWString((path.isDirectory() ? path : path.getParentDirectory()).wstr())); QFileDialog* dialog = (utility::getOsType() == OS_MAC ? new QFileDialog(parent) : new QtFilesAndDirectoriesDialog(parent)); @@ -43,12 +43,12 @@ QStringList QtFileDialog::getFileNamesAndDirectories(QWidget* parent, const File QString QtFileDialog::getExistingDirectory(QWidget* parent, const QString& caption, const FilePath& dir) { - return QFileDialog::getExistingDirectory(parent, caption, getDir(QString::fromStdString(dir.str()))); + return QFileDialog::getExistingDirectory(parent, caption, getDir(QString::fromStdWString(dir.wstr()))); } QString QtFileDialog::getOpenFileName(QWidget* parent, const QString& caption, const FilePath& dir, const QString& filter) { - return QFileDialog::getOpenFileName(parent, caption, getDir(QString::fromStdString(dir.str())), filter); + return QFileDialog::getOpenFileName(parent, caption, getDir(QString::fromStdWString(dir.wstr())), filter); } QString QtFileDialog::showSaveFileDialog( @@ -56,10 +56,10 @@ QString QtFileDialog::showSaveFileDialog( { #if defined(Q_OS_WIN) || defined(Q_OS_MAC) - return QFileDialog::getSaveFileName(parent, title, getDir(QString::fromStdString(directory.str())), filter); + return QFileDialog::getSaveFileName(parent, title, getDir(QString::fromStdWString(directory.wstr())), filter); #else - QFileDialog dialog(parent, title, getDir(QString::fromStdString(directory.str())), filter); + QFileDialog dialog(parent, title, getDir(QString::fromStdWString(directory.wstr())), filter); if (parent) { diff --git a/src/lib_gui/qt/utility/utilityQt.cpp b/src/lib_gui/qt/utility/utilityQt.cpp index 7988e2fe..97bead41 100644 --- a/src/lib_gui/qt/utility/utilityQt.cpp +++ b/src/lib_gui/qt/utility/utilityQt.cpp @@ -47,7 +47,7 @@ namespace utility for (const FilePath& fontFilePath: fontFilePaths) { - QFile file(fontFilePath.str().c_str()); + QFile file(QString::fromStdWString(fontFilePath.wstr())); if (file.open(QIODevice::ReadOnly)) { int id = QFontDatabase::addApplicationFontFromData(file.readAll()); @@ -62,7 +62,7 @@ namespace utility { for (QString& family: QFontDatabase::applicationFontFamilies(loadedFontId)) { - LOG_INFO("Loaded FontFamily: " + family.toStdString()); + LOG_INFO(L"Loaded FontFamily: " + family.toStdWString()); } } } @@ -86,7 +86,7 @@ namespace utility std::deque seq = utility::split(css.substr(posA + 1, posB - posA - 1), ':'); if (seq.size() != 2) { - LOG_ERROR("Syntax error in file: " + path.str()); + LOG_ERROR(L"Syntax error in file: " + path.wstr()); return ""; } @@ -161,7 +161,7 @@ namespace utility } else { - LOG_ERROR("Syntax error in file: " + path.str()); + LOG_ERROR(L"Syntax error in file: " + path.wstr()); return ""; } } @@ -174,7 +174,7 @@ namespace utility std::vector values = utility::splitToVector(val, '|'); if (values.size() != 3) { - LOG_ERROR("Syntax error in file: " + path.str()); + LOG_ERROR(L"Syntax error in file: " + path.wstr()); return ""; } @@ -188,7 +188,7 @@ namespace utility } else { - LOG_ERROR("Syntax error in file: " + path.str()); + LOG_ERROR(L"Syntax error in file: " + path.wstr()); return ""; } diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index 589c5ef7..f375dd28 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -36,7 +36,7 @@ void QtRecentProjectButton::setProjectPath(const FilePath& projectFilePath) this->setText(QString::fromStdWString(m_projectFilePath.withoutExtension().fileName())); if (m_projectExists) { - this->setToolTip(m_projectFilePath.str().c_str()); + this->setToolTip(QString::fromStdWString(m_projectFilePath.wstr())); } else {