src: broad refactoring to use FilePath.wstr() where easily possible

This commit is contained in:
mlangkabel
2018-02-06 11:35:36 +01:00
parent 9da3ac3d3c
commit f0b817eb0a
34 changed files with 106 additions and 103 deletions
@@ -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<IndexerCommand> 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;
@@ -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;
}
+2 -2
View File
@@ -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());
}
}
+1 -1
View File
@@ -86,7 +86,7 @@ std::vector<std::string> 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;
}
+10 -10
View File
@@ -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 })
@@ -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()
));
}
+2 -2
View File
@@ -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)
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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));
+2 -2
View File
@@ -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);
@@ -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);
@@ -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)
+2 -2
View File
@@ -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());
+2 -3
View File
@@ -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);
+8 -8
View File
@@ -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<QApplication*>(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
{
@@ -34,7 +34,7 @@ void QtSelectPathsDialog::setPathsList(const std::vector<FilePath>& 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())
+6 -6
View File
@@ -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);
+5 -5
View File
@@ -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);
@@ -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));
@@ -147,7 +147,7 @@ void QtProjectWizzardContentPathCDB::load()
std::dynamic_pointer_cast<SourceGroupSettingsCxxCdb>(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<SourceGroupSettingsJavaMaven> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaMaven>(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<SourceGroupSettingsJavaMaven> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaMaven>(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<SourceGroupSettingsJavaGradle> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaGradle>(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<SourceGroupSettingsJavaGradle> settings = std::dynamic_pointer_cast<SourceGroupSettingsJavaGradle>(m_settings);
if (settings)
{
m_picker->setText(QString::fromStdString(settings->getGradleDependenciesDirectory().str()));
m_picker->setText(QString::fromStdWString(settings->getGradleDependenciesDirectory().wstr()));
}
}
@@ -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;
}
@@ -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<FilePath> 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<FilePath> 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()));
}
}
@@ -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);
@@ -32,7 +32,7 @@ private:
QLabel* m_title;
QLabel* m_description;
std::map<SourceGroupType, std::string> m_sourceGroupTypeIconName;
std::map<SourceGroupType, std::wstring> m_sourceGroupTypeIconName;
std::map<SourceGroupType, std::string> m_sourceGroupTypeDescriptions;
std::vector<std::string> m_solutionDescription;
+3 -3
View File
@@ -108,7 +108,7 @@ std::vector<FilePath> 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<FilePath> 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<FilePath> 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);
}
}
@@ -51,7 +51,7 @@ std::vector<FilePath> 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);
@@ -51,7 +51,7 @@ std::vector<FilePath> 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);
+1 -1
View File
@@ -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"\".");
}
}
+3 -3
View File
@@ -60,9 +60,9 @@ public:
parser.parse();
std::vector<FilePath> 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()
+6 -6
View File
@@ -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());
}
}
+2 -2
View File
@@ -40,9 +40,9 @@ public:
void test_find_all_source_files()
{
std::vector<std::string> sourceFiles = utility::convert<FilePath, std::string>(
std::vector<std::wstring> sourceFiles = utility::convert<FilePath, std::wstring>(
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);
+3 -3
View File
@@ -131,7 +131,7 @@ public:
std::vector<FilePath> 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<FilePath> 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:
+1 -1
View File
@@ -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()