diff --git a/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp b/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp index fbb9a3bc..5d917364 100644 --- a/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp +++ b/src/lib/data/indexer/interprocess/shared_types/SharedIndexerCommand.cpp @@ -44,9 +44,10 @@ void SharedIndexerCommand::fromLocal(IndexerCommand* indexerCommand) } else { - LOG_ERROR_STREAM(<< "Trying to push unhandled type of IndexerCommand for file: " - << indexerCommand->getSourceFilePath().str() << ". Type string is: " << indexerCommandTypeToString(indexerCommand->getIndexerCommandType()) - << ". It will be ignored."); + LOG_ERROR(L"Trying to push unhandled type of IndexerCommand for file: " + + indexerCommand->getSourceFilePath().wstr() + L". Type string is: " + + utility::decodeFromUtf8(indexerCommandTypeToString(indexerCommand->getIndexerCommandType())) + + L". It will be ignored."); } } @@ -91,8 +92,8 @@ std::shared_ptr SharedIndexerCommand::fromShared(const SharedInd } else { - LOG_ERROR_STREAM(<< "Cannot convert shared IndexerCommand for file: " - << indexerCommand.getSourceFilePath().str() << ". The type is unknown."); + LOG_ERROR(L"Cannot convert shared IndexerCommand for file: " + + indexerCommand.getSourceFilePath().wstr() + L". The type is unknown."); } return nullptr; diff --git a/src/lib/data/location/SourceLocationCollection.cpp b/src/lib/data/location/SourceLocationCollection.cpp index 80ecf05e..b224a380 100644 --- a/src/lib/data/location/SourceLocationCollection.cpp +++ b/src/lib/data/location/SourceLocationCollection.cpp @@ -63,9 +63,9 @@ SourceLocation* SourceLocationCollection::addSourceLocation( { if (startLineNumber > endLineNumber || (startLineNumber == endLineNumber && startColumnNumber > endColumnNumber)) { - LOG_ERROR_STREAM(<< "SourceLocation has wrong boundaries: " << filePath.str() << " " - << startLineNumber << ":" << startColumnNumber << " " - << endLineNumber << ":" << endColumnNumber); + LOG_ERROR(L"SourceLocation has wrong boundaries: " + filePath.wstr() + L" " + + std::to_wstring(startLineNumber) + L":" + std::to_wstring(startColumnNumber) + L" " + + std::to_wstring(endLineNumber) + L":" + std::to_wstring(endColumnNumber)); return nullptr; } diff --git a/src/lib/settings/Settings.cpp b/src/lib/settings/Settings.cpp index 92b72ddf..71b53be0 100644 --- a/src/lib/settings/Settings.cpp +++ b/src/lib/settings/Settings.cpp @@ -37,7 +37,7 @@ bool Settings::load(const FilePath& filePath) { clear(); m_filePath = filePath; - LOG_WARNING("File for Settings not found: " + filePath.str()); + LOG_WARNING(L"File for Settings not found: " + filePath.wstr()); return false; } } @@ -50,7 +50,7 @@ void Settings::save() } else { - LOG_WARNING("Settings were not saved: " + m_filePath.str()); + LOG_WARNING(L"Settings were not saved: " + m_filePath.wstr()); } } diff --git a/src/lib/utility/text/TextAccess.cpp b/src/lib/utility/text/TextAccess.cpp index b98cea71..330bf376 100644 --- a/src/lib/utility/text/TextAccess.cpp +++ b/src/lib/utility/text/TextAccess.cpp @@ -86,7 +86,7 @@ std::vector TextAccess::readFile(const FilePath& filePath) if (srcFile.fail()) { - LOG_ERROR("Could not open file " + filePath.str()); + LOG_ERROR(L"Could not open file " + filePath.wstr()); return result; } diff --git a/src/lib_gui/qt/element/QtCodeFileTitleBar.cpp b/src/lib_gui/qt/element/QtCodeFileTitleBar.cpp index 761e86af..6dbbeae2 100644 --- a/src/lib_gui/qt/element/QtCodeFileTitleBar.cpp +++ b/src/lib_gui/qt/element/QtCodeFileTitleBar.cpp @@ -41,25 +41,25 @@ QtCodeFileTitleBar::QtCodeFileTitleBar(QWidget* parent, bool isHovering, bool is titleLayout->addStretch(3); - std::string imageDir = ResourcePaths::getGuiPath().str() + "code_view/images/"; + FilePath imageDir = ResourcePaths::getGuiPath().concatenate(L"code_view/images/"); QColor inactiveColor(0x5E, 0x5D, 0x5D); m_minimizeButton = new QtIconStateButton(this); - m_minimizeButton->addState(QtIconStateButton::STATE_DEFAULT, (imageDir + "minimize_active.png").c_str()); - m_minimizeButton->addState(QtIconStateButton::STATE_HOVERED, (imageDir + "minimize_inactive.png").c_str(), inactiveColor); - m_minimizeButton->addState(QtIconStateButton::STATE_DISABLED, (imageDir + "minimize_inactive.png").c_str()); + m_minimizeButton->addState(QtIconStateButton::STATE_DEFAULT, (QString::fromStdWString(imageDir.getConcatenated(L"minimize_active.png").wstr()))); + m_minimizeButton->addState(QtIconStateButton::STATE_HOVERED, (QString::fromStdWString(imageDir.getConcatenated(L"minimize_inactive.png").wstr())), inactiveColor); + m_minimizeButton->addState(QtIconStateButton::STATE_DISABLED, (QString::fromStdWString(imageDir.getConcatenated(L"minimize_inactive.png").wstr()))); m_minimizeButton->setToolTip("minimize"); m_snippetButton = new QtIconStateButton(this); - m_snippetButton->addState(QtIconStateButton::STATE_DEFAULT, (imageDir + "snippet_active.png").c_str()); - m_snippetButton->addState(QtIconStateButton::STATE_HOVERED, (imageDir + "snippet_inactive.png").c_str(), inactiveColor); - m_snippetButton->addState(QtIconStateButton::STATE_DISABLED, (imageDir + "snippet_inactive.png").c_str()); + m_snippetButton->addState(QtIconStateButton::STATE_DEFAULT, (QString::fromStdWString(imageDir.getConcatenated(L"snippet_active.png").wstr()))); + m_snippetButton->addState(QtIconStateButton::STATE_HOVERED, (QString::fromStdWString(imageDir.getConcatenated(L"snippet_inactive.png").wstr())), inactiveColor); + m_snippetButton->addState(QtIconStateButton::STATE_DISABLED, (QString::fromStdWString(imageDir.getConcatenated(L"snippet_inactive.png").wstr()))); m_snippetButton->setToolTip("show snippets"); m_maximizeButton = new QtIconStateButton(this); - m_maximizeButton->addState(QtIconStateButton::STATE_DEFAULT, (imageDir + "maximize_active.png").c_str()); - m_maximizeButton->addState(QtIconStateButton::STATE_HOVERED, (imageDir + "maximize_inactive.png").c_str(), inactiveColor); - m_maximizeButton->addState(QtIconStateButton::STATE_DISABLED, (imageDir + "maximize_inactive.png").c_str()); + m_maximizeButton->addState(QtIconStateButton::STATE_DEFAULT, (QString::fromStdWString(imageDir.getConcatenated(L"maximize_active.png").wstr()))); + m_maximizeButton->addState(QtIconStateButton::STATE_HOVERED, (QString::fromStdWString(imageDir.getConcatenated(L"maximize_inactive.png").wstr())), inactiveColor); + m_maximizeButton->addState(QtIconStateButton::STATE_DISABLED, (QString::fromStdWString(imageDir.getConcatenated(L"maximize_inactive.png").wstr()))); m_maximizeButton->setToolTip("maximize"); for (QtIconStateButton* button : { m_minimizeButton, m_snippetButton, m_maximizeButton }) diff --git a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp index 29701a08..f8bb1dfd 100644 --- a/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp +++ b/src/lib_gui/qt/element/QtCodeFileTitleButton.cpp @@ -38,9 +38,9 @@ void QtCodeFileTitleButton::setFilePath(const FilePath& filePath) if (m_filePath.empty()) { - std::string text = ResourcePaths::getGuiPath().str() + "code_view/images/file.png"; + FilePath iconPath = ResourcePaths::getGuiPath().concatenate(L"code_view/images/file.png"); setIcon(utility::colorizePixmap( - QPixmap(text.c_str()), + QPixmap(QString::fromStdWString(iconPath.wstr())), ColorScheme::getInstance()->getColor("code/file/title/icon").c_str() )); } diff --git a/src/lib_gui/qt/element/QtHelpButton.cpp b/src/lib_gui/qt/element/QtHelpButton.cpp index 7d8ff3d4..50b34006 100644 --- a/src/lib_gui/qt/element/QtHelpButton.cpp +++ b/src/lib_gui/qt/element/QtHelpButton.cpp @@ -6,8 +6,8 @@ QtHelpButton::QtHelpButton(const QString& helpTitle, const QString& helpText, QWidget* parent) : QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/help.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/help_hover.png").c_str(), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/help.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/help_hover.png").wstr()), parent) , m_helpTitle(helpTitle) , m_helpText(helpText) diff --git a/src/lib_gui/qt/element/QtHistoryList.cpp b/src/lib_gui/qt/element/QtHistoryList.cpp index 347889bf..f43c35ad 100644 --- a/src/lib_gui/qt/element/QtHistoryList.cpp +++ b/src/lib_gui/qt/element/QtHistoryList.cpp @@ -59,7 +59,7 @@ QtHistoryItem::QtHistoryItem(const SearchMatch& match, size_t index, bool isCurr if (isCurrent) { - QtDeviceScaledPixmap pixmap(QString::fromStdString(ResourcePaths::getGuiPath().str() + "history_list/images/arrow.png")); + QtDeviceScaledPixmap pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"history_list/images/arrow.png").wstr())); pixmap.scaleToHeight(size.height() / 3); QLabel* arrow = new QLabel(this); diff --git a/src/lib_gui/qt/element/QtProgressBar.cpp b/src/lib_gui/qt/element/QtProgressBar.cpp index c84e8842..ebd21175 100644 --- a/src/lib_gui/qt/element/QtProgressBar.cpp +++ b/src/lib_gui/qt/element/QtProgressBar.cpp @@ -11,7 +11,7 @@ QtProgressBar::QtProgressBar(QWidget* parent) : QWidget(parent) , m_percent(0) , m_count(0) - , m_pixmap((ResourcePaths::getGuiPath().str() + "indexing_dialog/progress_bar_element.png").c_str()) + , m_pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"indexing_dialog/progress_bar_element.png").wstr())) { m_timer = new QTimer(this); connect(m_timer, &QTimer::timeout, this, &QtProgressBar::animate); diff --git a/src/lib_gui/qt/element/QtStatusBar.cpp b/src/lib_gui/qt/element/QtStatusBar.cpp index 0c794068..ad4afeb4 100644 --- a/src/lib_gui/qt/element/QtStatusBar.cpp +++ b/src/lib_gui/qt/element/QtStatusBar.cpp @@ -40,7 +40,7 @@ QtStatusBar::QtStatusBar() m_errorButton.setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac m_errorButton.setStyleSheet("QPushButton { color: #D00000; margin-right: 0; spacing: none; }"); m_errorButton.setIcon(utility::colorizePixmap( - QPixmap((ResourcePaths::getGuiPath().str() + "statusbar_view/dot.png").c_str()), + QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"statusbar_view/dot.png").wstr())), // "#D00000" QColor(0xD0, 0, 0) ).scaledToHeight(12)); diff --git a/src/lib_gui/qt/view/QtErrorView.cpp b/src/lib_gui/qt/view/QtErrorView.cpp index 47f4b992..ebaf22b0 100644 --- a/src/lib_gui/qt/view/QtErrorView.cpp +++ b/src/lib_gui/qt/view/QtErrorView.cpp @@ -57,7 +57,7 @@ QtErrorView::QtErrorView(ViewLayout* viewLayout) : ErrorView(viewLayout) , m_ignoreRowSelection(false) { - s_errorIcon = QIcon(QString((ResourcePaths::getGuiPath().str() + "/indexing_dialog/error.png").c_str())); + s_errorIcon = QIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"indexing_dialog/error.png").wstr())); } QtErrorView::~QtErrorView() @@ -182,7 +182,7 @@ void QtErrorView::initView() checkboxes->addWidget(editButton); editButton->setToolTip("edit project"); - editButton->setIcon(QPixmap((ResourcePaths::getGuiPath().str() + "code_view/images/edit.png").c_str())); + editButton->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"code_view/images/edit.png").wstr()))); } checkboxes->addSpacing(10); diff --git a/src/lib_gui/qt/view/graphElements/QtGraphNode.cpp b/src/lib_gui/qt/view/graphElements/QtGraphNode.cpp index 4bb5db1e..021732dd 100644 --- a/src/lib_gui/qt/view/graphElements/QtGraphNode.cpp +++ b/src/lib_gui/qt/view/graphElements/QtGraphNode.cpp @@ -510,7 +510,7 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style) if (style.hasHatching) { - QtDeviceScaledPixmap pattern((ResourcePaths::getGuiPath().str() + "graph_view/images/pattern.png").c_str()); + QtDeviceScaledPixmap pattern(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"graph_view/images/pattern.png").wstr())); pattern.scaleToHeight(12); QPixmap pixmap = utility::colorizePixmap(pattern.pixmap(), style.color.hatching.c_str()); @@ -525,7 +525,7 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style) if (!m_icon && !style.iconPath.empty()) { - QtDeviceScaledPixmap pixmap(QString::fromStdString(style.iconPath.str())); + QtDeviceScaledPixmap pixmap(QString::fromStdWString(style.iconPath.wstr())); pixmap.scaleToHeight(style.iconSize); m_icon = new QGraphicsPixmapItem(utility::colorizePixmap(pixmap.pixmap(), style.color.icon.c_str()), this); diff --git a/src/lib_gui/qt/view/graphElements/QtGraphNodeExpandToggle.cpp b/src/lib_gui/qt/view/graphElements/QtGraphNodeExpandToggle.cpp index ad944fee..fe7504b8 100644 --- a/src/lib_gui/qt/view/graphElements/QtGraphNodeExpandToggle.cpp +++ b/src/lib_gui/qt/view/graphElements/QtGraphNodeExpandToggle.cpp @@ -25,7 +25,7 @@ QtGraphNodeExpandToggle::QtGraphNodeExpandToggle(bool expanded, int invisibleSub m_icon->setTransformationMode(Qt::SmoothTransformation); m_icon->setShapeMode(QGraphicsPixmapItem::BoundingRectShape); - QtDeviceScaledPixmap pixmap((ResourcePaths::getGuiPath().str() + "graph_view/images/arrow.png").c_str()); + QtDeviceScaledPixmap pixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"graph_view/images/arrow.png").wstr())); pixmap.scaleToHeight(iconHeight); if (invisibleSubNodeCount) diff --git a/src/lib_gui/qt/window/QtAbout.cpp b/src/lib_gui/qt/window/QtAbout.cpp index 283bd3fd..b045ae41 100644 --- a/src/lib_gui/qt/window/QtAbout.cpp +++ b/src/lib_gui/qt/window/QtAbout.cpp @@ -126,14 +126,14 @@ void QtAbout::setupAbout() QHBoxLayout* rowAcknowledgementsLogos = new QHBoxLayout(); column->addLayout(rowAcknowledgementsLogos); - QtDeviceScaledPixmap fhsLogo((ResourcePaths::getGuiPath().str() + "about/logo_fhs.png").c_str()); + QtDeviceScaledPixmap fhsLogo(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"about/logo_fhs.png").wstr())); fhsLogo.scaleToHeight(30); QLabel* fhsLabel = new QLabel(this); fhsLabel->setPixmap(fhsLogo.pixmap()); fhsLabel->resize(fhsLogo.width(), fhsLogo.height()); rowAcknowledgementsLogos->addWidget(fhsLabel); - QtDeviceScaledPixmap awsLogo((ResourcePaths::getGuiPath().str() + "about/logo_aws.png").c_str()); + QtDeviceScaledPixmap awsLogo(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"about/logo_aws.png").wstr())); awsLogo.scaleToHeight(30); QLabel* awsLabel = new QLabel(this); awsLabel->setPixmap(awsLogo.pixmap()); diff --git a/src/lib_gui/qt/window/QtIndexingDialog.cpp b/src/lib_gui/qt/window/QtIndexingDialog.cpp index a3fbe946..a46e8fb2 100644 --- a/src/lib_gui/qt/window/QtIndexingDialog.cpp +++ b/src/lib_gui/qt/window/QtIndexingDialog.cpp @@ -476,8 +476,7 @@ void QtIndexingDialog::addErrorWidget(QBoxLayout* layout) errorCount->setObjectName("errorCount"); errorCount->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac - std::string text = ResourcePaths::getGuiPath().str() + "indexing_dialog/error.png"; - errorCount->setIcon(QPixmap(text.c_str())); + errorCount->setIcon(QPixmap(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"indexing_dialog/error.png").wstr()))); errorLayout->addWidget(errorCount); QtHelpButton* helpButton = new QtHelpButton("aaa", "bbb"); @@ -519,7 +518,7 @@ void QtIndexingDialog::addButtons(QBoxLayout* layout) void QtIndexingDialog::addFlag() { - QtDeviceScaledPixmap flag((ResourcePaths::getGuiPath().str() + "indexing_dialog/flag.png").c_str()); + QtDeviceScaledPixmap flag(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"indexing_dialog/flag.png").wstr())); flag.scaleToWidth(120); QLabel* flagLabel = new QLabel(this); diff --git a/src/lib_gui/qt/window/QtMainWindow.cpp b/src/lib_gui/qt/window/QtMainWindow.cpp index 5d1db5be..eb8d3b95 100644 --- a/src/lib_gui/qt/window/QtMainWindow.cpp +++ b/src/lib_gui/qt/window/QtMainWindow.cpp @@ -108,7 +108,7 @@ QtMainWindow::QtMainWindow() setCentralWidget(nullptr); setDockNestingEnabled(true); - setWindowIcon(QIcon((ResourcePaths::getGuiPath().str() + "icon/logo_1024_1024.png").c_str())); + setWindowIcon(QIcon(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/logo_1024_1024.png").wstr()))); setWindowFlags(Qt::Widget); QApplication* app = dynamic_cast(QCoreApplication::instance()); @@ -220,7 +220,7 @@ View* QtMainWindow::findFloatingView(const std::string& name) const void QtMainWindow::loadLayout() { - QSettings settings(UserPaths::getWindowSettingsPath().str().c_str(), QSettings::IniFormat); + QSettings settings(QString::fromStdWString(UserPaths::getWindowSettingsPath().wstr()), QSettings::IniFormat); settings.beginGroup("MainWindow"); resize(settings.value("size", QSize(600, 400)).toSize()); @@ -236,7 +236,7 @@ void QtMainWindow::loadLayout() void QtMainWindow::loadDockWidgetLayout() { - QSettings settings(UserPaths::getWindowSettingsPath().str().c_str(), QSettings::IniFormat); + QSettings settings(QString::fromStdWString(UserPaths::getWindowSettingsPath().wstr()), QSettings::IniFormat); this->restoreState(settings.value("DOCK_LOCATIONS").toByteArray()); for (DockWidget dock : m_dockWidgets) @@ -293,7 +293,7 @@ void QtMainWindow::loadWindow(bool showStartWindow) void QtMainWindow::saveLayout() { - QSettings settings(UserPaths::getWindowSettingsPath().str().c_str(), QSettings::IniFormat); + QSettings settings(QString::fromStdWString(UserPaths::getWindowSettingsPath().wstr()), QSettings::IniFormat); settings.beginGroup("MainWindow"); settings.setValue("maximized", isMaximized()); @@ -531,12 +531,12 @@ void QtMainWindow::enteredLicense() void QtMainWindow::showDataFolder() { - QDesktopServices::openUrl(QUrl(("file:///" + UserPaths::getUserDataPath().makeCanonical().str()).c_str(), QUrl::TolerantMode)); + QDesktopServices::openUrl(QUrl(QString::fromStdWString(L"file:///" + UserPaths::getUserDataPath().makeCanonical().wstr()), QUrl::TolerantMode)); } void QtMainWindow::showLogFolder() { - QDesktopServices::openUrl(QUrl(("file:///" + UserPaths::getLogPath().makeCanonical().str()).c_str(), QUrl::TolerantMode)); + QDesktopServices::openUrl(QUrl(QString::fromStdWString(L"file:///" + UserPaths::getLogPath().makeCanonical().wstr()), QUrl::TolerantMode)); } void QtMainWindow::showStartScreen() @@ -711,8 +711,8 @@ void QtMainWindow::updateRecentProjectMenu() { FilePath project = recentProjects[i]; m_recentProjectAction[i]->setVisible(true); - m_recentProjectAction[i]->setText(FileSystem::fileName(project.str()).c_str()); - m_recentProjectAction[i]->setData(project.str().c_str()); + m_recentProjectAction[i]->setText(QString::fromStdWString(project.wFileName())); + m_recentProjectAction[i]->setData(QString::fromStdWString(project.wstr())); } else { diff --git a/src/lib_gui/qt/window/QtSelectPathsDialog.cpp b/src/lib_gui/qt/window/QtSelectPathsDialog.cpp index 475b88e8..7f5680d4 100644 --- a/src/lib_gui/qt/window/QtSelectPathsDialog.cpp +++ b/src/lib_gui/qt/window/QtSelectPathsDialog.cpp @@ -34,7 +34,7 @@ void QtSelectPathsDialog::setPathsList(const std::vector& paths, const for (const FilePath& s : paths) { - QListWidgetItem* item = new QListWidgetItem(s.str().c_str(), m_list); + QListWidgetItem* item = new QListWidgetItem(QString::fromStdWString(s.wstr()), m_list); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag if (checked.find(s) == checked.end()) diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp index e207c63e..7a42ba3c 100644 --- a/src/lib_gui/qt/window/QtStartScreen.cpp +++ b/src/lib_gui/qt/window/QtStartScreen.cpp @@ -40,8 +40,8 @@ void QtRecentProjectButton::setProjectPath(const FilePath& projectFilePath) } else { - std::string missingFileText = "Couldn't find " + m_projectFilePath.str() + " in your filesystem"; - this->setToolTip(missingFileText.c_str()); + const std::wstring missingFileText = L"Couldn't find " + m_projectFilePath.wstr() + L" in your filesystem"; + this->setToolTip(QString::fromStdWString(missingFileText)); } } @@ -55,9 +55,9 @@ void QtRecentProjectButton::handleButtonClick() { QMessageBox msgBox; msgBox.setText("Missing Project File"); - msgBox.setInformativeText(( - "Couldn't find " + m_projectFilePath.str() + " in your filesystem. Delete it from this recent Proejct list?" - ).c_str()); + msgBox.setInformativeText(QString::fromStdWString( + L"Couldn't find " + m_projectFilePath.wstr() + L" in your filesystem. Delete it from this recent Proejct list?" + )); msgBox.addButton("Delete", QMessageBox::ButtonRole::YesRole); msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole); msgBox.setIcon(QMessageBox::Icon::Question); @@ -69,7 +69,7 @@ void QtRecentProjectButton::handleButtonClick() const int maxRecentProjectsCount = ApplicationSettings::getInstance()->getMaxRecentProjectsCount(); for (int i = 0; i < maxRecentProjectsCount; i++) { - if (recentProjects[i].str() == m_projectFilePath.str()) + if (recentProjects[i].wstr() == m_projectFilePath.wstr()) { recentProjects.erase(recentProjects.begin()+i); ApplicationSettings::getInstance()->setRecentProjects(recentProjects); diff --git a/src/lib_gui/qt/window/QtWindow.cpp b/src/lib_gui/qt/window/QtWindow.cpp index 48741e5b..5ab25b5d 100644 --- a/src/lib_gui/qt/window/QtWindow.cpp +++ b/src/lib_gui/qt/window/QtWindow.cpp @@ -150,13 +150,13 @@ void QtWindow::setSizeGripStyle(bool isBlack) return; } - std::string path = isBlack ? "size_grip_black.png" : "size_grip_white.png"; + const std::wstring path = isBlack ? L"size_grip_black.png" : L"size_grip_white.png"; - m_sizeGrip->setStyleSheet(QString::fromStdString( - "QSizeGrip {" + m_sizeGrip->setStyleSheet(QString::fromStdWString( + L"QSizeGrip {" " max-height: 16px;" " max-width: 16px;" - " border-image: url(" + ResourcePaths::getGuiPath().str() + "window/" + path + ");" + " border-image: url(" + ResourcePaths::getGuiPath().wstr() + L"window/" + path + L");" "}" )); } @@ -509,7 +509,7 @@ void QtWindow::setupDone() void QtWindow::addLogo() { - QtDeviceScaledPixmap sourcetrailLogo((ResourcePaths::getGuiPath().str() + "window/logo.png").c_str()); + QtDeviceScaledPixmap sourcetrailLogo(QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/logo.png").wstr())); sourcetrailLogo.scaleToWidth(240); QLabel* sourcetrailLogoLabel = new QLabel(this); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp index a146443b..a41b23a2 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzard.cpp @@ -147,16 +147,19 @@ void QtProjectWizzard::populateWindow(QWidget* widget) buttonsLayout->setSpacing(0); QPushButton* addButton = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/source_group_add.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/source_group_add_hover.png").c_str()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/source_group_add.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/source_group_add_hover.png").wstr()) + ); m_removeButton = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/source_group_delete.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/source_group_delete_hover.png").c_str()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/source_group_delete.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/source_group_delete_hover.png").wstr()) + ); m_duplicateButton = new QtIconButton( - (ResourcePaths::getGuiPath().str() + "window/source_group_copy.png").c_str(), - (ResourcePaths::getGuiPath().str() + "window/source_group_copy_hover.png").c_str()); + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/source_group_copy.png").wstr()), + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"window/source_group_copy_hover.png").wstr()) + ); addButton->setIconSize(QSize(20, 20)); m_removeButton->setIconSize(QSize(20, 20)); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp index 8c0b0377..270ecadb 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPath.cpp @@ -147,7 +147,7 @@ void QtProjectWizzardContentPathCDB::load() std::dynamic_pointer_cast(m_settings); if (settings) { - m_picker->setText(QString::fromStdString(settings->getCompilationDatabasePath().str())); + m_picker->setText(QString::fromStdWString(settings->getCompilationDatabasePath().wstr())); } } @@ -206,7 +206,7 @@ void QtProjectWizzardContentPathSourceMaven::load() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - m_picker->setText(QString::fromStdString(settings->getMavenProjectFilePath().str())); + m_picker->setText(QString::fromStdWString(settings->getMavenProjectFilePath().wstr())); m_shouldIndexTests->setChecked(settings->getShouldIndexMavenTests()); } } @@ -299,7 +299,7 @@ void QtProjectWizzardContentPathDependenciesMaven::load() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - m_picker->setText(QString::fromStdString(settings->getMavenDependenciesDirectory().str())); + m_picker->setText(QString::fromStdWString(settings->getMavenDependenciesDirectory().wstr())); } } @@ -351,7 +351,7 @@ void QtProjectWizzardContentPathSourceGradle::load() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - m_picker->setText(QString::fromStdString(settings->getGradleProjectFilePath().str())); + m_picker->setText(QString::fromStdWString(settings->getGradleProjectFilePath().wstr())); m_shouldIndexTests->setChecked(settings->getShouldIndexGradleTests()); } } @@ -430,7 +430,7 @@ void QtProjectWizzardContentPathDependenciesGradle::load() std::shared_ptr settings = std::dynamic_pointer_cast(m_settings); if (settings) { - m_picker->setText(QString::fromStdString(settings->getGradleDependenciesDirectory().str())); + m_picker->setText(QString::fromStdWString(settings->getGradleDependenciesDirectory().wstr())); } } diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp index fc9c94a3..74c88c18 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPaths.cpp @@ -369,7 +369,7 @@ void QtProjectWizzardContentPathsCDBHeader::buttonClicked() { QMessageBox msgBox; msgBox.setText("The provided Compilation Database path does not exist."); - msgBox.setDetailedText(QString::fromStdString(cdbPath.str())); + msgBox.setDetailedText(QString::fromStdWString(cdbPath.wstr())); msgBox.exec(); return; } diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp index 468fdb8c..106c619a 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentPreferences.cpp @@ -443,7 +443,7 @@ void QtProjectWizzardContentPreferences::load() if (m_mavenPath) { - m_mavenPath->setText(QString::fromStdString(appSettings->getMavenPath().str())); + m_mavenPath->setText(QString::fromStdWString(appSettings->getMavenPath().wstr())); } } @@ -527,7 +527,7 @@ void QtProjectWizzardContentPreferences::javaPathDetectionClicked() std::vector paths = m_javaPathDetector->getPaths(m_javaPathDetectorBox->currentText().toStdString()); if (!paths.empty()) { - m_javaPath->setText(paths.front().str().c_str()); + m_javaPath->setText(QString::fromStdWString(paths.front().wstr())); } } @@ -544,7 +544,7 @@ void QtProjectWizzardContentPreferences::mavenPathDetectionClicked() std::vector paths = m_mavenPathDetector->getPaths(m_mavenPathDetectorBox->currentText().toStdString()); if (!paths.empty()) { - m_mavenPath->setText(paths.front().str().c_str()); + m_mavenPath->setText(QString::fromStdWString(paths.front().wstr())); } } diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.cpp b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.cpp index 6e5b984a..654049d6 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.cpp +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.cpp @@ -38,13 +38,13 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row) sourceGroupInfos[LANGUAGE_JAVA].push_back(SourceGroupInfo(SOURCE_GROUP_JAVA_GRADLE)); // define which icons should be used for which kind of source group - m_sourceGroupTypeIconName[SOURCE_GROUP_C_EMPTY] = "empty_icon"; - m_sourceGroupTypeIconName[SOURCE_GROUP_CPP_EMPTY] = "empty_icon"; - m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_CDB] = "cdb_icon"; - m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_VS] = "vs_icon"; - m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_EMPTY] = "empty_icon"; - m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_MAVEN] = "mvn_icon"; - m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_GRADLE] = "gradle_icon"; + m_sourceGroupTypeIconName[SOURCE_GROUP_C_EMPTY] = L"empty_icon"; + m_sourceGroupTypeIconName[SOURCE_GROUP_CPP_EMPTY] = L"empty_icon"; + m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_CDB] = L"cdb_icon"; + m_sourceGroupTypeIconName[SOURCE_GROUP_CXX_VS] = L"vs_icon"; + m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_EMPTY] = L"empty_icon"; + m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_MAVEN] = L"mvn_icon"; + m_sourceGroupTypeIconName[SOURCE_GROUP_JAVA_GRADLE] = L"gradle_icon"; // define descriptions for each kind of Source Group m_sourceGroupTypeDescriptions[SOURCE_GROUP_C_EMPTY] = "Create a new Sourcetrail Source Group by defining which C files will be indexed."; @@ -115,7 +115,7 @@ void QtProjectWizzardContentSelect::populate(QGridLayout* layout, int& row) { QToolButton* b = createSourceGroupButton( utility::insertLineBreaksAtBlankSpaces(sourceGroupTypeToProjectSetupString(sourceGroupIt.type), 15).c_str(), - (ResourcePaths::getGuiPath().str() + "icon/" + m_sourceGroupTypeIconName[sourceGroupIt.type] + ".png").c_str() + QString::fromStdWString(ResourcePaths::getGuiPath().concatenate(L"icon/" + m_sourceGroupTypeIconName[sourceGroupIt.type] + L".png").wstr()) ); b->setProperty("source_group_type", int(sourceGroupIt.type)); sourceGroupButtons->addButton(b); diff --git a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.h b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.h index bf2dc0ca..6489abf8 100644 --- a/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.h +++ b/src/lib_gui/qt/window/project_wizzard/QtProjectWizzardContentSelect.h @@ -32,7 +32,7 @@ private: QLabel* m_title; QLabel* m_description; - std::map m_sourceGroupTypeIconName; + std::map m_sourceGroupTypeIconName; std::map m_sourceGroupTypeDescriptions; std::vector m_solutionDescription; diff --git a/src/lib_java/project/SourceGroupJava.cpp b/src/lib_java/project/SourceGroupJava.cpp index d7b35fd5..1e97fa18 100644 --- a/src/lib_java/project/SourceGroupJava.cpp +++ b/src/lib_java/project/SourceGroupJava.cpp @@ -108,7 +108,7 @@ std::vector SourceGroupJava::doGetClassPath() const { if (classpath.exists()) { - LOG_INFO("Adding path to classpath: " + classpath.str()); + LOG_INFO(L"Adding path to classpath: " + classpath.wstr()); classPath.push_back(classpath); } } @@ -117,7 +117,7 @@ std::vector SourceGroupJava::doGetClassPath() const { for (const FilePath& systemLibraryPath : ApplicationSettings::getInstance()->getJreSystemLibraryPathsExpanded()) { - LOG_INFO("Adding JRE system library path to classpath: " + systemLibraryPath.str()); + LOG_INFO(L"Adding JRE system library path to classpath: " + systemLibraryPath.wstr()); classPath.push_back(systemLibraryPath); } } @@ -126,7 +126,7 @@ std::vector SourceGroupJava::doGetClassPath() const { if (rootDirectory.exists()) { - LOG_INFO("Adding root directory to classpath: " + rootDirectory.str()); + LOG_INFO(L"Adding root directory to classpath: " + rootDirectory.wstr()); classPath.push_back(rootDirectory); } } diff --git a/src/lib_java/project/SourceGroupJavaGradle.cpp b/src/lib_java/project/SourceGroupJavaGradle.cpp index bbb9c8f5..03618fc1 100644 --- a/src/lib_java/project/SourceGroupJavaGradle.cpp +++ b/src/lib_java/project/SourceGroupJavaGradle.cpp @@ -51,7 +51,7 @@ std::vector SourceGroupJavaGradle::doGetClassPath() const for (const FilePath& gradleJarPath : gradleJarPaths) { - LOG_INFO("Adding jar to classpath: " + gradleJarPath.str()); + LOG_INFO(L"Adding jar to classpath: " + gradleJarPath.wstr()); } utility::append(classPath, gradleJarPaths); diff --git a/src/lib_java/project/SourceGroupJavaMaven.cpp b/src/lib_java/project/SourceGroupJavaMaven.cpp index feef48fa..ff0f8898 100644 --- a/src/lib_java/project/SourceGroupJavaMaven.cpp +++ b/src/lib_java/project/SourceGroupJavaMaven.cpp @@ -51,7 +51,7 @@ std::vector SourceGroupJavaMaven::doGetClassPath() const for (const FilePath& mavenJarPath : mavenJarPaths) { - LOG_INFO("Adding jar to classpath: " + mavenJarPath.str()); + LOG_INFO(L"Adding jar to classpath: " + mavenJarPath.wstr()); } utility::append(classPath, mavenJarPaths); diff --git a/src/lib_java/utility/utilityMaven.cpp b/src/lib_java/utility/utilityMaven.cpp index 1386e20f..1b1cd58f 100644 --- a/src/lib_java/utility/utilityMaven.cpp +++ b/src/lib_java/utility/utilityMaven.cpp @@ -42,7 +42,7 @@ namespace path.concatenate(toAppend); } pathList.push_back(path); - LOG_INFO("Found directory \"" + path.str() + "\"."); + LOG_INFO(L"Found directory \"" + path.wstr() + L"\"."); } } diff --git a/src/test/CommandlineTestSuite.h b/src/test/CommandlineTestSuite.h index 242b8f36..fcd90135 100644 --- a/src/test/CommandlineTestSuite.h +++ b/src/test/CommandlineTestSuite.h @@ -60,9 +60,9 @@ public: parser.parse(); std::vector paths = ApplicationSettings::getInstance()->getHeaderSearchPaths(); - TS_ASSERT_EQUALS( paths[0].str(), "/usr") - TS_ASSERT_EQUALS( paths[1].str(), "/usr/share/include") - TS_ASSERT_EQUALS( paths[2].str(), "/opt/test/include") + TS_ASSERT_EQUALS(paths[0].wstr(), L"/usr") + TS_ASSERT_EQUALS(paths[1].wstr(), L"/usr/share/include") + TS_ASSERT_EQUALS(paths[2].wstr(), L"/opt/test/include") } void test_command_config_string_filepath_option() diff --git a/src/test/CxxIncludeProcessingTestSuite.h b/src/test/CxxIncludeProcessingTestSuite.h index afbd8f6f..a3268fcb 100644 --- a/src/test/CxxIncludeProcessingTestSuite.h +++ b/src/test/CxxIncludeProcessingTestSuite.h @@ -19,8 +19,8 @@ public: if (!includeDirectives.empty()) { - TS_ASSERT_EQUALS("foo.h", includeDirectives.front().getIncludedFile().str()); - TS_ASSERT_EQUALS("foo.cpp", includeDirectives.front().getIncludingFile().str()); + TS_ASSERT_EQUALS(L"foo.h", includeDirectives.front().getIncludedFile().wstr()); + TS_ASSERT_EQUALS(L"foo.cpp", includeDirectives.front().getIncludingFile().wstr()); } } @@ -35,8 +35,8 @@ public: if (!includeDirectives.empty()) { - TS_ASSERT_EQUALS("foo.h", includeDirectives.front().getIncludedFile().str()); - TS_ASSERT_EQUALS("foo.cpp", includeDirectives.front().getIncludingFile().str()); + TS_ASSERT_EQUALS(L"foo.h", includeDirectives.front().getIncludedFile().wstr()); + TS_ASSERT_EQUALS(L"foo.cpp", includeDirectives.front().getIncludingFile().wstr()); } } void test_include_detection_finds_include_with_quotes_and_space_before_keyword() @@ -50,8 +50,8 @@ public: if (!includeDirectives.empty()) { - TS_ASSERT_EQUALS("foo.h", includeDirectives.front().getIncludedFile().str()); - TS_ASSERT_EQUALS("foo.cpp", includeDirectives.front().getIncludingFile().str()); + TS_ASSERT_EQUALS(L"foo.h", includeDirectives.front().getIncludedFile().wstr()); + TS_ASSERT_EQUALS(L"foo.cpp", includeDirectives.front().getIncludingFile().wstr()); } } diff --git a/src/test/FileSystemTestSuite.h b/src/test/FileSystemTestSuite.h index b0f8d91f..7ddf4ee6 100644 --- a/src/test/FileSystemTestSuite.h +++ b/src/test/FileSystemTestSuite.h @@ -40,9 +40,9 @@ public: void test_find_all_source_files() { - std::vector sourceFiles = utility::convert( + std::vector sourceFiles = utility::convert( FileSystem::getFilePathsFromDirectory(FilePath(L"data/FileSystemTestSuite"), { L".h", L".hpp", L".cpp" }), - [](const FilePath& filePath){ return filePath.str(); } + [](const FilePath& filePath){ return filePath.wstr(); } ); TS_ASSERT_EQUALS(sourceFiles.size(), 8); diff --git a/src/test/SettingsTestSuite.h b/src/test/SettingsTestSuite.h index 21c0431e..fbd6af58 100644 --- a/src/test/SettingsTestSuite.h +++ b/src/test/SettingsTestSuite.h @@ -131,7 +131,7 @@ public: std::vector paths = sourceGroupSettings->getSourcePaths(); TS_ASSERT_EQUALS(paths.size(), 1); - TS_ASSERT_EQUALS(paths[0].str(), "data"); + TS_ASSERT_EQUALS(paths[0].wstr(), L"data"); } void test_load_header_search_paths_from_file() @@ -142,8 +142,8 @@ public: std::vector paths = sourceGroupSettings->getHeaderSearchPaths(); TS_ASSERT_EQUALS(paths.size(), 2); - TS_ASSERT_EQUALS(paths[0].str(), "data/"); - TS_ASSERT_EQUALS(paths[1].str(), "src/"); + TS_ASSERT_EQUALS(paths[0].wstr(), L"data/"); + TS_ASSERT_EQUALS(paths[1].wstr(), L"src/"); } private: diff --git a/src/test/SourceLocationCollectionTestSuite.h b/src/test/SourceLocationCollectionTestSuite.h index 4fb499f3..b3d3471f 100644 --- a/src/test/SourceLocationCollectionTestSuite.h +++ b/src/test/SourceLocationCollectionTestSuite.h @@ -72,7 +72,7 @@ public: TS_ASSERT_EQUALS(3, a->getColumnNumber()); TS_ASSERT_EQUALS(4, a->getOtherLocation()->getLineNumber()); TS_ASSERT_EQUALS(5, a->getOtherLocation()->getColumnNumber()); - TS_ASSERT_EQUALS("file.c", a->getFilePath().str()); + TS_ASSERT_EQUALS(L"file.c", a->getFilePath().wstr()); } void test_finding_source_locations_by_id()