From 222e3d578a9feefdb5733261b787db5ee8093c3a Mon Sep 17 00:00:00 2001
From: Waqar Ahmed
Date: Thu, 13 Feb 2020 02:13:36 +0500
Subject: [PATCH] perf: Fix more clazy qstring-allocation warnings and pass
parameters by reference (#910)
* Fix some more clazy-qstring-allocation warnings
* Fix missing refs on large types in lib_gui
* Fix trivially copyable types being passed by ref in lib_gui
---
src/lib/component/view/CodeView.h | 12 +-
src/lib/component/view/TabsView.h | 4 +-
src/lib/component/view/TooltipView.h | 2 +-
src/lib_gui/qt/element/QtStatusBar.cpp | 24 +--
src/lib_gui/qt/element/QtTabBar.cpp | 11 +-
src/lib_gui/qt/element/QtTabBar.h | 4 +-
src/lib_gui/qt/element/QtTooltip.cpp | 12 +-
src/lib_gui/qt/element/QtTooltip.h | 4 +-
.../element/bookmark/QtBookmarkCategory.cpp | 3 +-
.../qt/element/button/QtIconStateButton.cpp | 2 +-
.../qt/element/button/QtIconStateButton.h | 2 +-
src/lib_gui/qt/element/code/QtCodeArea.cpp | 2 +-
src/lib_gui/qt/element/code/QtCodeArea.h | 2 +-
.../qt/element/code/QtCodeFileList.cpp | 2 +-
src/lib_gui/qt/element/code/QtCodeFileList.h | 2 +-
.../qt/element/code/QtCodeFileTitleBar.cpp | 11 +-
.../qt/element/code/QtCodeNavigateable.cpp | 2 +-
.../qt/element/code/QtCodeNavigateable.h | 2 +-
.../qt/element/code/QtCodeNavigator.cpp | 6 +-
.../qt/element/dialog/QtLocationPicker.cpp | 4 +-
.../qt/element/dialog/QtLocationPicker.h | 4 +-
.../qt/element/dialog/QtPathListBox.cpp | 2 +-
.../qt/element/dialog/QtPathListBoxItem.cpp | 6 +-
.../element/dialog/QtUpdateCheckerWidget.cpp | 4 +-
.../qt/element/dialog/QtUpdateCheckerWidget.h | 2 +-
.../qt/element/history/QtHistoryList.cpp | 4 +-
.../element/search/QtAutocompletionList.cpp | 2 +-
.../qt/element/search/QtAutocompletionList.h | 2 +-
.../qt/element/search/QtScreenSearchBox.cpp | 2 +-
.../qt/graphics/base/QtGraphicsView.cpp | 40 +++--
.../qt/graphics/base/QtLineItemBase.cpp | 12 +-
src/lib_gui/qt/graphics/base/QtLineItemBase.h | 12 +-
.../qt/graphics/base/QtLineItemStraight.cpp | 3 +-
.../qt/graphics/base/QtLineItemStraight.h | 2 +-
src/lib_gui/qt/graphics/graph/QtGraphEdge.cpp | 2 +-
src/lib_gui/qt/graphics/graph/QtGraphEdge.h | 2 +-
src/lib_gui/qt/graphics/graph/QtGraphNode.cpp | 6 +-
src/lib_gui/qt/graphics/graph/QtGraphNode.h | 2 +-
.../qt/graphics/graph/QtGraphNodeBundle.cpp | 2 +-
.../qt/graphics/graph/QtGraphNodeBundle.h | 2 +-
src/lib_gui/qt/network/QtRequest.cpp | 2 +-
src/lib_gui/qt/network/QtRequest.h | 2 +-
src/lib_gui/qt/network/QtUpdateChecker.cpp | 22 +--
.../qt/project_wizard/QtProjectWizard.cpp | 9 +-
.../qt/project_wizard/QtProjectWizard.h | 2 +-
.../content/QtProjectWizardContent.cpp | 9 +-
.../content/QtProjectWizardContent.h | 8 +-
.../QtProjectWizardContentCStandard.cpp | 5 +-
.../QtProjectWizardContentCppStandard.cpp | 5 +-
...ctWizardContentCrossCompilationOptions.cpp | 18 +-
.../QtProjectWizardContentCxxPchFlags.cpp | 38 +++--
.../content/QtProjectWizardContentFlags.cpp | 9 +-
.../QtProjectWizardContentPreferences.cpp | 159 +++++++++++-------
.../QtProjectWizardContentPreferences.h | 37 ++--
.../content/QtProjectWizardContentSelect.cpp | 4 +-
.../QtProjectWizardContentSourceGroupData.cpp | 5 +-
.../content/QtProjectWizardContentVS.cpp | 27 ++-
.../path/QtProjectWizardContentPathCDB.cpp | 16 +-
...jectWizardContentPathCodeblocksProject.cpp | 16 +-
.../path/QtProjectWizardContentPathCxxPch.cpp | 14 +-
.../paths/QtProjectWizardContentPaths.cpp | 6 +-
...ojectWizardContentPathsFrameworkSearch.cpp | 3 +-
...izardContentPathsFrameworkSearchGlobal.cpp | 2 +-
...tProjectWizardContentPathsHeaderSearch.cpp | 15 +-
...ctWizardContentPathsHeaderSearchGlobal.cpp | 8 +-
...rojectWizardContentPathsIndexedHeaders.cpp | 14 +-
...tProjectWizardContentPathsIndexedHeaders.h | 2 +-
src/lib_gui/qt/utility/QtContextMenu.cpp | 2 +-
src/lib_gui/qt/utility/QtContextMenu.h | 2 +-
.../qt/utility/QtDeviceScaledPixmap.cpp | 2 +-
src/lib_gui/qt/utility/QtDeviceScaledPixmap.h | 2 +-
.../utility/QtFilesAndDirectoriesDialog.cpp | 3 +-
src/lib_gui/qt/utility/QtFlowLayout.cpp | 2 +-
src/lib_gui/qt/utility/QtFlowLayout.h | 2 +-
src/lib_gui/qt/utility/QtHighlighter.cpp | 38 ++---
src/lib_gui/qt/utility/QtHighlighter.h | 2 +-
src/lib_gui/qt/utility/utilityQt.cpp | 6 +-
src/lib_gui/qt/utility/utilityQt.h | 2 +-
src/lib_gui/qt/view/QtBookmarkButtonsView.cpp | 6 +-
src/lib_gui/qt/view/QtCodeView.cpp | 12 +-
src/lib_gui/qt/view/QtCodeView.h | 16 +-
src/lib_gui/qt/view/QtCustomTrailView.cpp | 8 +-
src/lib_gui/qt/view/QtCustomTrailView.h | 2 +-
src/lib_gui/qt/view/QtGraphView.cpp | 9 +-
src/lib_gui/qt/view/QtStatusView.cpp | 14 +-
src/lib_gui/qt/view/QtTabsView.cpp | 17 +-
src/lib_gui/qt/view/QtTabsView.h | 6 +-
src/lib_gui/qt/view/QtTooltipView.cpp | 2 +-
src/lib_gui/qt/view/QtTooltipView.h | 2 +-
src/lib_gui/qt/window/QtAbout.cpp | 28 +--
src/lib_gui/qt/window/QtBookmarkCreator.cpp | 4 +-
src/lib_gui/qt/window/QtIndexingDialog.h | 2 +-
.../qt/window/QtIndexingProgressDialog.cpp | 3 +-
.../qt/window/QtIndexingReportDialog.cpp | 10 +-
src/lib_gui/qt/window/QtMainWindow.cpp | 7 +-
src/lib_gui/qt/window/QtStartScreen.cpp | 7 +-
src/lib_gui/qt/window/QtWindow.cpp | 8 +-
src/lib_gui/qt/window/QtWindow.h | 8 +-
.../path_detector/CombinedPathDetector.cpp | 2 +-
.../path_detector/CombinedPathDetector.h | 2 +-
.../CxxVs10To14HeaderPathDetector.cpp | 2 +-
.../cxx_header/utilityCxxHeaderDetection.cpp | 10 +-
.../JreSystemLibraryPathDetector.cpp | 3 +-
103 files changed, 522 insertions(+), 414 deletions(-)
diff --git a/src/lib/component/view/CodeView.h b/src/lib/component/view/CodeView.h
index 3a6ac0aa..a0dc8728 100644
--- a/src/lib/component/view/CodeView.h
+++ b/src/lib/component/view/CodeView.h
@@ -55,16 +55,16 @@ public:
virtual void clear() = 0;
virtual void showSnippets(
- const std::vector files,
- const CodeParams params,
- const CodeScrollParams scrollParams) = 0;
+ const std::vector& files,
+ const CodeParams& params,
+ const CodeScrollParams& scrollParams) = 0;
virtual void showSingleFile(
- const CodeFileParams file, const CodeParams params, const CodeScrollParams scrollParams) = 0;
+ const CodeFileParams& file, const CodeParams& params, const CodeScrollParams& scrollParams) = 0;
- virtual void updateSourceLocations(const std::vector files) = 0;
+ virtual void updateSourceLocations(const std::vector& files) = 0;
- virtual void scrollTo(const CodeScrollParams params, bool animated) = 0;
+ virtual void scrollTo(const CodeScrollParams& params, bool animated) = 0;
virtual bool showsErrors() const = 0;
diff --git a/src/lib/component/view/TabsView.h b/src/lib/component/view/TabsView.h
index 2d026483..bfa0a3e0 100644
--- a/src/lib/component/view/TabsView.h
+++ b/src/lib/component/view/TabsView.h
@@ -17,11 +17,11 @@ public:
virtual void clear() = 0;
- virtual void openTab(bool showTab, SearchMatch match) = 0;
+ virtual void openTab(bool showTab, const SearchMatch& match) = 0;
virtual void closeTab() = 0;
virtual void destroyTab(Id tabId) = 0;
virtual void selectTab(bool next) = 0;
- virtual void updateTab(Id tabId, std::vector matches) = 0;
+ virtual void updateTab(Id tabId, const std::vector& matches) = 0;
};
#endif // TABS_VIEW_H
diff --git a/src/lib/component/view/TooltipView.h b/src/lib/component/view/TooltipView.h
index 855ba986..609d4937 100644
--- a/src/lib/component/view/TooltipView.h
+++ b/src/lib/component/view/TooltipView.h
@@ -17,7 +17,7 @@ public:
// View implementation
virtual std::string getName() const;
- virtual void showTooltip(TooltipInfo info, const View* parent) = 0;
+ virtual void showTooltip(const TooltipInfo& info, const View* parent) = 0;
virtual void hideTooltip(bool force) = 0;
virtual bool tooltipVisible() const = 0;
diff --git a/src/lib_gui/qt/element/QtStatusBar.cpp b/src/lib_gui/qt/element/QtStatusBar.cpp
index 18a5225e..02da2af9 100644
--- a/src/lib_gui/qt/element/QtStatusBar.cpp
+++ b/src/lib_gui/qt/element/QtStatusBar.cpp
@@ -51,7 +51,7 @@ QtStatusBar::QtStatusBar(): m_text(this), m_ideStatusText(this)
m_errorButton.setFlat(true);
m_errorButton.setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_errorButton.setStyleSheet(
- "QPushButton { color: #D00000; margin-right: 0; spacing: none; }");
+ QStringLiteral("QPushButton { color: #D00000; margin-right: 0; spacing: none; }"));
m_errorButton.setIcon(
utility::colorizePixmap(
QPixmap(QString::fromStdWString(
@@ -72,7 +72,8 @@ QtStatusBar::QtStatusBar(): m_text(this), m_ideStatusText(this)
m_indexingStatus = new QPushButton(this);
m_indexingStatus->setFlat(true);
m_indexingStatus->setMinimumWidth(150);
- m_indexingStatus->setStyleSheet("QPushButton { margin-right: 0; spacing: none; }");
+ m_indexingStatus->setStyleSheet(
+ QStringLiteral("QPushButton { margin-right: 0; spacing: none; }"));
m_indexingStatus->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_indexingStatus->setCursor(Qt::PointingHandCursor);
@@ -81,7 +82,7 @@ QtStatusBar::QtStatusBar(): m_text(this), m_ideStatusText(this)
QHBoxLayout* layout = new QHBoxLayout();
layout->setContentsMargins(0, 0, 0, 0);
- layout->addWidget(new QLabel("Indexing:"));
+ layout->addWidget(new QLabel(QStringLiteral("Indexing:")));
m_indexingProgress = new QProgressBar();
m_indexingProgress->setMinimum(0);
@@ -100,12 +101,13 @@ void QtStatusBar::setText(const std::wstring& text, bool isError, bool showLoade
{
if (isError)
{
- m_text.setStyleSheet(
- "QPushButton { color: #D00000; margin-right: 0; spacing: none; text-align: left; }");
+ m_text.setStyleSheet(QStringLiteral(
+ "QPushButton { color: #D00000; margin-right: 0; spacing: none; text-align: left; }"));
}
else
{
- m_text.setStyleSheet("QPushButton { margin-right: 0; spacing: none; text-align: left; }");
+ m_text.setStyleSheet(
+ QStringLiteral("QPushButton { margin-right: 0; spacing: none; text-align: left; }"));
}
if (showLoader)
@@ -128,7 +130,8 @@ void QtStatusBar::setErrorCount(ErrorCountInfo errorCount)
{
m_errorButton.setText(
QString::number(errorCount.total) + " error" + (errorCount.total > 1 ? "s" : "") +
- (errorCount.fatal > 0 ? " (" + QString::number(errorCount.fatal) + " fatal)" : ""));
+ (errorCount.fatal > 0 ? " (" + QString::number(errorCount.fatal) + " fatal)"
+ : QLatin1String("")));
m_errorButton.setMinimumWidth(
m_errorButton.fontMetrics().width(QString(m_errorButton.text().size(), 'a')));
@@ -136,11 +139,12 @@ void QtStatusBar::setErrorCount(ErrorCountInfo errorCount)
if (errorCount.fatal > 0)
{
m_errorButton.setStyleSheet(
- "QPushButton { color: #D00000; margin-right: 0; spacing: none; }");
+ QStringLiteral("QPushButton { color: #D00000; margin-right: 0; spacing: none; }"));
}
else
{
- m_errorButton.setStyleSheet("QPushButton { margin-right: 0; spacing: none; }");
+ m_errorButton.setStyleSheet(
+ QStringLiteral("QPushButton { margin-right: 0; spacing: none; }"));
}
m_errorButton.show();
@@ -197,7 +201,7 @@ QWidget* QtStatusBar::addPermanentVLine()
{
QFrame* vline = new QFrame(this);
vline->setFrameShape(QFrame::VLine);
- vline->setStyleSheet("color: #777");
+ vline->setStyleSheet(QStringLiteral("color: #777"));
addPermanentWidget(vline);
return vline;
}
diff --git a/src/lib_gui/qt/element/QtTabBar.cpp b/src/lib_gui/qt/element/QtTabBar.cpp
index 6c0f0103..07852bdb 100644
--- a/src/lib_gui/qt/element/QtTabBar.cpp
+++ b/src/lib_gui/qt/element/QtTabBar.cpp
@@ -30,15 +30,16 @@ QSize QtTabBar::minimumTabSizeHint(int index) const
void QtTabBar::contextMenuEvent(QContextMenuEvent* event)
{
QtContextMenu menu(event, this);
- QAction * m_closeTabsToRight = new QAction("Close tabs to the right", this);
+ QAction* m_closeTabsToRight = new QAction(QStringLiteral("Close tabs to the right"), this);
menu.addAction(m_closeTabsToRight);
- connect(m_closeTabsToRight, &QAction::triggered, this, [&]()
- {
- // We dont want to close tabs right of the current active tab.
+ connect(m_closeTabsToRight, &QAction::triggered, this, [&]() {
+ // We dont want to close tabs right of the current active tab.
// No, our intend is to close tabs right of the currently hovered tab.
auto tabNum = tabAt(event->pos());
- LOG_INFO("Handling closeTabs... emitting signal to close tabs right of tab nr. " + std::to_string(tabNum));
+ LOG_INFO(
+ "Handling closeTabs... emitting signal to close tabs right of tab nr. " +
+ std::to_string(tabNum));
emit signalCloseTabsToRight(tabNum);
});
diff --git a/src/lib_gui/qt/element/QtTabBar.h b/src/lib_gui/qt/element/QtTabBar.h
index 72b24912..5a296eaa 100644
--- a/src/lib_gui/qt/element/QtTabBar.h
+++ b/src/lib_gui/qt/element/QtTabBar.h
@@ -6,7 +6,7 @@
class QtTabBar: public QTabBar
{
Q_OBJECT
-
+
public:
QtTabBar(QWidget* parent = nullptr);
@@ -19,7 +19,7 @@ protected:
QSize tabSizeHint(int index) const override;
QSize minimumTabSizeHint(int index) const override;
- // New ContextMenu that lets the user close all tabs to the
+ // New ContextMenu that lets the user close all tabs to the
// right of current mouse position.
void contextMenuEvent(QContextMenuEvent* event) override;
};
diff --git a/src/lib_gui/qt/element/QtTooltip.cpp b/src/lib_gui/qt/element/QtTooltip.cpp
index 437c85c6..f0e1da4d 100644
--- a/src/lib_gui/qt/element/QtTooltip.cpp
+++ b/src/lib_gui/qt/element/QtTooltip.cpp
@@ -17,7 +17,7 @@
QtTooltip::QtTooltip(QWidget* parent): QFrame(parent), m_parentView(nullptr), m_isHovered(false)
{
QWidget::setWindowFlags(Qt::ToolTip);
- setObjectName("tooltip");
+ setObjectName(QStringLiteral("tooltip"));
QVBoxLayout* layout = new QVBoxLayout();
layout->setContentsMargins(0, 0, 0, 0);
@@ -27,7 +27,7 @@ QtTooltip::QtTooltip(QWidget* parent): QFrame(parent), m_parentView(nullptr), m_
QtTooltip::~QtTooltip() {}
-void QtTooltip::setTooltipInfo(TooltipInfo info)
+void QtTooltip::setTooltipInfo(const TooltipInfo& info)
{
int maxWidth = 600;
QWidget* parent = m_parentView ? m_parentView : parentWidget();
@@ -140,21 +140,21 @@ void QtTooltip::enterEvent(QEvent* event)
m_isHovered = true;
}
-void QtTooltip::addTitle(QString title, int count, QString countText)
+void QtTooltip::addTitle(const QString& title, int count, const QString& countText)
{
QHBoxLayout* titleLayout = new QHBoxLayout();
titleLayout->setContentsMargins(0, 0, 0, 0);
titleLayout->setSpacing(0);
QLabel* titleLabel = new QLabel(title);
- titleLabel->setObjectName("tooltip_title");
+ titleLabel->setObjectName(QStringLiteral("tooltip_title"));
titleLayout->addWidget(titleLabel);
if (count >= 0)
{
QLabel* referenceLabel = new QLabel(
QString::number(count) + " " + countText + (count != 1 ? "s" : ""));
- referenceLabel->setObjectName("tooltip_references");
+ referenceLabel->setObjectName(QStringLiteral("tooltip_references"));
titleLayout->addWidget(referenceLabel, 0, Qt::AlignRight);
}
@@ -168,7 +168,7 @@ void QtTooltip::addTitle(QString title, int count, QString countText)
void QtTooltip::addWidget(QWidget* widget)
{
- widget->setObjectName("tooltip_widget");
+ widget->setObjectName(QStringLiteral("tooltip_widget"));
layout()->addWidget(widget);
}
diff --git a/src/lib_gui/qt/element/QtTooltip.h b/src/lib_gui/qt/element/QtTooltip.h
index be9166d6..fca88b61 100644
--- a/src/lib_gui/qt/element/QtTooltip.h
+++ b/src/lib_gui/qt/element/QtTooltip.h
@@ -13,7 +13,7 @@ public:
QtTooltip(QWidget* parent = nullptr);
virtual ~QtTooltip();
- void setTooltipInfo(TooltipInfo info);
+ void setTooltipInfo(const TooltipInfo& info);
void setParentView(QWidget* parentView);
@@ -28,7 +28,7 @@ protected:
virtual void enterEvent(QEvent* event);
private:
- void addTitle(QString title, int count, QString countText);
+ void addTitle(const QString& title, int count, const QString& countText);
void addWidget(QWidget* widget);
void clearLayout(QLayout* layout);
diff --git a/src/lib_gui/qt/element/bookmark/QtBookmarkCategory.cpp b/src/lib_gui/qt/element/bookmark/QtBookmarkCategory.cpp
index 1deda78c..5fa03772 100644
--- a/src/lib_gui/qt/element/bookmark/QtBookmarkCategory.cpp
+++ b/src/lib_gui/qt/element/bookmark/QtBookmarkCategory.cpp
@@ -39,7 +39,8 @@ QtBookmarkCategory::QtBookmarkCategory(ControllerProxy* cont
m_deleteButton = new QPushButton();
m_deleteButton->setObjectName(QStringLiteral("category_delete_button"));
- m_deleteButton->setToolTip(QStringLiteral("Delete this Bookmark Category and the containing Bookmarks"));
+ m_deleteButton->setToolTip(
+ QStringLiteral("Delete this Bookmark Category and the containing Bookmarks"));
m_deleteButton->setAttribute(Qt::WA_LayoutUsesWidgetRect);
m_deleteButton->setIconSize(QSize(20, 20));
m_deleteButton->setIcon(QPixmap(
diff --git a/src/lib_gui/qt/element/button/QtIconStateButton.cpp b/src/lib_gui/qt/element/button/QtIconStateButton.cpp
index 164bf43f..bdea6a20 100644
--- a/src/lib_gui/qt/element/button/QtIconStateButton.cpp
+++ b/src/lib_gui/qt/element/button/QtIconStateButton.cpp
@@ -90,7 +90,7 @@ void QtIconStateButton::leaveEvent(QEvent* event)
}
}
-void QtIconStateButton::setState(State state)
+void QtIconStateButton::setState(const State& state)
{
QPixmap pixmap = QPixmap(QString::fromStdWString(state.iconPath.wstr()));
diff --git a/src/lib_gui/qt/element/button/QtIconStateButton.h b/src/lib_gui/qt/element/button/QtIconStateButton.h
index a199006e..d918c75c 100644
--- a/src/lib_gui/qt/element/button/QtIconStateButton.h
+++ b/src/lib_gui/qt/element/button/QtIconStateButton.h
@@ -40,7 +40,7 @@ protected:
void leaveEvent(QEvent* event);
private:
- void setState(State state);
+ void setState(const State& state);
std::map m_states;
};
diff --git a/src/lib_gui/qt/element/code/QtCodeArea.cpp b/src/lib_gui/qt/element/code/QtCodeArea.cpp
index 9f9066e3..80e68817 100644
--- a/src/lib_gui/qt/element/code/QtCodeArea.cpp
+++ b/src/lib_gui/qt/element/code/QtCodeArea.cpp
@@ -787,7 +787,7 @@ void QtCodeArea::updateLineNumberAreaWidth(int /* newBlockCount */)
setViewportMargins(lineNumberAreaWidth(), 0, 0, 0);
}
-void QtCodeArea::updateLineNumberArea(const QRect& rect, int dy)
+void QtCodeArea::updateLineNumberArea(QRect rect, int dy)
{
if (dy)
{
diff --git a/src/lib_gui/qt/element/code/QtCodeArea.h b/src/lib_gui/qt/element/code/QtCodeArea.h
index 331043a7..3840d2ab 100644
--- a/src/lib_gui/qt/element/code/QtCodeArea.h
+++ b/src/lib_gui/qt/element/code/QtCodeArea.h
@@ -100,7 +100,7 @@ protected:
private slots:
void updateLineNumberAreaWidth(int newBlockCount = 0);
- void updateLineNumberArea(const QRect&, int);
+ void updateLineNumberArea(QRect , int);
void setIDECursorPosition();
void setCopyAvailable(bool yes);
diff --git a/src/lib_gui/qt/element/code/QtCodeFileList.cpp b/src/lib_gui/qt/element/code/QtCodeFileList.cpp
index d05c4b95..cef64d50 100644
--- a/src/lib_gui/qt/element/code/QtCodeFileList.cpp
+++ b/src/lib_gui/qt/element/code/QtCodeFileList.cpp
@@ -100,7 +100,7 @@ void QtCodeFileList::clearSnippetTitleAndScrollBar()
updateLastSnippetScrollBar(nullptr);
}
-QtCodeFile* QtCodeFileList::getFile(const FilePath filePath)
+QtCodeFile* QtCodeFileList::getFile(const FilePath& filePath)
{
QtCodeFile* file = nullptr;
diff --git a/src/lib_gui/qt/element/code/QtCodeFileList.h b/src/lib_gui/qt/element/code/QtCodeFileList.h
index 67197430..63973d6b 100644
--- a/src/lib_gui/qt/element/code/QtCodeFileList.h
+++ b/src/lib_gui/qt/element/code/QtCodeFileList.h
@@ -28,7 +28,7 @@ public:
void clear();
void clearSnippetTitleAndScrollBar();
- QtCodeFile* getFile(const FilePath filePath);
+ QtCodeFile* getFile(const FilePath& filePath);
void addFile(const CodeFileParams& params);
diff --git a/src/lib_gui/qt/element/code/QtCodeFileTitleBar.cpp b/src/lib_gui/qt/element/code/QtCodeFileTitleBar.cpp
index 9d6e91c4..a2703ef3 100644
--- a/src/lib_gui/qt/element/code/QtCodeFileTitleBar.cpp
+++ b/src/lib_gui/qt/element/code/QtCodeFileTitleBar.cpp
@@ -32,7 +32,10 @@ QtCodeFileTitleBar::QtCodeFileTitleBar(QWidget* parent, bool isHovering, bool is
FilePath imageDir = ResourcePaths::getGuiPath().concatenate(L"code_view/images/");
m_expandButton = new QtSelfRefreshIconButton(
- QLatin1String(""), imageDir.getConcatenated(L"snippet_arrow_right.png"), "code/file/title", this);
+ QLatin1String(""),
+ imageDir.getConcatenated(L"snippet_arrow_right.png"),
+ "code/file/title",
+ this);
m_collapseButton = new QtSelfRefreshIconButton(
QLatin1String(""), imageDir.getConcatenated(L"snippet_arrow_down.png"), "code/file/title", this);
@@ -74,7 +77,8 @@ QtCodeFileTitleBar::QtCodeFileTitleBar(QWidget* parent, bool isHovering, bool is
m_showErrorsButton = new QPushButton(QStringLiteral("show errors"));
m_showErrorsButton->setObjectName(QStringLiteral("screen_button"));
- m_showErrorsButton->setToolTip(QStringLiteral("Show all errors causing this file to be incomplete"));
+ m_showErrorsButton->setToolTip(
+ QStringLiteral("Show all errors causing this file to be incomplete"));
m_showErrorsButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_showErrorsButton->hide();
titleLayout->addWidget(m_showErrorsButton);
@@ -168,7 +172,8 @@ void QtCodeFileTitleBar::updateRefCount(int refCount, bool hasErrors, size_t fat
if (fatalErrorCount > 0)
{
- label += QStringLiteral(" (") + QString::number(fatalErrorCount) + QStringLiteral(" fatal)");
+ label += QStringLiteral(" (") + QString::number(fatalErrorCount) +
+ QStringLiteral(" fatal)");
}
QString text = QString::number(refCount) + QChar(' ') + label;
diff --git a/src/lib_gui/qt/element/code/QtCodeNavigateable.cpp b/src/lib_gui/qt/element/code/QtCodeNavigateable.cpp
index 16bfcef2..6d1ee035 100644
--- a/src/lib_gui/qt/element/code/QtCodeNavigateable.cpp
+++ b/src/lib_gui/qt/element/code/QtCodeNavigateable.cpp
@@ -11,7 +11,7 @@ QtCodeNavigateable::~QtCodeNavigateable() {}
void QtCodeNavigateable::ensureWidgetVisibleAnimated(
const QWidget* parentWidget,
const QWidget* childWidget,
- QRectF rect,
+ const QRectF& rect,
bool animated,
CodeScrollParams::Target target)
{
diff --git a/src/lib_gui/qt/element/code/QtCodeNavigateable.h b/src/lib_gui/qt/element/code/QtCodeNavigateable.h
index 948d650a..afcee07c 100644
--- a/src/lib_gui/qt/element/code/QtCodeNavigateable.h
+++ b/src/lib_gui/qt/element/code/QtCodeNavigateable.h
@@ -40,7 +40,7 @@ protected:
void ensureWidgetVisibleAnimated(
const QWidget* parentWidget,
const QWidget* childWidget,
- QRectF rect,
+ const QRectF& rect,
bool animated,
CodeScrollParams::Target target);
void ensurePercentVisibleAnimated(
diff --git a/src/lib_gui/qt/element/code/QtCodeNavigator.cpp b/src/lib_gui/qt/element/code/QtCodeNavigator.cpp
index 150ec665..33a6abf4 100644
--- a/src/lib_gui/qt/element/code/QtCodeNavigator.cpp
+++ b/src/lib_gui/qt/element/code/QtCodeNavigator.cpp
@@ -78,8 +78,10 @@ QtCodeNavigator::QtCodeNavigator(QWidget* parent)
m_nextLocalReferenceButton = new QtSearchBarButton(
ResourcePaths::getGuiPath().concatenate(L"code_view/images/arrow_down.png"), true);
- m_prevLocalReferenceButton->setObjectName(QStringLiteral("local_reference_button_previous"));
- m_nextLocalReferenceButton->setObjectName(QStringLiteral("local_reference_button_next"));
+ m_prevLocalReferenceButton->setObjectName(
+ QStringLiteral("local_reference_button_previous"));
+ m_nextLocalReferenceButton->setObjectName(
+ QStringLiteral("local_reference_button_next"));
m_prevLocalReferenceButton->setToolTip(QStringLiteral("previous local reference"));
m_nextLocalReferenceButton->setToolTip(QStringLiteral("next local reference"));
diff --git a/src/lib_gui/qt/element/dialog/QtLocationPicker.cpp b/src/lib_gui/qt/element/dialog/QtLocationPicker.cpp
index dbcf2890..2b306c42 100644
--- a/src/lib_gui/qt/element/dialog/QtLocationPicker.cpp
+++ b/src/lib_gui/qt/element/dialog/QtLocationPicker.cpp
@@ -48,7 +48,7 @@ void QtLocationPicker::paintEvent(QPaintEvent*)
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
-void QtLocationPicker::setPlaceholderText(QString text)
+void QtLocationPicker::setPlaceholderText(const QString& text)
{
m_data->setPlaceholderText(text);
}
@@ -58,7 +58,7 @@ QString QtLocationPicker::getText()
return m_data->text();
}
-void QtLocationPicker::setText(QString text)
+void QtLocationPicker::setText(const QString& text)
{
m_data->setText(text);
}
diff --git a/src/lib_gui/qt/element/dialog/QtLocationPicker.h b/src/lib_gui/qt/element/dialog/QtLocationPicker.h
index 98728cd9..45f617d8 100644
--- a/src/lib_gui/qt/element/dialog/QtLocationPicker.h
+++ b/src/lib_gui/qt/element/dialog/QtLocationPicker.h
@@ -15,9 +15,9 @@ public:
virtual void paintEvent(QPaintEvent*) override;
- void setPlaceholderText(QString text);
+ void setPlaceholderText(const QString& text);
QString getText();
- void setText(QString text);
+ void setText(const QString& text);
void clearText();
bool pickDirectory() const;
diff --git a/src/lib_gui/qt/element/dialog/QtPathListBox.cpp b/src/lib_gui/qt/element/dialog/QtPathListBox.cpp
index a0b2fddd..85049eb8 100644
--- a/src/lib_gui/qt/element/dialog/QtPathListBox.cpp
+++ b/src/lib_gui/qt/element/dialog/QtPathListBox.cpp
@@ -63,7 +63,7 @@ void QtPathListBox::setPaths(const std::vector& list, bool readOnly)
void QtPathListBox::addPaths(const std::vector& list, bool readOnly)
{
- for (FilePath path: list)
+ for (const FilePath& path: list)
{
QtListBoxItem* item = addListBoxItemWithText(QString::fromStdWString(path.wstr()));
item->setReadOnly(readOnly);
diff --git a/src/lib_gui/qt/element/dialog/QtPathListBoxItem.cpp b/src/lib_gui/qt/element/dialog/QtPathListBoxItem.cpp
index 21d90f56..93dd2d09 100644
--- a/src/lib_gui/qt/element/dialog/QtPathListBoxItem.cpp
+++ b/src/lib_gui/qt/element/dialog/QtPathListBoxItem.cpp
@@ -37,10 +37,12 @@ void QtPathListBoxItem::handleButtonPress()
switch (m_listBox->getSelectionPolicy())
{
case QtPathListBox::SELECTION_POLICY_FILES_ONLY:
- list.append(QtFileDialog::getOpenFileName(this, QStringLiteral("Select Directory"), path, QLatin1String("")));
+ list.append(QtFileDialog::getOpenFileName(
+ this, QStringLiteral("Select Directory"), path, QLatin1String("")));
break;
case QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY:
- list.append(QtFileDialog::getExistingDirectory(this, QStringLiteral("Select Directory"), path));
+ list.append(
+ QtFileDialog::getExistingDirectory(this, QStringLiteral("Select Directory"), path));
break;
case QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES:
list = QtFileDialog::getFileNamesAndDirectories(this, path);
diff --git a/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.cpp b/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.cpp
index 6502eb0e..50cf3343 100644
--- a/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.cpp
+++ b/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.cpp
@@ -75,7 +75,7 @@ void QtUpdateCheckerWidget::checkUpdate(bool force)
std::shared_ptr deleteCheck = m_deleteCheck;
- QtUpdateChecker::check(force, [deleteCheck, this](QtUpdateChecker::Result result) {
+ QtUpdateChecker::check(force, [deleteCheck, this](const QtUpdateChecker::Result& result) {
if (*deleteCheck.get())
{
return;
@@ -98,7 +98,7 @@ void QtUpdateCheckerWidget::checkUpdate(bool force)
});
}
-void QtUpdateCheckerWidget::setDownloadUrl(QString url)
+void QtUpdateCheckerWidget::setDownloadUrl(const QString& url)
{
m_button->setText(QStringLiteral("new version available"));
m_button->disconnect();
diff --git a/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.h b/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.h
index c4a82e39..f446a243 100644
--- a/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.h
+++ b/src/lib_gui/qt/element/dialog/QtUpdateCheckerWidget.h
@@ -20,7 +20,7 @@ signals:
private:
void checkUpdate(bool force);
- void setDownloadUrl(QString url);
+ void setDownloadUrl(const QString& url);
QPushButton* m_button;
diff --git a/src/lib_gui/qt/element/history/QtHistoryList.cpp b/src/lib_gui/qt/element/history/QtHistoryList.cpp
index 8a8e2630..9dfdc27f 100644
--- a/src/lib_gui/qt/element/history/QtHistoryList.cpp
+++ b/src/lib_gui/qt/element/history/QtHistoryList.cpp
@@ -29,8 +29,8 @@ QtHistoryItem::QtHistoryItem(const SearchMatch& match, size_t index, bool isCurr
m_name = new QLabel(QString::fromStdWString(name), this);
m_name->setAttribute(Qt::WA_MacShowFocusRect, 0);
m_name->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
- m_name->setObjectName(isCurrent ?
- QStringLiteral("history_item_current") : QStringLiteral("history_item"));
+ m_name->setObjectName(
+ isCurrent ? QStringLiteral("history_item_current") : QStringLiteral("history_item"));
m_name->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
layout->addWidget(m_name);
diff --git a/src/lib_gui/qt/element/search/QtAutocompletionList.cpp b/src/lib_gui/qt/element/search/QtAutocompletionList.cpp
index 25aa23e8..7c5497a4 100644
--- a/src/lib_gui/qt/element/search/QtAutocompletionList.cpp
+++ b/src/lib_gui/qt/element/search/QtAutocompletionList.cpp
@@ -384,7 +384,7 @@ QtAutocompletionList::QtAutocompletionList(QWidget* parent): QCompleter(parent)
QtAutocompletionList::~QtAutocompletionList() {}
-void QtAutocompletionList::completeAt(const QPoint& pos, const std::vector& autocompletionList)
+void QtAutocompletionList::completeAt(QPoint pos, const std::vector& autocompletionList)
{
m_model->setMatchList(autocompletionList);
diff --git a/src/lib_gui/qt/element/search/QtAutocompletionList.h b/src/lib_gui/qt/element/search/QtAutocompletionList.h
index 1c7ca774..3cf9e915 100644
--- a/src/lib_gui/qt/element/search/QtAutocompletionList.h
+++ b/src/lib_gui/qt/element/search/QtAutocompletionList.h
@@ -79,7 +79,7 @@ public:
QtAutocompletionList(QWidget* parent = 0);
virtual ~QtAutocompletionList();
- void completeAt(const QPoint& pos, const std::vector& autocompletionList);
+ void completeAt(QPoint pos, const std::vector& autocompletionList);
const SearchMatch* getSearchMatchAt(int idx) const;
diff --git a/src/lib_gui/qt/element/search/QtScreenSearchBox.cpp b/src/lib_gui/qt/element/search/QtScreenSearchBox.cpp
index 81b55666..c9ddf66e 100644
--- a/src/lib_gui/qt/element/search/QtScreenSearchBox.cpp
+++ b/src/lib_gui/qt/element/search/QtScreenSearchBox.cpp
@@ -180,7 +180,7 @@ void QtScreenSearchBox::findMatches()
{
m_controllerProxy->executeAsTask([this](ScreenSearchController* controller) {
std::set responderNames;
- for (auto p: m_checkBoxes)
+ for (const auto& p: m_checkBoxes)
{
if (p.second->isChecked())
{
diff --git a/src/lib_gui/qt/graphics/base/QtGraphicsView.cpp b/src/lib_gui/qt/graphics/base/QtGraphicsView.cpp
index 09f13592..33ef4761 100644
--- a/src/lib_gui/qt/graphics/base/QtGraphicsView.cpp
+++ b/src/lib_gui/qt/graphics/base/QtGraphicsView.cpp
@@ -42,7 +42,8 @@ QtGraphicsView::QtGraphicsView(QWidget* parent)
, m_zoomInButtonSpeed(20.0f)
, m_zoomOutButtonSpeed(-20.0f)
{
- QString modifierName = utility::getOsType() == OS_MAC ? QStringLiteral("Cmd") : QStringLiteral("Ctrl");
+ QString modifierName = utility::getOsType() == OS_MAC ? QStringLiteral("Cmd")
+ : QStringLiteral("Ctrl");
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
@@ -62,8 +63,10 @@ QtGraphicsView::QtGraphicsView(QWidget* parent)
connect(m_openInTabAction, &QAction::triggered, this, &QtGraphicsView::openInTab);
m_copyNodeNameAction = new QAction(QStringLiteral("Copy Name"), this);
- m_copyNodeNameAction->setStatusTip(QStringLiteral("Copies the name of this node to the clipboard"));
- m_copyNodeNameAction->setToolTip(QStringLiteral("Copies the name of this node to the clipboard"));
+ m_copyNodeNameAction->setStatusTip(
+ QStringLiteral("Copies the name of this node to the clipboard"));
+ m_copyNodeNameAction->setToolTip(
+ QStringLiteral("Copies the name of this node to the clipboard"));
connect(m_copyNodeNameAction, &QAction::triggered, this, &QtGraphicsView::copyNodeName);
m_collapseAction = new QAction(QStringLiteral("Collapse Node (Shift + Left Click)"), this);
@@ -76,20 +79,26 @@ QtGraphicsView::QtGraphicsView(QWidget* parent)
m_expandAction->setToolTip(QStringLiteral("Show unconnected members of the node"));
connect(m_expandAction, &QAction::triggered, this, &QtGraphicsView::expandNode);
- m_showInIDEAction = new QAction(QStringLiteral("Show Definition in IDE (Ctrl + Left Click)"), this);
+ m_showInIDEAction = new QAction(
+ QStringLiteral("Show Definition in IDE (Ctrl + Left Click)"), this);
#if defined(Q_OS_MAC)
m_showInIDEAction->setText("Show Definition in IDE (Cmd + Left Click)");
#endif
- m_showInIDEAction->setStatusTip(QStringLiteral("Show definition of this symbol in the IDE (via plug-in)"));
- m_showInIDEAction->setToolTip(QStringLiteral("Show definition of this symbol in the IDE (via plug-in)"));
+ m_showInIDEAction->setStatusTip(
+ QStringLiteral("Show definition of this symbol in the IDE (via plug-in)"));
+ m_showInIDEAction->setToolTip(
+ QStringLiteral("Show definition of this symbol in the IDE (via plug-in)"));
connect(m_showInIDEAction, &QAction::triggered, this, &QtGraphicsView::showInIDE);
- m_showDefinitionAction = new QAction(QStringLiteral("Show Definition (Ctrl + Alt + Left Click)"), this);
+ m_showDefinitionAction = new QAction(
+ QStringLiteral("Show Definition (Ctrl + Alt + Left Click)"), this);
#if defined(Q_OS_MAC)
m_showDefinitionAction->setText("Show Definition (Cmd + Alt + Left Click)");
#endif
- m_showDefinitionAction->setStatusTip(QStringLiteral("Show definition of this symbol in the code"));
- m_showDefinitionAction->setToolTip(QStringLiteral("Show definition of this symbol in the code"));
+ m_showDefinitionAction->setStatusTip(
+ QStringLiteral("Show definition of this symbol in the code"));
+ m_showDefinitionAction->setToolTip(
+ QStringLiteral("Show definition of this symbol in the code"));
connect(m_showDefinitionAction, &QAction::triggered, this, &QtGraphicsView::showDefinition);
m_hideNodeAction = new QAction(QStringLiteral("Hide Node (Alt + Left Click)"), this);
@@ -556,12 +565,13 @@ void QtGraphicsView::exportGraph()
const QString exportNotice = QStringLiteral("Exported from Sourcetrail");
const int margin = 10;
- FilePath filePath(QtFileDialog::showSaveFileDialog(
- nullptr,
- QStringLiteral("Save image"),
- FilePath(),
- QStringLiteral("PNG (*.png);;JPEG (*.JPEG);;BMP Files (*.bmp);;SVG (*.svg)"))
- .toStdWString());
+ FilePath filePath(
+ QtFileDialog::showSaveFileDialog(
+ nullptr,
+ QStringLiteral("Save image"),
+ FilePath(),
+ QStringLiteral("PNG (*.png);;JPEG (*.JPEG);;BMP Files (*.bmp);;SVG (*.svg)"))
+ .toStdWString());
if (filePath.extension() == L".svg")
diff --git a/src/lib_gui/qt/graphics/base/QtLineItemBase.cpp b/src/lib_gui/qt/graphics/base/QtLineItemBase.cpp
index 30a8d528..dc0294bf 100644
--- a/src/lib_gui/qt/graphics/base/QtLineItemBase.cpp
+++ b/src/lib_gui/qt/graphics/base/QtLineItemBase.cpp
@@ -19,11 +19,11 @@ QtLineItemBase::QtLineItemBase(QGraphicsItem* parent)
QtLineItemBase::~QtLineItemBase() {}
void QtLineItemBase::updateLine(
- Vec4i ownerRect,
- Vec4i targetRect,
- Vec4i ownerParentRect,
- Vec4i targetParentRect,
- GraphViewStyle::EdgeStyle style,
+ const Vec4i& ownerRect,
+ const Vec4i& targetRect,
+ const Vec4i& ownerParentRect,
+ const Vec4i& targetParentRect,
+ const GraphViewStyle::EdgeStyle& style,
size_t weight,
bool showArrow)
{
@@ -318,7 +318,7 @@ QPolygon QtLineItemBase::getPath() const
return poly;
}
-int QtLineItemBase::getDirection(const QPointF& a, const QPointF& b) const
+int QtLineItemBase::getDirection(QPointF a, QPointF b) const
{
if (a.x() != b.x())
{
diff --git a/src/lib_gui/qt/graphics/base/QtLineItemBase.h b/src/lib_gui/qt/graphics/base/QtLineItemBase.h
index 3e00d7f6..b0226c0e 100644
--- a/src/lib_gui/qt/graphics/base/QtLineItemBase.h
+++ b/src/lib_gui/qt/graphics/base/QtLineItemBase.h
@@ -21,11 +21,11 @@ public:
virtual ~QtLineItemBase();
void updateLine(
- Vec4i ownerRect,
- Vec4i targetRect,
- Vec4i ownerParentRect,
- Vec4i targetParentRect,
- GraphViewStyle::EdgeStyle style,
+ const Vec4i& ownerRect,
+ const Vec4i& targetRect,
+ const Vec4i& ownerParentRect,
+ const Vec4i& targetParentRect,
+ const GraphViewStyle::EdgeStyle& style,
size_t weight,
bool showArrow);
@@ -37,7 +37,7 @@ public:
protected:
QPolygon getPath() const;
- int getDirection(const QPointF& a, const QPointF& b) const;
+ int getDirection(QPointF a, QPointF b) const;
QRectF getArrowBoundingRect(const QPolygon& poly) const;
void drawArrow(const QPolygon& poly, QPainterPath* path, QPainterPath* arrowPath = nullptr) const;
diff --git a/src/lib_gui/qt/graphics/base/QtLineItemStraight.cpp b/src/lib_gui/qt/graphics/base/QtLineItemStraight.cpp
index d3829639..7f965562 100644
--- a/src/lib_gui/qt/graphics/base/QtLineItemStraight.cpp
+++ b/src/lib_gui/qt/graphics/base/QtLineItemStraight.cpp
@@ -10,7 +10,8 @@ QtLineItemStraight::QtLineItemStraight(QGraphicsItem* parent): QGraphicsLineItem
QtLineItemStraight::~QtLineItemStraight() {}
-void QtLineItemStraight::updateLine(Vec2i origin, Vec2i target, GraphViewStyle::EdgeStyle style)
+void QtLineItemStraight::updateLine(
+ const Vec2i& origin, const Vec2i& target, const GraphViewStyle::EdgeStyle& style)
{
prepareGeometryChange();
diff --git a/src/lib_gui/qt/graphics/base/QtLineItemStraight.h b/src/lib_gui/qt/graphics/base/QtLineItemStraight.h
index 052288c3..079425bc 100644
--- a/src/lib_gui/qt/graphics/base/QtLineItemStraight.h
+++ b/src/lib_gui/qt/graphics/base/QtLineItemStraight.h
@@ -11,7 +11,7 @@ public:
QtLineItemStraight(QGraphicsItem* parent);
virtual ~QtLineItemStraight();
- void updateLine(Vec2i origin, Vec2i target, GraphViewStyle::EdgeStyle style);
+ void updateLine(const Vec2i& origin, const Vec2i& target, const GraphViewStyle::EdgeStyle& style);
virtual QPainterPath shape() const;
};
diff --git a/src/lib_gui/qt/graphics/graph/QtGraphEdge.cpp b/src/lib_gui/qt/graphics/graph/QtGraphEdge.cpp
index 26c02918..fdf6185c 100644
--- a/src/lib_gui/qt/graphics/graph/QtGraphEdge.cpp
+++ b/src/lib_gui/qt/graphics/graph/QtGraphEdge.cpp
@@ -518,7 +518,7 @@ bool QtGraphEdge::isTrailEdge() const
return m_isTrailEdge;
}
-void QtGraphEdge::setIsTrailEdge(std::vector path, bool horizontal)
+void QtGraphEdge::setIsTrailEdge(const std::vector& path, bool horizontal)
{
m_path = path;
m_isTrailEdge = true;
diff --git a/src/lib_gui/qt/graphics/graph/QtGraphEdge.h b/src/lib_gui/qt/graphics/graph/QtGraphEdge.h
index f29a3da3..02975b2c 100644
--- a/src/lib_gui/qt/graphics/graph/QtGraphEdge.h
+++ b/src/lib_gui/qt/graphics/graph/QtGraphEdge.h
@@ -57,7 +57,7 @@ public:
void setDirection(TokenComponentAggregation::Direction direction);
bool isTrailEdge() const;
- void setIsTrailEdge(std::vector path, bool horizontal);
+ void setIsTrailEdge(const std::vector& path, bool horizontal);
void setUseBezier(bool useBezier);
void clearPath();
diff --git a/src/lib_gui/qt/graphics/graph/QtGraphNode.cpp b/src/lib_gui/qt/graphics/graph/QtGraphNode.cpp
index 8cef70cb..dfa1be2d 100644
--- a/src/lib_gui/qt/graphics/graph/QtGraphNode.cpp
+++ b/src/lib_gui/qt/graphics/graph/QtGraphNode.cpp
@@ -143,7 +143,7 @@ QSize QtGraphNode::size() const
return QSize(m_size.x, m_size.y);
}
-void QtGraphNode::setSize(const QSize& size)
+void QtGraphNode::setSize(QSize size)
{
setSize(Vec2i(size.width(), size.height()));
}
@@ -607,8 +607,8 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style)
m_matchText->setPos(
style.iconOffset.x + style.iconSize + style.textOffset.x, style.textOffset.y);
- float charWidth = QFontMetrics(font).width(
- QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")) / 37.0f;
+ float charWidth =
+ QFontMetrics(font).width(QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")) / 37.0f;
float charHeight = QFontMetrics(font).height();
m_matchRect->setRect(
style.iconOffset.x + style.iconSize + style.textOffset.x + m_matchPos * charWidth,
diff --git a/src/lib_gui/qt/graphics/graph/QtGraphNode.h b/src/lib_gui/qt/graphics/graph/QtGraphNode.h
index 0aff8074..4e6fd4ed 100644
--- a/src/lib_gui/qt/graphics/graph/QtGraphNode.h
+++ b/src/lib_gui/qt/graphics/graph/QtGraphNode.h
@@ -51,7 +51,7 @@ public:
void setColumnSize(const Vec2i& size);
QSize size() const;
- void setSize(const QSize& size);
+ void setSize(QSize size);
Vec4i getBoundingRect() const;
diff --git a/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.cpp b/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.cpp
index b8f5a502..fb3fd049 100644
--- a/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.cpp
+++ b/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.cpp
@@ -8,7 +8,7 @@
#include "GraphViewStyle.h"
#include "QtCountCircleItem.h"
-QtGraphNodeBundle::QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, std::wstring name)
+QtGraphNodeBundle::QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, const std::wstring& name)
: QtGraphNode(), m_tokenId(tokenId), m_type(type)
{
this->setName(name);
diff --git a/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.h b/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.h
index 5fcd996b..d1487202 100644
--- a/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.h
+++ b/src/lib_gui/qt/graphics/graph/QtGraphNodeBundle.h
@@ -10,7 +10,7 @@ class QtGraphNodeBundle: public QtGraphNode
{
Q_OBJECT
public:
- QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, std::wstring name);
+ QtGraphNodeBundle(Id tokenId, size_t nodeCount, NodeType type, const std::wstring& name);
virtual ~QtGraphNodeBundle();
// QtGraphNode implementation
diff --git a/src/lib_gui/qt/network/QtRequest.cpp b/src/lib_gui/qt/network/QtRequest.cpp
index b668f537..f0d6e109 100644
--- a/src/lib_gui/qt/network/QtRequest.cpp
+++ b/src/lib_gui/qt/network/QtRequest.cpp
@@ -11,7 +11,7 @@ QtRequest::QtRequest()
QObject::connect(m_networkManager, &QNetworkAccessManager::finished, this, &QtRequest::finished);
}
-void QtRequest::sendRequest(QString url)
+void QtRequest::sendRequest(const QString& url)
{
LOG_INFO_STREAM(<< "send HTTP request: " << url.toStdString());
diff --git a/src/lib_gui/qt/network/QtRequest.h b/src/lib_gui/qt/network/QtRequest.h
index b1484f84..0dea2608 100644
--- a/src/lib_gui/qt/network/QtRequest.h
+++ b/src/lib_gui/qt/network/QtRequest.h
@@ -13,7 +13,7 @@ class QtRequest: public QObject
public:
QtRequest();
- void sendRequest(QString url);
+ void sendRequest(const QString& url);
signals:
void receivedData(QByteArray bytes);
diff --git a/src/lib_gui/qt/network/QtUpdateChecker.cpp b/src/lib_gui/qt/network/QtUpdateChecker.cpp
index be9fda4a..8a303fb5 100644
--- a/src/lib_gui/qt/network/QtUpdateChecker.cpp
+++ b/src/lib_gui/qt/network/QtUpdateChecker.cpp
@@ -37,23 +37,23 @@ void QtUpdateChecker::check(bool force, std::function callback)
appSettings->setUpdateDownloadUrl("");
appSettings->save();
- QString urlString = QStringLiteral("https://www.sourcetrail.com/api/v2/versions/latest");
+ std::string urlString = "https://www.sourcetrail.com/api/v2/versions/latest";
// OS
std::string osString = utility::getOsTypeString();
- urlString += ("?os=" + osString).c_str();
+ urlString += "?os=" + osString;
// architecture
std::string platformString =
(utility::getApplicationArchitectureType() == APPLICATION_ARCHITECTURE_X86_64 ? "64" : "32");
- urlString += ("&platform=" + platformString + "bit").c_str();
+ urlString += "&platform=" + platformString + "bit";
// version
// Version::setApplicationVersion(Version::fromString("2017.3.48")); // for debugging
- urlString += ("&version=" + Version::getApplicationVersion().toDisplayString()).c_str();
+ urlString += "&version=" + Version::getApplicationVersion().toDisplayString();
// license
- urlString += QLatin1String("&license=free"); // options: test, private, commercial
+ urlString += "&license=free"; // options: test, private, commercial
// user token
std::string token = appSettings->getUserToken();
@@ -64,12 +64,12 @@ void QtUpdateChecker::check(bool force, std::function callback)
appSettings->save();
}
- urlString += ("&token=" + token).c_str();
+ urlString += "&token=" + token;
// send request
QtRequest* request = new QtRequest();
QObject::connect(
- request, &QtRequest::receivedData, [force, callback, request](QByteArray bytes) {
+ request, &QtRequest::receivedData, [force, callback, request](const QByteArray& bytes) {
Result result;
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
@@ -131,8 +131,10 @@ void QtUpdateChecker::check(bool force, std::function callback)
"Sourcetrail " + version + " is available for download: " + url + "");
msgBox.addButton(QStringLiteral("Close"), QMessageBox::ButtonRole::NoRole);
- msgBox.addButton(QStringLiteral("Skip this Version"), QMessageBox::ButtonRole::NoRole);
- QPushButton* but = msgBox.addButton(QStringLiteral("Download"), QMessageBox::ButtonRole::YesRole);
+ msgBox.addButton(
+ QStringLiteral("Skip this Version"), QMessageBox::ButtonRole::NoRole);
+ QPushButton* but = msgBox.addButton(
+ QStringLiteral("Download"), QMessageBox::ButtonRole::YesRole);
msgBox.setDefaultButton(but);
int val = msgBox.exec();
@@ -167,7 +169,7 @@ void QtUpdateChecker::check(bool force, std::function callback)
callback(result);
});
- request->sendRequest(urlString);
+ request->sendRequest(QString::fromStdString(urlString));
MessageStatus(L"Checking for new version", false, true).dispatch();
}
diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp
index d3a7b24a..f790c22a 100644
--- a/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp
+++ b/src/lib_gui/qt/project_wizard/QtProjectWizard.cpp
@@ -734,7 +734,7 @@ void QtProjectWizard::selectedSourceGroupChanged(int index)
m_previouslySelectedIndex = index;
}
-void QtProjectWizard::selectedSourceGroupNameChanged(QString name)
+void QtProjectWizard::selectedSourceGroupNameChanged(const QString& name)
{
m_sourceGroupList->item(m_sourceGroupList->currentRow())->setText(name);
}
@@ -806,7 +806,8 @@ void QtProjectWizard::duplicateSelectedSourceGroup()
newName = newNameBase + (id > 0 ? " (" + std::to_string(id) + ")" : "");
bool nameAlreadyExists = false;
- for (std::shared_ptr sourceGroupSettings: m_allSourceGroupSettings)
+ for (const std::shared_ptr& sourceGroupSettings:
+ m_allSourceGroupSettings)
{
if (sourceGroupSettings && sourceGroupSettings->getName() == newName)
{
@@ -1013,11 +1014,11 @@ void QtProjectWizard::createProject()
MessageStatus(L"Unable to save project to location: " + path.wstr()).dispatch();
QMessageBox msgBox(this);
- msgBox.setText("Could not create Project");
+ msgBox.setText(QStringLiteral("Could not create Project"));
msgBox.setInformativeText(QString::fromStdWString(
L"Sourcetrail was unable to save the project to the specified path. Please pick a "
L"different project location.
"));
- msgBox.addButton("Ok", QMessageBox::ButtonRole::AcceptRole);
+ msgBox.addButton(QStringLiteral("Ok"), QMessageBox::ButtonRole::AcceptRole);
msgBox.exec();
return;
diff --git a/src/lib_gui/qt/project_wizard/QtProjectWizard.h b/src/lib_gui/qt/project_wizard/QtProjectWizard.h
index 289c4f72..eb1ccf34 100644
--- a/src/lib_gui/qt/project_wizard/QtProjectWizard.h
+++ b/src/lib_gui/qt/project_wizard/QtProjectWizard.h
@@ -63,7 +63,7 @@ private:
private slots:
void generalButtonClicked();
void selectedSourceGroupChanged(int index);
- void selectedSourceGroupNameChanged(QString name);
+ void selectedSourceGroupNameChanged(const QString& name);
void removeSelectedSourceGroup();
void duplicateSelectedSourceGroup();
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp
index 7e484de2..aaa3a499 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.cpp
@@ -54,7 +54,7 @@ void QtProjectWizardContent::setIsRequired(bool isRequired)
m_isRequired = isRequired;
}
-QLabel* QtProjectWizardContent::createFormTitle(QString name) const
+QLabel* QtProjectWizardContent::createFormTitle(const QString& name) const
{
QLabel* label = new QLabel(name);
label->setObjectName(QStringLiteral("titleLabel"));
@@ -72,7 +72,7 @@ QLabel* QtProjectWizardContent::createFormLabel(QString name) const
return createFormSubLabel(name);
}
-QLabel* QtProjectWizardContent::createFormSubLabel(QString name) const
+QLabel* QtProjectWizardContent::createFormSubLabel(const QString& name) const
{
QLabel* label = new QLabel(name);
label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
@@ -81,7 +81,8 @@ QLabel* QtProjectWizardContent::createFormSubLabel(QString name) const
return label;
}
-QToolButton* QtProjectWizardContent::createSourceGroupButton(QString name, QString iconPath) const
+QToolButton* QtProjectWizardContent::createSourceGroupButton(
+ const QString& name, const QString& iconPath) const
{
QToolButton* button = new QToolButton();
button->setObjectName(QStringLiteral("sourceGroupButton"));
@@ -102,7 +103,7 @@ QtHelpButton* QtProjectWizardContent::addHelpButton(
return button;
}
-QPushButton* QtProjectWizardContent::addFilesButton(QString name, QGridLayout* layout, int row) const
+QPushButton* QtProjectWizardContent::addFilesButton(const QString& name, QGridLayout* layout, int row) const
{
QPushButton* button = new QPushButton(name);
button->setObjectName(QStringLiteral("windowButton"));
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h
index cbbf3aee..8ef8a692 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContent.h
@@ -36,14 +36,14 @@ public:
void setIsRequired(bool isRequired);
protected:
- QLabel* createFormTitle(QString name) const;
+ QLabel* createFormTitle(const QString& name) const;
QLabel* createFormLabel(QString name) const;
- QLabel* createFormSubLabel(QString name) const;
- QToolButton* createSourceGroupButton(QString name, QString iconPath) const;
+ QLabel* createFormSubLabel(const QString& name) const;
+ QToolButton* createSourceGroupButton(const QString& name, const QString& iconPath) const;
QtHelpButton* addHelpButton(
const QString& helpTitle, const QString& helpText, QGridLayout* layout, int row) const;
- QPushButton* addFilesButton(QString name, QGridLayout* layout, int row) const;
+ QPushButton* addFilesButton(const QString& name, QGridLayout* layout, int row) const;
QFrame* addSeparator(QGridLayout* layout, int row) const;
QtProjectWizardWindow* m_window;
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp
index 9b69724a..21922a09 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCStandard.cpp
@@ -16,7 +16,10 @@ void QtProjectWizardContentCStandard::populate(QGridLayout* layout, int& row)
{
m_standard = new QComboBox();
layout->addWidget(
- createFormLabel("C Standard"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
+ createFormLabel(QStringLiteral("C Standard")),
+ row,
+ QtProjectWizardWindow::FRONT_COL,
+ Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft);
row++;
}
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp
index af4bd953..b80c7a7e 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCppStandard.cpp
@@ -16,7 +16,10 @@ void QtProjectWizardContentCppStandard::populate(QGridLayout* layout, int& row)
{
m_standard = new QComboBox();
layout->addWidget(
- createFormLabel("C++ Standard"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
+ createFormLabel(QStringLiteral("C++ Standard")),
+ row,
+ QtProjectWizardWindow::FRONT_COL,
+ Qt::AlignRight);
layout->addWidget(m_standard, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft);
row++;
}
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp
index 05bfb8d5..571b8206 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCrossCompilationOptions.cpp
@@ -26,14 +26,16 @@ void QtProjectWizardContentCrossCompilationOptions::populate(QGridLayout* layout
createFormLabel("Cross-Compilation"), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
addHelpButton(
"Cross-Compilation",
- "Use these options to specify the target architecture for the provided source code. "
- "Even though Sourcetrail will "
- "not generate a target binary, providing these options will affect which headers the "
- "indexer will be looking for "
- "while analyzing your source code.
"
- "If you are not sure which value to pick for a certain option just choose \"unknown\" "
- "and Sourcetrail will try "
- "to guess the correct value.
",
+ QStringLiteral(
+ "Use these options to specify the target architecture for the provided source code. "
+ "Even though Sourcetrail will "
+ "not generate a target binary, providing these options will affect which headers the "
+ "indexer will be looking for "
+ "while analyzing your source code.
"
+ "If you are not sure which value to pick for a certain option just choose "
+ "\"unknown\" "
+ "and Sourcetrail will try "
+ "to guess the correct value.
"),
layout,
row);
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp
index e29c76b7..e3c99f78 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentCxxPchFlags.cpp
@@ -16,32 +16,36 @@ QtProjectWizardContentCxxPchFlags::QtProjectWizardContentCxxPchFlags(
void QtProjectWizardContentCxxPchFlags::populate(QGridLayout* layout, int& row)
{
- const QString labelText("Precompiled Header Flags");
+ const QString labelText(QStringLiteral("Precompiled Header Flags"));
layout->addWidget(
createFormLabel(labelText), row, QtProjectWizardWindow::FRONT_COL, 2, 1, Qt::AlignTop);
const QString optionText(
- m_isCDB ? "Use flags of first indexed file and 'Additional Compiler Flags'"
- : "Use 'Compiler Flags'");
+ m_isCDB ? QStringLiteral("Use flags of first indexed file and 'Additional Compiler Flags'")
+ : QStringLiteral("Use 'Compiler Flags'"));
const QString optionHelp(
- m_isCDB
- ? "Check " + optionText +
- " to use the flags specified "
- "in the first compile command of the Compilation Database and all flags specified "
- "at 'Additional Compiler Flags'."
- : "Check " + optionText + " to reuse the flags specified at 'Compiler Flags'.");
+ m_isCDB ? QStringLiteral("Check ") + optionText +
+ QStringLiteral(" to use the flags specified "
+ "in the first compile command of the Compilation Database and all "
+ "flags specified "
+ "at 'Additional Compiler Flags'.")
+ : QStringLiteral("Check ") + optionText +
+ QStringLiteral(" to reuse the flags specified at 'Compiler Flags'."));
addHelpButton(
- "Precompiled Header Flags",
- "Define compiler flags used during precompiled header file generation.
"
- "" +
+ QStringLiteral("Precompiled Header Flags"),
+ QStringLiteral(
+ "
Define compiler flags used during precompiled header file generation.
"
+ "") +
optionHelp +
- "
"
- "Additionally add compiler flags to the list for precompiled header generation "
- "only. Some examples:
"
- "* use \"-DRELEASE\" to add a preprocessor #define for \"RELEASE\"
"
- "* use \"-U__clang__\" to remove the preprocessor #define for \"__clang__\"
",
+ QStringLiteral(
+ "
"
+ "Additionally add compiler flags to the list for precompiled header generation "
+ "only. Some examples:
"
+ "* use \"-DRELEASE\" to add a preprocessor #define for \"RELEASE\"
"
+ "* use \"-U__clang__\" to remove the preprocessor #define for "
+ "\"__clang__\"
"),
layout,
row);
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp
index 66df69da..8785a1c3 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentFlags.cpp
@@ -25,10 +25,11 @@ void QtProjectWizardContentFlags::populate(QGridLayout* layout, int& row)
addHelpButton(
labelText,
- "Define additional Clang compiler flags used during indexing. Here are some "
- "examples:
"
- "use \"-DRELEASE\" to add a preprocessor #define for \"RELEASE\"
"
- "use \"-U__clang__\" to remove the preprocessor #define for \"__clang__\"
",
+ QStringLiteral(
+ "Define additional Clang compiler flags used during indexing. Here are some "
+ "examples:
"
+ "use \"-DRELEASE\" to add a preprocessor #define for \"RELEASE\"
"
+ "use \"-U__clang__\" to remove the preprocessor #define for \"__clang__\"
"),
layout,
row);
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp
index 66325fcd..d821483a 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.cpp
@@ -9,11 +9,11 @@
#include
#include "ApplicationSettings.h"
+#include "FileLogger.h"
#include "FileSystem.h"
#include "MessageSwitchColorScheme.h"
#include "ResourcePaths.h"
#include "logging.h"
-#include "FileLogger.h"
#include "utility.h"
#include "utilityApp.h"
#include "utilityPathDetection.h"
@@ -68,7 +68,12 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
// font size
m_fontSize = addComboBox(
- QStringLiteral("Font Size"), appSettings->getFontSizeMin(), appSettings->getFontSizeMax(), QLatin1String(""), layout, row);
+ QStringLiteral("Font Size"),
+ appSettings->getFontSizeMin(),
+ appSettings->getFontSizeMax(),
+ QLatin1String(""),
+ layout,
+ row);
// tab width
m_tabWidth = addComboBox(QStringLiteral("Tab Width"), 1, 16, QLatin1String(""), layout, row);
@@ -113,8 +118,9 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_showDirectoryInCode = addCheckBox(
QStringLiteral("Directory in File Title"),
QStringLiteral("Show directory of file in code title"),
- QStringLiteral("Enable display of the parent directory of a code file relative to the project "
- "file.
"),
+ QStringLiteral(
+ "Enable display of the parent directory of a code file relative to the project "
+ "file.
"),
layout,
row);
layout->setRowMinimumHeight(row - 1, 30);
@@ -136,13 +142,17 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_screenAutoScalingInfoLabel = new QLabel(QLatin1String(""));
m_screenAutoScaling = addComboBoxWithWidgets(
QStringLiteral("Auto Scaling to DPI"),
- QStringLiteral("Define if automatic scaling to screen DPI resolution is active. "
- "This setting manipulates the environment flag QT_AUTO_SCREEN_SCALE_FACTOR of the Qt "
- "framework "
- "(http://doc.qt.io/qt-5/highdpi.html). "
- "Choose 'system' to stick to the setting of your current environment.
"
- "Changes to this setting require a restart of the application to take effect.
"),
+ QStringLiteral(
+ "Define if automatic scaling to screen DPI resolution is active. "
+ "This setting manipulates the environment flag QT_AUTO_SCREEN_SCALE_FACTOR of the "
+ "Qt "
+ "framework "
+ "(http://doc.qt.io/qt-5/highdpi.html"
+ "a>). "
+ "Choose 'system' to stick to the setting of your current environment.
"
+ "Changes to this setting require a restart of the application to take "
+ "effect.
"),
{m_screenAutoScalingInfoLabel},
layout,
row);
@@ -159,12 +169,15 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_screenScaleFactorInfoLabel = new QLabel(QLatin1String(""));
m_screenScaleFactor = addComboBoxWithWidgets(
QStringLiteral("Scale Factor"),
- QStringLiteral("Define a screen scale factor for the user interface of the application. "
- "This setting manipulates the environment flag QT_SCALE_FACTOR of the Qt framework "
- "(http://doc.qt.io/qt-5/highdpi.html). "
- "Choose 'system' to stick to the setting of your current environment.
"
- "Changes to this setting require a restart of the application to take effect.
"),
+ QStringLiteral(
+ "Define a screen scale factor for the user interface of the application. "
+ "This setting manipulates the environment flag QT_SCALE_FACTOR of the Qt framework "
+ "(http://doc.qt.io/qt-5/highdpi.html"
+ "a>). "
+ "Choose 'system' to stick to the setting of your current environment.
"
+ "Changes to this setting require a restart of the application to take "
+ "effect.
"),
{m_screenScaleFactorInfoLabel},
layout,
row);
@@ -195,19 +208,21 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
// scroll speed
m_scrollSpeed = addLineEdit(
QStringLiteral("Scroll Speed"),
- QStringLiteral("Set a multiplier for the in app scroll speed.
"
- "A value between 0 and 1 results in slower scrolling while a value higher than 1 "
- "increases scroll speed.
"),
+ QStringLiteral(
+ "Set a multiplier for the in app scroll speed.
"
+ "A value between 0 and 1 results in slower scrolling while a value higher than 1 "
+ "increases scroll speed.
"),
layout,
row);
// graph zooming
- QString modifierName = utility::getOsType() == OS_MAC ? QStringLiteral("Cmd") : QStringLiteral("Ctrl");
+ QString modifierName = utility::getOsType() == OS_MAC ? QStringLiteral("Cmd")
+ : QStringLiteral("Ctrl");
m_graphZooming = addCheckBox(
QStringLiteral("Graph Zoom"),
QStringLiteral("Zoom graph on mouse wheel"),
- QStringLiteral("Enable graph zoom using mouse wheel only, instead of using ") + modifierName +
- QStringLiteral(" + Mouse Wheel.
"),
+ QStringLiteral("Enable graph zoom using mouse wheel only, instead of using ") +
+ modifierName + QStringLiteral(" + Mouse Wheel.
"),
layout,
row);
@@ -232,10 +247,11 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_verboseIndexerLoggingEnabled = addCheckBox(
QStringLiteral("Indexer Logging"),
QStringLiteral("Enable verbose indexer logging"),
- QStringLiteral("Enable additional logs of abstract syntax tree traversal during indexing. This "
- "information can help "
- "tracking down crashes that occurr during indexing.
"
- "Warning: This slows down indexing performance a lot.
"),
+ QStringLiteral(
+ "Enable additional logs of abstract syntax tree traversal during indexing. This "
+ "information can help "
+ "tracking down crashes that occurr during indexing.
"
+ "Warning: This slows down indexing performance a lot.
"),
layout,
row);
@@ -258,10 +274,11 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_automaticUpdateCheck = addCheckBox(
QStringLiteral("Automatic
Update Check"),
QStringLiteral("Check automatically for updates"),
- QStringLiteral("Automatically connects to the Sourcetrail server once a day to check "
- "if a new release is available.
"
- "Note: No personally identifiable information will be transmitted to conduct this "
- "check.
"),
+ QStringLiteral(
+ "Automatically connects to the Sourcetrail server once a day to check "
+ "if a new release is available.
"
+ "Note: No personally identifiable information will be transmitted to conduct this "
+ "check.
"),
layout,
row);
addGap(layout, row);
@@ -272,14 +289,16 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
// Sourcetrail port
m_sourcetrailPort = addLineEdit(
QStringLiteral("Sourcetrail Port"),
- QStringLiteral("Port number that Sourcetrail uses to listen for incoming messages from plugins.
"),
+ QStringLiteral("Port number that Sourcetrail uses to listen for incoming messages from "
+ "plugins.
"),
layout,
row);
// Sourcetrail port
m_pluginPort = addLineEdit(
QStringLiteral("Plugin Port"),
- QStringLiteral("Port number that Sourcetrail uses to sends outgoing messages to plugins.
"),
+ QStringLiteral(
+ "Port number that Sourcetrail uses to sends outgoing messages to plugins.
"),
layout,
row);
@@ -295,7 +314,8 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
QStringLiteral("Indexer Threads"),
0,
24,
- QStringLiteral("Set the number of threads used to work on indexing your project in parallel.
"),
+ QStringLiteral(
+ "Set the number of threads used to work on indexing your project in parallel.
"),
{m_threadsInfoLabel},
layout,
row);
@@ -310,9 +330,10 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_multiProcessIndexing = addCheckBox(
QStringLiteral("Multi Process
C/C++ Indexing"),
QStringLiteral("Run C/C++ indexer threads in different process"),
- QStringLiteral("Enable C/C++ indexer threads to run in different process.
"
- "This prevents the application from crashing due to unforseen exceptions while "
- "indexing.
"),
+ QStringLiteral(
+ "Enable C/C++ indexer threads to run in different process.
"
+ "This prevents the application from crashing due to unforseen exceptions while "
+ "indexing.
"),
layout,
row);
@@ -333,12 +354,15 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_javaPath->setPlaceholderText(QStringLiteral("/bin/client/jvm.dll"));
break;
case OS_MAC:
- m_javaPath->setFileFilter(QStringLiteral("JLI or JVM Library (libjli.dylib libjvm.dylib)"));
- m_javaPath->setPlaceholderText(QStringLiteral("/Contents/Home/jre/lib/jli/libjli.dylib"));
+ m_javaPath->setFileFilter(
+ QStringLiteral("JLI or JVM Library (libjli.dylib libjvm.dylib)"));
+ m_javaPath->setPlaceholderText(
+ QStringLiteral("/Contents/Home/jre/lib/jli/libjli.dylib"));
break;
case OS_LINUX:
m_javaPath->setFileFilter(QStringLiteral("JVM Library (libjvm.so)"));
- m_javaPath->setPlaceholderText(QStringLiteral("/bin//server/libjvm.so"));
+ m_javaPath->setPlaceholderText(
+ QStringLiteral("/bin//server/libjvm.so"));
break;
default:
LOG_WARNING("No placeholders and filters set for Java path selection");
@@ -381,8 +405,9 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
addHelpButton(
QStringLiteral("JRE System Library"),
QStringLiteral("Only required for indexing Java projects.
"
- "Add the jar files of your JRE System Library. These jars can be found inside your "
- "JRE install directory.
"),
+ "Add the jar files of your JRE System Library. These jars can be "
+ "found inside your "
+ "JRE install directory.
"),
layout,
row);
@@ -415,8 +440,9 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
addHelpButton(
QStringLiteral("Maven Path"),
QStringLiteral("Only required for indexing projects using Maven.
"
- "Provide the location of your installed Maven executable. You can also use the auto "
- "detection below.
"),
+ "Provide the location of your installed Maven executable. You can "
+ "also use the auto "
+ "detection below.
"),
layout,
row);
row++;
@@ -433,13 +459,16 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
m_pythonPostProcessing = addCheckBox(
QStringLiteral("Post Processing"),
QStringLiteral("Add ambiguous edges for unsolved references (recommended)"),
- QStringLiteral("Enable a post processing step to solve unsolved references after the indexing is done. "
- "
"
- "These references will be marked \"ambiguous\" to indicate that some of these edges may "
- "never "
- "be encountered during runtime of the indexed code because the post processing only relies "
- "on "
- "symbol names and types.
"),
+ QStringLiteral("Enable a post processing step to solve unsolved references after the "
+ "indexing is done. "
+ "
"
+ "These references will be marked \"ambiguous\" to indicate that some of "
+ "these edges may "
+ "never "
+ "be encountered during runtime of the indexed code because the post "
+ "processing only relies "
+ "on "
+ "symbol names and types.
"),
layout,
row);
@@ -682,7 +711,7 @@ void QtProjectWizardContentPreferences::uiAutoScalingChanges(int index)
}
m_screenAutoScalingInfoLabel->setText(
- QStringLiteral("detected: '") + autoScale + QStringLiteral("'"));
+ QStringLiteral("detected: '") + autoScale + QStringLiteral("'"));
m_screenAutoScalingInfoLabel->show();
}
else
@@ -704,7 +733,7 @@ void QtProjectWizardContentPreferences::uiScaleFactorChanges(int index)
}
m_screenScaleFactorInfoLabel->setText(
- QStringLiteral("detected: '") + scale + QStringLiteral("%'"));
+ QStringLiteral("detected: '") + scale + QStringLiteral("%'"));
m_screenScaleFactorInfoLabel->show();
}
else
@@ -831,12 +860,12 @@ void QtProjectWizardContentPreferences::addMavenPathDetection(QGridLayout* layou
row++;
}
-void QtProjectWizardContentPreferences::addTitle(QString title, QGridLayout* layout, int& row)
+void QtProjectWizardContentPreferences::addTitle(const QString& title, QGridLayout* layout, int& row)
{
layout->addWidget(createFormTitle(title), row++, QtProjectWizardWindow::FRONT_COL, Qt::AlignLeft);
}
-void QtProjectWizardContentPreferences::addLabel(QString label, QGridLayout* layout, int row)
+void QtProjectWizardContentPreferences::addLabel(const QString& label, QGridLayout* layout, int row)
{
layout->addWidget(createFormLabel(label), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
}
@@ -848,7 +877,7 @@ void QtProjectWizardContentPreferences::addWidget(
}
void QtProjectWizardContentPreferences::addLabelAndWidget(
- QString label, QWidget* widget, QGridLayout* layout, int row, Qt::Alignment widgetAlignment)
+ const QString& label, QWidget* widget, QGridLayout* layout, int row, Qt::Alignment widgetAlignment)
{
addLabel(label, layout, row);
addWidget(widget, layout, row, widgetAlignment);
@@ -860,7 +889,7 @@ void QtProjectWizardContentPreferences::addGap(QGridLayout* layout, int& row)
}
QCheckBox* QtProjectWizardContentPreferences::addCheckBox(
- QString label, QString text, QString helpText, QGridLayout* layout, int& row)
+ const QString& label, const QString& text, const QString& helpText, QGridLayout* layout, int& row)
{
QCheckBox* checkBox = new QCheckBox(text, this);
addLabelAndWidget(label, checkBox, layout, row, Qt::AlignLeft);
@@ -876,7 +905,7 @@ QCheckBox* QtProjectWizardContentPreferences::addCheckBox(
}
QComboBox* QtProjectWizardContentPreferences::addComboBox(
- QString label, QString helpText, QGridLayout* layout, int& row)
+ const QString& label, const QString& helpText, QGridLayout* layout, int& row)
{
QComboBox* comboBox = new QComboBox(this);
addLabelAndWidget(label, comboBox, layout, row, Qt::AlignLeft);
@@ -892,7 +921,11 @@ QComboBox* QtProjectWizardContentPreferences::addComboBox(
}
QComboBox* QtProjectWizardContentPreferences::addComboBoxWithWidgets(
- QString label, QString helpText, std::vector widgets, QGridLayout* layout, int& row)
+ const QString& label,
+ const QString& helpText,
+ std::vector widgets,
+ QGridLayout* layout,
+ int& row)
{
QComboBox* comboBox = new QComboBox(this);
@@ -921,7 +954,7 @@ QComboBox* QtProjectWizardContentPreferences::addComboBoxWithWidgets(
}
QComboBox* QtProjectWizardContentPreferences::addComboBox(
- QString label, int min, int max, QString helpText, QGridLayout* layout, int& row)
+ const QString& label, int min, int max, const QString& helpText, QGridLayout* layout, int& row)
{
QComboBox* comboBox = addComboBox(label, helpText, layout, row);
@@ -937,10 +970,10 @@ QComboBox* QtProjectWizardContentPreferences::addComboBox(
}
QComboBox* QtProjectWizardContentPreferences::addComboBoxWithWidgets(
- QString label,
+ const QString& label,
int min,
int max,
- QString helpText,
+ const QString& helpText,
std::vector widgets,
QGridLayout* layout,
int& row)
@@ -959,7 +992,7 @@ QComboBox* QtProjectWizardContentPreferences::addComboBoxWithWidgets(
}
QLineEdit* QtProjectWizardContentPreferences::addLineEdit(
- QString label, QString helpText, QGridLayout* layout, int& row)
+ const QString& label, const QString& helpText, QGridLayout* layout, int& row)
{
QLineEdit* lineEdit = new QLineEdit(this);
lineEdit->setObjectName(QStringLiteral("name"));
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h
index ff821960..876cd247 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h
@@ -59,33 +59,42 @@ private:
void addJreSystemLibraryPathsDetection(QGridLayout* layout, int& row);
void addMavenPathDetection(QGridLayout* layout, int& row);
- void addTitle(QString title, QGridLayout* layout, int& row);
- void addLabel(QString label, QGridLayout* layout, int row);
+ void addTitle(const QString& title, QGridLayout* layout, int& row);
+ void addLabel(const QString& label, QGridLayout* layout, int row);
void addWidget(
QWidget* widget, QGridLayout* layout, int row, Qt::Alignment widgetAlignment = Qt::Alignment());
void addLabelAndWidget(
- QString label,
+ const QString& label,
QWidget* widget,
QGridLayout* layout,
int row,
Qt::Alignment widgetAlignment = Qt::Alignment());
void addGap(QGridLayout* layout, int& row);
- QCheckBox* addCheckBox(QString label, QString text, QString helpText, QGridLayout* layout, int& row);
- QComboBox* addComboBox(QString label, QString helpText, QGridLayout* layout, int& row);
+ QCheckBox* addCheckBox(
+ const QString& label,
+ const QString& text,
+ const QString& helpText,
+ QGridLayout* layout,
+ int& row);
+ QComboBox* addComboBox(const QString& label, const QString& helpText, QGridLayout* layout, int& row);
QComboBox* addComboBoxWithWidgets(
- QString label, QString helpText, std::vector widgets, QGridLayout* layout, int& row);
- QComboBox* addComboBox(
- QString label, int min, int max, QString helpText, QGridLayout* layout, int& row);
- QComboBox* addComboBoxWithWidgets(
- QString label,
- int min,
- int max,
- QString helpText,
+ const QString& label,
+ const QString& helpText,
std::vector widgets,
QGridLayout* layout,
int& row);
- QLineEdit* addLineEdit(QString label, QString helpText, QGridLayout* layout, int& row);
+ QComboBox* addComboBox(
+ const QString& label, int min, int max, const QString& helpText, QGridLayout* layout, int& row);
+ QComboBox* addComboBoxWithWidgets(
+ const QString& label,
+ int min,
+ int max,
+ const QString& helpText,
+ std::vector widgets,
+ QGridLayout* layout,
+ int& row);
+ QLineEdit* addLineEdit(const QString& label, const QString& helpText, QGridLayout* layout, int& row);
QFontComboBox* m_fontFace;
QtComboBoxPlaceHolder* m_fontFacePlaceHolder;
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp
index 4e9e0e20..1dc9f5ff 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSelect.cpp
@@ -194,8 +194,8 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
m_window->setNextEnabled(false);
m_title->setText("Source Group Types - " + m_languages->checkedButton()->text());
- m_description->setText(hasRecommeded ?
- QStringLiteral("* recommended") : QLatin1String(""));
+ m_description->setText(
+ hasRecommeded ? QStringLiteral("* recommended") : QLatin1String(""));
});
QtFlowLayout* flayout = new QtFlowLayout(10, 0, 0);
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp
index f335af47..c25ecc87 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentSourceGroupData.cpp
@@ -21,7 +21,10 @@ void QtProjectWizardContentSourceGroupData::populate(QGridLayout* layout, int& r
connect(m_name, &QLineEdit::textEdited, this, &QtProjectWizardContentSourceGroupData::editedName);
layout->addWidget(
- createFormLabel(QStringLiteral("Source Group Name")), row, QtProjectWizardWindow::FRONT_COL, Qt::AlignRight);
+ createFormLabel(QStringLiteral("Source Group Name")),
+ row,
+ QtProjectWizardWindow::FRONT_COL,
+ Qt::AlignRight);
layout->addWidget(m_name, row, QtProjectWizardWindow::BACK_COL);
row++;
diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp
index 21fc5c1a..8e4c4088 100644
--- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp
+++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentVS.cpp
@@ -10,37 +10,36 @@ QtProjectWizardContentVS::QtProjectWizardContentVS(QtProjectWizardWindow* window
void QtProjectWizardContentVS::populate(QGridLayout* layout, int& row)
{
layout->setRowMinimumHeight(row++, 10);
-
- QLabel* nameLabel = createFormLabel("Create Compilation Database");
+ QLabel* nameLabel = createFormLabel(QStringLiteral("Create Compilation Database"));
layout->addWidget(nameLabel, row, QtProjectWizardWindow::FRONT_COL);
addHelpButton(
- "Create Compilation Database",
- "To create a new Compilation Database from a Visual Studio Solution, a Solution has to be open in Visual "
+ QStringLiteral("Create Compilation Database"),
+ QStringLiteral("To create a new Compilation Database from a Visual Studio Solution, a Solution has to be open in Visual "
"Studio.\n Sourcetrail will call Visual Studio to open the 'Create Compilation Database' dialog. Please follow "
"the instructions in Visual Studio to complete the process.\n Note: Sourcetrail's Visual Studio plugin has to "
- "be installed. Visual Studio has to be running with an eligible Solution, containing C/C++ projects, loaded.",
+ "be installed. Visual Studio has to be running with an eligible Solution, containing C/C++ projects, loaded."),
layout,
row);
- QLabel* descriptionLabel = createFormSubLabel(
- "Call Visual Studio to create a Compilation Database from the loaded Solution (requires installed "
+ QLabel* descriptionLabel = createFormSubLabel(
+ QStringLiteral("Call Visual Studio to create a Compilation Database from the loaded Solution (requires installed "
"Sourcetrail Visual Studio "
- "Extension).");
- descriptionLabel->setObjectName("description");
+ "Extension)."));
+ descriptionLabel->setObjectName(QStringLiteral("description"));
descriptionLabel->setOpenExternalLinks(true);
descriptionLabel->setAlignment(Qt::AlignmentFlag::AlignLeft);
layout->addWidget(descriptionLabel, row, QtProjectWizardWindow::BACK_COL);
row++;
- QPushButton* button = new QPushButton("Create Compilation Database");
- button->setObjectName("windowButton");
+ QPushButton* button = new QPushButton(QStringLiteral("Create Compilation Database"));
+ button->setObjectName(QStringLiteral("windowButton"));
layout->addWidget(button, row, QtProjectWizardWindow::BACK_COL);
row++;
- QLabel* skipLabel = createFormSubLabel(
- "*Skip this step if you already have a Compilation Database for your Solution.");
- skipLabel->setObjectName("description");
+ QLabel* skipLabel = createFormLabel(QStringLiteral(
+ "*Skip this step if you already have a Compilation Database for your Solution."));
+ skipLabel->setObjectName(QStringLiteral("description"));
skipLabel->setAlignment(Qt::AlignmentFlag::AlignLeft);
layout->addWidget(skipLabel, row, QtProjectWizardWindow::BACK_COL);
row++;
diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp
index 93644e75..b96db0fe 100644
--- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp
+++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCDB.cpp
@@ -15,7 +15,7 @@ QtProjectWizardContentPathCDB::QtProjectWizardContentPathCDB(
m_settings->getProjectDirectoryPath());
})
{
- setTitleString("Compilation Database (compile_commands.json)");
+ setTitleString(QStringLiteral("Compilation Database (compile_commands.json)"));
setHelpString(
"Select the compilation database file for the project. Sourcetrail will index your project "
"based on the compile "
@@ -32,7 +32,7 @@ void QtProjectWizardContentPathCDB::populate(QGridLayout* layout, int& row)
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
- m_picker->setFileFilter("JSON Compilation Database (*.json)");
+ m_picker->setFileFilter(QStringLiteral("JSON Compilation Database (*.json)"));
connect(
m_picker, &QtLocationPicker::locationPicked, this, &QtProjectWizardContentPathCDB::pickedPath);
connect(
@@ -46,21 +46,21 @@ void QtProjectWizardContentPathCDB::populate(QGridLayout* layout, int& row)
"and stay up-to-date "
"with changes on refresh.",
this);
- description->setObjectName("description");
+ description->setObjectName(QStringLiteral("description"));
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizardWindow::BACK_COL);
row++;
- QLabel* title = createFormSubLabel("Source Files to Index");
+ QLabel* title = createFormSubLabel(QStringLiteral("Source Files to Index"));
layout->addWidget(title, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
- m_fileCountLabel = new QLabel("");
+ m_fileCountLabel = new QLabel(QLatin1String(""));
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
row++;
- addFilesButton("show source files", layout, row);
+ addFilesButton(QStringLiteral("show source files"), layout, row);
row++;
}
@@ -95,12 +95,12 @@ std::vector QtProjectWizardContentPathCDB::getFilePaths() const
QString QtProjectWizardContentPathCDB::getFileNamesTitle() const
{
- return "Source Files";
+ return QStringLiteral("Source Files");
}
QString QtProjectWizardContentPathCDB::getFileNamesDescription() const
{
- return " source files will be indexed.";
+ return QStringLiteral(" source files will be indexed.");
}
void QtProjectWizardContentPathCDB::pickedPath()
diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp
index f5444cab..379c8a2b 100644
--- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp
+++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCodeblocksProject.cpp
@@ -14,7 +14,7 @@ QtProjectWizardContentPathCodeblocksProject::QtProjectWizardContentPathCodeblock
m_settings->getProjectDirectoryPath());
})
{
- setTitleString("Code::Blocks Project (.cbp)");
+ setTitleString(QStringLiteral("Code::Blocks Project (.cbp)"));
setHelpString(
"Select the Code::Blocks file for the project. Sourcetrail will index your project based "
"on the settings "
@@ -31,7 +31,7 @@ void QtProjectWizardContentPathCodeblocksProject::populate(QGridLayout* layout,
{
QtProjectWizardContentPath::populate(layout, row);
m_picker->setPickDirectory(false);
- m_picker->setFileFilter("Code::Blocks Project (*.cbp)");
+ m_picker->setFileFilter(QStringLiteral("Code::Blocks Project (*.cbp)"));
connect(
m_picker,
&QtLocationPicker::locationPicked,
@@ -42,21 +42,21 @@ void QtProjectWizardContentPathCodeblocksProject::populate(QGridLayout* layout,
"Sourcetrail will use all settings from the Code::Blocks project and stay up-to-date with "
"changes on refresh.",
this);
- description->setObjectName("description");
+ description->setObjectName(QStringLiteral("description"));
description->setWordWrap(true);
layout->addWidget(description, row, QtProjectWizardWindow::BACK_COL);
row++;
- QLabel* title = createFormSubLabel("Source Files to Index");
+ QLabel* title = createFormSubLabel(QStringLiteral("Source Files to Index"));
layout->addWidget(title, row, QtProjectWizardWindow::FRONT_COL, Qt::AlignTop);
layout->setRowStretch(row, 0);
- m_fileCountLabel = new QLabel("");
+ m_fileCountLabel = new QLabel(QLatin1String(""));
m_fileCountLabel->setWordWrap(true);
layout->addWidget(m_fileCountLabel, row, QtProjectWizardWindow::BACK_COL, Qt::AlignTop);
row++;
- addFilesButton("show source files", layout, row);
+ addFilesButton(QStringLiteral("show source files"), layout, row);
row++;
}
@@ -86,12 +86,12 @@ std::vector QtProjectWizardContentPathCodeblocksProject::getFilePaths(
QString QtProjectWizardContentPathCodeblocksProject::getFileNamesTitle() const
{
- return "Source Files";
+ return QStringLiteral("Source Files");
}
QString QtProjectWizardContentPathCodeblocksProject::getFileNamesDescription() const
{
- return " source files will be indexed.";
+ return QStringLiteral(" source files will be indexed.");
}
void QtProjectWizardContentPathCodeblocksProject::pickedPath()
diff --git a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp
index b9f9a381..ff4c6377 100644
--- a/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp
+++ b/src/lib_gui/qt/project_wizard/content/path/QtProjectWizardContentPathCxxPch.cpp
@@ -15,7 +15,7 @@ QtProjectWizardContentPathCxxPch::QtProjectWizardContentPathCxxPch(
QtProjectWizardWindow* window)
: QtProjectWizardContentPath(window), m_settings(settings), m_settingsCxxPch(settingsCxxPch)
{
- setTitleString("Precompiled Header File");
+ setTitleString(QStringLiteral("Precompiled Header File"));
setHelpString(
"Specify the path to the input header file that should be used to generate a precompiled "
"header before indexing.
"
@@ -27,7 +27,7 @@ QtProjectWizardContentPathCxxPch::QtProjectWizardContentPathCxxPch(
"
"
"Leave blank to disable the use of precompiled headers. You can make use of environment "
"variables with ${ENV_VAR}.");
- setPlaceholderString("Not Using Precompiled Header");
+ setPlaceholderString(QStringLiteral("Not Using Precompiled Header"));
}
void QtProjectWizardContentPathCxxPch::populate(QGridLayout* layout, int& row)
@@ -57,7 +57,7 @@ bool QtProjectWizardContentPathCxxPch::check()
if (!cdb)
{
QMessageBox msgBox(m_window);
- msgBox.setText("Unable to open and read the provided compilation database file.");
+ msgBox.setText(QStringLiteral("Unable to open and read the provided compilation database file."));
msgBox.exec();
return false;
}
@@ -73,9 +73,9 @@ bool QtProjectWizardContentPathCxxPch::check()
"precompiled headers to speed up your indexer, please specify an input at "
"Precompiled Header File.");
QPushButton* cancelButton = msgBox.addButton(
- "Cancel", QMessageBox::ButtonRole::RejectRole);
+ QStringLiteral("Cancel"), QMessageBox::ButtonRole::RejectRole);
QPushButton* continueButton = msgBox.addButton(
- "Continue", QMessageBox::ButtonRole::AcceptRole);
+ QStringLiteral("Continue"), QMessageBox::ButtonRole::AcceptRole);
msgBox.exec();
if (msgBox.clickedButton() == cancelButton)
{
@@ -94,9 +94,9 @@ bool QtProjectWizardContentPathCxxPch::check()
"specified input file at "
"Precompiled Header File will not be used.");
QPushButton* cancelButton = msgBox.addButton(
- "Cancel", QMessageBox::ButtonRole::RejectRole);
+ QStringLiteral("Cancel"), QMessageBox::ButtonRole::RejectRole);
QPushButton* continueButton = msgBox.addButton(
- "Continue", QMessageBox::ButtonRole::AcceptRole);
+ QStringLiteral("Continue"), QMessageBox::ButtonRole::AcceptRole);
msgBox.exec();
if (msgBox.clickedButton() == cancelButton)
{
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp
index 3c7ee5eb..488e2746 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPaths.cpp
@@ -93,8 +93,10 @@ bool QtProjectWizardContentPaths::check()
"remove them before continuing?")
.arg(m_titleString));
msgBox.setDetailedText(missingPaths);
- QPushButton* removeButton = msgBox.addButton(QStringLiteral("Remove"), QMessageBox::YesRole);
- QPushButton* keepButton = msgBox.addButton(QStringLiteral("Keep"), QMessageBox::ButtonRole::NoRole);
+ QPushButton* removeButton = msgBox.addButton(
+ QStringLiteral("Remove"), QMessageBox::YesRole);
+ QPushButton* keepButton = msgBox.addButton(
+ QStringLiteral("Keep"), QMessageBox::ButtonRole::NoRole);
QPushButton* cancelButton = msgBox.addButton(
QStringLiteral("Cancel"), QMessageBox::ButtonRole::RejectRole);
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp
index d9df98b2..25e05d5c 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearch.cpp
@@ -10,7 +10,8 @@ QtProjectWizardContentPathsFrameworkSearch::QtProjectWizardContentPathsFramework
: QtProjectWizardContentPaths(settings, window, QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY, true)
{
setTitleString(
- indicateAsAdditional ? "Additional Framework Search Paths" : "Framework Search Paths");
+ indicateAsAdditional ? QStringLiteral("Additional Framework Search Paths")
+ : QStringLiteral("Framework Search Paths"));
setHelpString(
"Framework Search Paths define where MacOS framework containers (.framework), that your "
"project depends on, are "
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp
index a1db3871..2898ec02 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsFrameworkSearchGlobal.cpp
@@ -11,7 +11,7 @@ QtProjectWizardContentPathsFrameworkSearchGlobal::QtProjectWizardContentPathsFra
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY,
true)
{
- setTitleString("Global Framework Search Paths");
+ setTitleString(QStringLiteral("Global Framework Search Paths"));
setHelpString(
"The Global Framework Search Paths will be used in all your projects - in addition to the "
"project specific "
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp
index 72ce9704..2a18aefb 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearch.cpp
@@ -64,8 +64,8 @@ void QtProjectWizardContentPathsHeaderSearch::populate(QGridLayout* layout, int&
if (!m_indicateAsAdditional)
{
{
- QPushButton* detectionButton = new QPushButton("auto-detect");
- detectionButton->setObjectName("windowButton");
+ QPushButton* detectionButton = new QPushButton(QStringLiteral("auto-detect"));
+ detectionButton->setObjectName(QStringLiteral("windowButton"));
connect(
detectionButton,
&QPushButton::clicked,
@@ -75,8 +75,9 @@ void QtProjectWizardContentPathsHeaderSearch::populate(QGridLayout* layout, int&
detectionButton, row, QtProjectWizardWindow::BACK_COL, Qt::AlignLeft | Qt::AlignTop);
}
{
- QPushButton* validateionButton = new QPushButton("validate include directives");
- validateionButton->setObjectName("windowButton");
+ QPushButton* validateionButton = new QPushButton(
+ QStringLiteral("validate include directives"));
+ validateionButton->setObjectName(QStringLiteral("windowButton"));
connect(
validateionButton,
&QPushButton::clicked,
@@ -124,7 +125,7 @@ void QtProjectWizardContentPathsHeaderSearch::detectIncludesButtonClicked()
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY);
m_pathsDialog->setup();
- m_pathsDialog->updateNextButton("Start");
+ m_pathsDialog->updateNextButton(QStringLiteral("Start"));
m_pathsDialog->setCloseVisible(true);
m_pathsDialog->setRelativeRootDirectory(m_settings->getProjectDirectoryPath());
@@ -367,7 +368,7 @@ void QtProjectWizardContentPathsHeaderSearch::showDetectedIncludesResult(
m_filesDialog->setup();
m_filesDialog->setReadOnly(true);
m_filesDialog->setCloseVisible(true);
- m_filesDialog->updateNextButton("Add");
+ m_filesDialog->updateNextButton(QStringLiteral("Add"));
m_filesDialog->setText(detailedText);
m_filesDialog->showWindow();
@@ -392,7 +393,7 @@ void QtProjectWizardContentPathsHeaderSearch::showValidationResult(
{
QMessageBox msgBox(m_window);
msgBox.setText(
- "All include directives throughout the indexed files have been resolved.
");
+ QStringLiteral("All include directives throughout the indexed files have been resolved.
"));
msgBox.exec();
}
else
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp
index 92ac0d0f..fd740cac 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsHeaderSearchGlobal.cpp
@@ -15,7 +15,7 @@ QtProjectWizardContentPathsHeaderSearchGlobal::QtProjectWizardContentPathsHeader
QtPathListBox::SELECTION_POLICY_DIRECTORIES_ONLY,
true)
{
- setTitleString("Global Include Paths");
+ setTitleString(QStringLiteral("Global Include Paths"));
setHelpString(
"The Global Include Paths will be used in all your projects in addition to the project "
"specific Include Paths. "
@@ -74,7 +74,7 @@ bool QtProjectWizardContentPathsHeaderSearchGlobal::check()
if (compilerHeaderPaths.size())
{
QMessageBox msgBox(m_window);
- msgBox.setText("Multiple Compiler Headers");
+ msgBox.setText(QStringLiteral("Multiple Compiler Headers"));
msgBox.setInformativeText(
"Your Global Include Paths contain other paths that hold C/C++ compiler headers, "
"probably those of your local C/C++ compiler. They are possibly in conflict with the "
@@ -83,8 +83,8 @@ bool QtProjectWizardContentPathsHeaderSearchGlobal::check()
"you want to remove "
"these paths?");
msgBox.setDetailedText(compilerHeaderPaths);
- msgBox.addButton("Remove", QMessageBox::ButtonRole::YesRole);
- msgBox.addButton("Keep", QMessageBox::ButtonRole::NoRole);
+ msgBox.addButton(QStringLiteral("Remove"), QMessageBox::ButtonRole::YesRole);
+ msgBox.addButton(QStringLiteral("Keep"), QMessageBox::ButtonRole::NoRole);
msgBox.setIcon(QMessageBox::Icon::Question);
int ret = msgBox.exec();
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp
index 53846841..02644c8c 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.cpp
@@ -103,14 +103,14 @@ std::vector QtProjectWizardContentPathsIndexedHeaders::getIndexedPaths
QtProjectWizardContentPathsIndexedHeaders::QtProjectWizardContentPathsIndexedHeaders(
std::shared_ptr settings,
QtProjectWizardWindow* window,
- std::string projectKindName)
+ const std::string& projectKindName)
: QtProjectWizardContentPaths(
settings, window, QtPathListBox::SELECTION_POLICY_FILES_AND_DIRECTORIES, true)
, m_projectKindName(projectKindName)
{
- m_showFilesString = "";
+ m_showFilesString = QLatin1String("");
- setTitleString("Header Files & Directories to Index");
+ setTitleString(QStringLiteral("Header Files & Directories to Index"));
setHelpString(QString::fromStdString(
"The provided " + m_projectKindName +
" already specifies which source files are part of your project. But Sourcetrail still "
@@ -135,7 +135,7 @@ void QtProjectWizardContentPathsIndexedHeaders::populate(QGridLayout* layout, in
QtProjectWizardContentPaths::populate(layout, row);
QPushButton* button = new QPushButton(QString::fromStdString("Select from " + m_projectKindName));
- button->setObjectName("windowButton");
+ button->setObjectName(QStringLiteral("windowButton"));
connect(
button, &QPushButton::clicked, this, &QtProjectWizardContentPathsIndexedHeaders::buttonClicked);
@@ -166,7 +166,7 @@ bool QtProjectWizardContentPathsIndexedHeaders::check()
if (m_list->getPathsAsDisplayed().empty())
{
QMessageBox msgBox(m_window);
- msgBox.setText("You didn't specify any Header Files & Directories to Index.");
+ msgBox.setText(QStringLiteral("You didn't specify any Header Files & Directories to Index."));
msgBox.setInformativeText(QString::fromStdString(
"Sourcetrail will only index the source files listed in the " + m_projectKindName +
" file and none of the included header files."));
@@ -197,7 +197,7 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
if (!codeblocksProjectPath.exists())
{
QMessageBox msgBox(m_window);
- msgBox.setText("The provided Code::Blocks project path does not exist.");
+ msgBox.setText(QStringLiteral("The provided Code::Blocks project path does not exist."));
msgBox.setDetailedText(QString::fromStdWString(codeblocksProjectPath.wstr()));
msgBox.exec();
return;
@@ -241,7 +241,7 @@ void QtProjectWizardContentPathsIndexedHeaders::buttonClicked()
if (!cdbPath.exists())
{
QMessageBox msgBox(m_window);
- msgBox.setText("The provided Compilation Database path does not exist.");
+ msgBox.setText(QStringLiteral("The provided Compilation Database path does not exist."));
msgBox.setDetailedText(QString::fromStdWString(cdbPath.wstr()));
msgBox.exec();
return;
diff --git a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h
index 9a332b39..8e3f7cce 100644
--- a/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h
+++ b/src/lib_gui/qt/project_wizard/content/paths/QtProjectWizardContentPathsIndexedHeaders.h
@@ -19,7 +19,7 @@ public:
QtProjectWizardContentPathsIndexedHeaders(
std::shared_ptr settings,
QtProjectWizardWindow* window,
- std::string projectKindName);
+ const std::string& projectKindName);
virtual void populate(QGridLayout* layout, int& row) override;
diff --git a/src/lib_gui/qt/utility/QtContextMenu.cpp b/src/lib_gui/qt/utility/QtContextMenu.cpp
index 0a654de2..0754a0eb 100644
--- a/src/lib_gui/qt/utility/QtContextMenu.cpp
+++ b/src/lib_gui/qt/utility/QtContextMenu.cpp
@@ -47,7 +47,7 @@ void QtContextMenu::addUndoActions()
addAction(s_redoAction);
}
-void QtContextMenu::addFileActions(FilePath filePath)
+void QtContextMenu::addFileActions(const FilePath& filePath)
{
s_filePath = filePath;
diff --git a/src/lib_gui/qt/utility/QtContextMenu.h b/src/lib_gui/qt/utility/QtContextMenu.h
index d3fb6beb..6f1e40cc 100644
--- a/src/lib_gui/qt/utility/QtContextMenu.h
+++ b/src/lib_gui/qt/utility/QtContextMenu.h
@@ -17,7 +17,7 @@ public:
void addAction(QAction* action);
void addUndoActions();
- void addFileActions(FilePath filePath);
+ void addFileActions(const FilePath& filePath);
static QtContextMenu* getInstance();
diff --git a/src/lib_gui/qt/utility/QtDeviceScaledPixmap.cpp b/src/lib_gui/qt/utility/QtDeviceScaledPixmap.cpp
index e185e0f8..b65af215 100644
--- a/src/lib_gui/qt/utility/QtDeviceScaledPixmap.cpp
+++ b/src/lib_gui/qt/utility/QtDeviceScaledPixmap.cpp
@@ -12,7 +12,7 @@ qreal QtDeviceScaledPixmap::devicePixelRatio()
QtDeviceScaledPixmap::QtDeviceScaledPixmap() {}
-QtDeviceScaledPixmap::QtDeviceScaledPixmap(QString filePath): m_pixmap(filePath)
+QtDeviceScaledPixmap::QtDeviceScaledPixmap(const QString& filePath): m_pixmap(filePath)
{
m_pixmap.setDevicePixelRatio(devicePixelRatio());
}
diff --git a/src/lib_gui/qt/utility/QtDeviceScaledPixmap.h b/src/lib_gui/qt/utility/QtDeviceScaledPixmap.h
index 471e379f..5d63362c 100644
--- a/src/lib_gui/qt/utility/QtDeviceScaledPixmap.h
+++ b/src/lib_gui/qt/utility/QtDeviceScaledPixmap.h
@@ -9,7 +9,7 @@ public:
static qreal devicePixelRatio();
QtDeviceScaledPixmap();
- QtDeviceScaledPixmap(QString filePath);
+ QtDeviceScaledPixmap(const QString& filePath);
virtual ~QtDeviceScaledPixmap();
const QPixmap& pixmap() const;
diff --git a/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp b/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp
index d3e4854e..20fad473 100644
--- a/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp
+++ b/src/lib_gui/qt/utility/QtFilesAndDirectoriesDialog.cpp
@@ -13,7 +13,8 @@ QtFilesAndDirectoriesDialog::QtFilesAndDirectoriesDialog(QWidget* parent): QFile
setOption(QFileDialog::DontUseNativeDialog, true);
for (QPushButton* button: findChildren())
{
- if (button->text().toLower().contains(QLatin1String("open")) || button->text().toLower().contains(QLatin1String("choose")))
+ if (button->text().toLower().contains(QLatin1String("open")) ||
+ button->text().toLower().contains(QLatin1String("choose")))
{
button->installEventFilter(this);
button->disconnect(SIGNAL(clicked()));
diff --git a/src/lib_gui/qt/utility/QtFlowLayout.cpp b/src/lib_gui/qt/utility/QtFlowLayout.cpp
index 8de1ab9a..7f3a9c51 100644
--- a/src/lib_gui/qt/utility/QtFlowLayout.cpp
+++ b/src/lib_gui/qt/utility/QtFlowLayout.cpp
@@ -114,7 +114,7 @@ QSize QtFlowLayout::minimumSize() const
return size;
}
-int QtFlowLayout::doLayout(const QRect& rect, bool testOnly) const
+int QtFlowLayout::doLayout(QRect rect, bool testOnly) const
{
int left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
diff --git a/src/lib_gui/qt/utility/QtFlowLayout.h b/src/lib_gui/qt/utility/QtFlowLayout.h
index 3bf56b02..d832cb6c 100644
--- a/src/lib_gui/qt/utility/QtFlowLayout.h
+++ b/src/lib_gui/qt/utility/QtFlowLayout.h
@@ -34,7 +34,7 @@ public:
int count() const override;
private:
- int doLayout(const QRect& rect, bool testOnly) const;
+ int doLayout(QRect rect, bool testOnly) const;
int smartSpacing(QStyle::PixelMetric pm) const;
QList itemList;
diff --git a/src/lib_gui/qt/utility/QtHighlighter.cpp b/src/lib_gui/qt/utility/QtHighlighter.cpp
index 82398751..fe7fa6e7 100644
--- a/src/lib_gui/qt/utility/QtHighlighter.cpp
+++ b/src/lib_gui/qt/utility/QtHighlighter.cpp
@@ -42,17 +42,16 @@ std::string QtHighlighter::highlightTypeToString(QtHighlighter::HighlightType ty
return "text";
}
-QtHighlighter::HighlightType QtHighlighter::highlightTypeFromString(const std::string typeStr)
+QtHighlighter::HighlightType QtHighlighter::highlightTypeFromString(const std::string& typeStr)
{
- const std::array types = {
- HighlightType::COMMENT,
- HighlightType::DIRECTIVE,
- HighlightType::FUNCTION,
- HighlightType::KEYWORD,
- HighlightType::NUMBER,
- HighlightType::QUOTATION,
- HighlightType::TEXT,
- HighlightType::TYPE};
+ const std::array types = {HighlightType::COMMENT,
+ HighlightType::DIRECTIVE,
+ HighlightType::FUNCTION,
+ HighlightType::KEYWORD,
+ HighlightType::NUMBER,
+ HighlightType::QUOTATION,
+ HighlightType::TEXT,
+ HighlightType::TYPE};
for (HighlightType type: types)
{
@@ -69,15 +68,14 @@ void QtHighlighter::loadHighlightingRules()
{
ColorScheme* scheme = ColorScheme::getInstance().get();
- const std::array types = {
- HighlightType::COMMENT,
- HighlightType::DIRECTIVE,
- HighlightType::FUNCTION,
- HighlightType::KEYWORD,
- HighlightType::NUMBER,
- HighlightType::QUOTATION,
- HighlightType::TEXT,
- HighlightType::TYPE};
+ const std::array types = {HighlightType::COMMENT,
+ HighlightType::DIRECTIVE,
+ HighlightType::FUNCTION,
+ HighlightType::KEYWORD,
+ HighlightType::NUMBER,
+ HighlightType::QUOTATION,
+ HighlightType::TEXT,
+ HighlightType::TYPE};
s_charFormats.clear();
for (HighlightType type: types)
@@ -87,7 +85,7 @@ void QtHighlighter::loadHighlightingRules()
s_charFormats.emplace(type, format);
}
- for (const FilePath path: FileSystem::getFilePathsFromDirectory(
+ for (const FilePath& path: FileSystem::getFilePathsFromDirectory(
ResourcePaths::getSyntaxHighlightingRulesPath(), {L".rules"}))
{
std::wstring language = path.withoutExtension().fileName();
diff --git a/src/lib_gui/qt/utility/QtHighlighter.h b/src/lib_gui/qt/utility/QtHighlighter.h
index 7f45e43c..9987dcd3 100644
--- a/src/lib_gui/qt/utility/QtHighlighter.h
+++ b/src/lib_gui/qt/utility/QtHighlighter.h
@@ -22,7 +22,7 @@ public:
};
static std::string highlightTypeToString(HighlightType type);
- static HighlightType highlightTypeFromString(const std::string typeStr);
+ static HighlightType highlightTypeFromString(const std::string& typeStr);
static void loadHighlightingRules();
static void clearHighlightingRules();
diff --git a/src/lib_gui/qt/utility/utilityQt.cpp b/src/lib_gui/qt/utility/utilityQt.cpp
index e7368e39..2f7b0dbc 100644
--- a/src/lib_gui/qt/utility/utilityQt.cpp
+++ b/src/lib_gui/qt/utility/utilityQt.cpp
@@ -170,7 +170,9 @@ std::string getStyleSheet(const FilePath& path)
{
if (!ColorScheme::getInstance()->hasColor(val))
{
- LOG_WARNING("Color scheme does not provide value for key \"" + val + "\" requested by style \"" + path.str() + "\".");
+ LOG_WARNING(
+ "Color scheme does not provide value for key \"" + val +
+ "\" requested by style \"" + path.str() + "\".");
}
val = ColorScheme::getInstance()->getColor(val);
}
@@ -250,7 +252,7 @@ QtMainWindow* getMainWindowforMainView(ViewLayout* viewLayout)
return nullptr;
}
-void copyNewFilesFromDirectory(QString src, QString dst)
+void copyNewFilesFromDirectory(const QString& src, const QString& dst)
{
QDir dir(src);
if (!dir.exists())
diff --git a/src/lib_gui/qt/utility/utilityQt.h b/src/lib_gui/qt/utility/utilityQt.h
index 99090339..6d6402a2 100644
--- a/src/lib_gui/qt/utility/utilityQt.h
+++ b/src/lib_gui/qt/utility/utilityQt.h
@@ -26,7 +26,7 @@ QIcon createButtonIcon(const FilePath& iconPath, const std::string& colorId);
QtMainWindow* getMainWindowforMainView(ViewLayout* viewLayout);
-void copyNewFilesFromDirectory(QString src, QString dst);
+void copyNewFilesFromDirectory(const QString& src, const QString& dst);
} // namespace utility
#endif // UTILITY_QT_H
diff --git a/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp b/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp
index 1de8abf3..afcc51e9 100644
--- a/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp
+++ b/src/lib_gui/qt/view/QtBookmarkButtonsView.cpp
@@ -106,10 +106,12 @@ void QtBookmarkButtonsView::createBookmarkClicked()
{
QMessageBox msgBox;
msgBox.setText(QStringLiteral("Edit Bookmark"));
- msgBox.setInformativeText(QStringLiteral("Do you want to edit or delete the bookmark for this symbol?"));
+ msgBox.setInformativeText(
+ QStringLiteral("Do you want to edit or delete the bookmark for this symbol?"));
msgBox.addButton(QStringLiteral("Edit"), QMessageBox::ButtonRole::YesRole);
msgBox.addButton(QStringLiteral("Delete"), QMessageBox::ButtonRole::NoRole);
- QPushButton* cancelButton = msgBox.addButton(QStringLiteral("Cancel"), QMessageBox::ButtonRole::RejectRole);
+ QPushButton* cancelButton = msgBox.addButton(
+ QStringLiteral("Cancel"), QMessageBox::ButtonRole::RejectRole);
msgBox.setDefaultButton(cancelButton);
msgBox.setIcon(QMessageBox::Icon::Question);
int ret = msgBox.exec();
diff --git a/src/lib_gui/qt/view/QtCodeView.cpp b/src/lib_gui/qt/view/QtCodeView.cpp
index c6ff0933..95778d4e 100644
--- a/src/lib_gui/qt/view/QtCodeView.cpp
+++ b/src/lib_gui/qt/view/QtCodeView.cpp
@@ -84,9 +84,9 @@ bool QtCodeView::showsErrors() const
}
void QtCodeView::showSnippets(
- const std::vector files,
- const CodeParams params,
- const CodeScrollParams scrollParams)
+ const std::vector& files,
+ const CodeParams& params,
+ const CodeScrollParams& scrollParams)
{
m_onQtThread([=]() {
TRACE("show snippets");
@@ -112,7 +112,7 @@ void QtCodeView::showSnippets(
}
void QtCodeView::showSingleFile(
- const CodeFileParams file, const CodeParams params, const CodeScrollParams scrollParams)
+ const CodeFileParams& file, const CodeParams& params, const CodeScrollParams& scrollParams)
{
m_onQtThread([=]() {
TRACE("show single file");
@@ -145,7 +145,7 @@ void QtCodeView::showSingleFile(
});
}
-void QtCodeView::updateSourceLocations(const std::vector files)
+void QtCodeView::updateSourceLocations(const std::vector& files)
{
m_onQtThread([=]() {
TRACE("update source locations");
@@ -168,7 +168,7 @@ void QtCodeView::updateSourceLocations(const std::vector files)
});
}
-void QtCodeView::scrollTo(const CodeScrollParams params, bool animated)
+void QtCodeView::scrollTo(const CodeScrollParams& params, bool animated)
{
m_onQtThread([=]() { m_widget->scrollTo(params, animated); });
}
diff --git a/src/lib_gui/qt/view/QtCodeView.h b/src/lib_gui/qt/view/QtCodeView.h
index 49fdf567..34135f8b 100644
--- a/src/lib_gui/qt/view/QtCodeView.h
+++ b/src/lib_gui/qt/view/QtCodeView.h
@@ -27,18 +27,18 @@ public:
void clear() override;
void showSnippets(
- const std::vector files,
- const CodeParams params,
- const CodeScrollParams scrollParams) override;
+ const std::vector& files,
+ const CodeParams& params,
+ const CodeScrollParams& scrollParams) override;
void showSingleFile(
- const CodeFileParams file,
- const CodeParams params,
- const CodeScrollParams scrollParams) override;
+ const CodeFileParams& file,
+ const CodeParams& params,
+ const CodeScrollParams& scrollParams) override;
- void updateSourceLocations(const std::vector files) override;
+ void updateSourceLocations(const std::vector& files) override;
- void scrollTo(const CodeScrollParams params, bool animated) override;
+ void scrollTo(const CodeScrollParams& params, bool animated) override;
bool showsErrors() const override;
diff --git a/src/lib_gui/qt/view/QtCustomTrailView.cpp b/src/lib_gui/qt/view/QtCustomTrailView.cpp
index 6d98ac11..e839cf5e 100644
--- a/src/lib_gui/qt/view/QtCustomTrailView.cpp
+++ b/src/lib_gui/qt/view/QtCustomTrailView.cpp
@@ -219,7 +219,8 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
QColor(scheme->getNodeTypeColor(t, "fill", ColorScheme::FOCUS).c_str()));
}
- QVBoxLayout* filterLayout = addFilters(QStringLiteral("Nodes:"), nodeFilters, nodeColors, &m_nodeFilters, 11);
+ QVBoxLayout* filterLayout = addFilters(
+ QStringLiteral("Nodes:"), nodeFilters, nodeColors, &m_nodeFilters, 11);
filterLayout->setContentsMargins(25, 10, 25, 10);
panelC1->setLayout(filterLayout);
}
@@ -255,7 +256,8 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
edgeColors.push_back(QColor(scheme->getEdgeTypeColor(t, ColorScheme::FOCUS).c_str()));
}
- QVBoxLayout* filterLayout = addFilters(QStringLiteral("Edges:"), edgeFilters, edgeColors, &m_edgeFilters, 5);
+ QVBoxLayout* filterLayout = addFilters(
+ QStringLiteral("Edges:"), edgeFilters, edgeColors, &m_edgeFilters, 5);
filterLayout->setContentsMargins(10, 10, 25, 10);
panelC2->setLayout(filterLayout);
}
@@ -477,7 +479,7 @@ QWidget* QtCustomTrailView::createSearchBox(QtSmartSearchBox* searchBox) const
}
QVBoxLayout* QtCustomTrailView::addFilters(
- QString name,
+ const QString& name,
const std::vector& filters,
const std::vector& colors,
std::vector* checkBoxes,
diff --git a/src/lib_gui/qt/view/QtCustomTrailView.h b/src/lib_gui/qt/view/QtCustomTrailView.h
index 7d8e779d..550df441 100644
--- a/src/lib_gui/qt/view/QtCustomTrailView.h
+++ b/src/lib_gui/qt/view/QtCustomTrailView.h
@@ -43,7 +43,7 @@ private:
QWidget* createSearchBox(QtSmartSearchBox* searchBox) const;
QVBoxLayout* addFilters(
- QString name,
+ const QString& name,
const std::vector& filters,
const std::vector& colors,
std::vector* checkBoxes,
diff --git a/src/lib_gui/qt/view/QtGraphView.cpp b/src/lib_gui/qt/view/QtGraphView.cpp
index d5c99260..8ce6ef89 100644
--- a/src/lib_gui/qt/view/QtGraphView.cpp
+++ b/src/lib_gui/qt/view/QtGraphView.cpp
@@ -106,7 +106,8 @@ QtGraphView::QtGraphView(ViewLayout* viewLayout)
m_collapseButton->setIconSize(QSize(16, 16));
connect(m_collapseButton, &QPushButton::clicked, this, &QtGraphView::clickedCollapse);
- m_customTrailButton = new QtSelfRefreshIconButton(QLatin1String(""), FilePath(), "search/button", ui);
+ m_customTrailButton = new QtSelfRefreshIconButton(
+ QLatin1String(""), FilePath(), "search/button", ui);
m_customTrailButton->setObjectName(QStringLiteral("trail_button"));
m_customTrailButton->setIconSize(QSize(16, 16));
m_customTrailButton->setToolTip(QStringLiteral("custom trail"));
@@ -115,13 +116,15 @@ QtGraphView::QtGraphView(ViewLayout* viewLayout)
connect(
m_customTrailButton, &QPushButton::clicked, this, &QtGraphView::clickedCustomTrail);
- m_forwardTrailButton = new QtSelfRefreshIconButton(QLatin1String(""), FilePath(), "search/button", ui);
+ m_forwardTrailButton = new QtSelfRefreshIconButton(
+ QLatin1String(""), FilePath(), "search/button", ui);
m_forwardTrailButton->setObjectName(QStringLiteral("trail_button"));
m_forwardTrailButton->setIconSize(QSize(16, 16));
connect(
m_forwardTrailButton, &QPushButton::clicked, this, &QtGraphView::clickedForwardTrail);
- m_backwardTrailButton = new QtSelfRefreshIconButton(QLatin1String(""), FilePath(), "search/button", ui);
+ m_backwardTrailButton = new QtSelfRefreshIconButton(
+ QLatin1String(""), FilePath(), "search/button", ui);
m_backwardTrailButton->setObjectName(QStringLiteral("trail_button"));
m_backwardTrailButton->setIconSize(QSize(16, 16));
connect(
diff --git a/src/lib_gui/qt/view/QtStatusView.cpp b/src/lib_gui/qt/view/QtStatusView.cpp
index 003e874d..e20a8204 100644
--- a/src/lib_gui/qt/view/QtStatusView.cpp
+++ b/src/lib_gui/qt/view/QtStatusView.cpp
@@ -34,8 +34,7 @@ QtStatusView::QtStatusView(ViewLayout* viewLayout): StatusView(viewLayout)
// m_table->setColumnWidth(STATUSVIEW_COLUMN::STATUS, 150);
QStringList headers;
- headers << QStringLiteral("Type")
- << QStringLiteral("Message");
+ headers << QStringLiteral("Type") << QStringLiteral("Message");
m_model->setHorizontalHeaderLabels(headers);
layout->addWidget(m_table);
@@ -46,8 +45,10 @@ QtStatusView::QtStatusView(ViewLayout* viewLayout): StatusView(viewLayout)
filters->setSpacing(25);
const StatusFilter filter = ApplicationSettings::getInstance()->getStatusFilter();
- m_showInfo = createFilterCheckbox(QStringLiteral("Info"), filters, filter & StatusType::STATUS_INFO);
- m_showErrors = createFilterCheckbox(QStringLiteral("Error"), filters, filter & StatusType::STATUS_ERROR);
+ m_showInfo = createFilterCheckbox(
+ QStringLiteral("Info"), filters, filter & StatusType::STATUS_INFO);
+ m_showErrors = createFilterCheckbox(
+ QStringLiteral("Error"), filters, filter & StatusType::STATUS_ERROR);
filters->addStretch();
@@ -107,8 +108,9 @@ void QtStatusView::addStatus(const std::vector& status)
m_model->insertRow(rowNumber);
}
- QString statusType = (s.type == StatusType::STATUS_ERROR ?
- QStringLiteral("ERROR") : QStringLiteral("INFO"));
+ QString statusType =
+ (s.type == StatusType::STATUS_ERROR ? QStringLiteral("ERROR")
+ : QStringLiteral("INFO"));
m_model->setItem(rowNumber, STATUSVIEW_COLUMN::TYPE, new QStandardItem(statusType));
m_model->setItem(
rowNumber,
diff --git a/src/lib_gui/qt/view/QtTabsView.cpp b/src/lib_gui/qt/view/QtTabsView.cpp
index 01602b74..1fbd8aef 100644
--- a/src/lib_gui/qt/view/QtTabsView.cpp
+++ b/src/lib_gui/qt/view/QtTabsView.cpp
@@ -40,7 +40,9 @@ QtTabsView::QtTabsView(ViewLayout* viewLayout)
connect(m_tabBar, &QTabBar::currentChanged, this, &QtTabsView::changedTab);
QPushButton* addButton = new QtSelfRefreshIconButton(
- QLatin1String(""), ResourcePaths::getGuiPath().concatenate(L"tabs_view/images/add.png"), "tab/bar/button");
+ QLatin1String(""),
+ ResourcePaths::getGuiPath().concatenate(L"tabs_view/images/add.png"),
+ "tab/bar/button");
addButton->setObjectName(QStringLiteral("add_button"));
addButton->setIconSize(QSize(14, 14));
@@ -84,7 +86,7 @@ void QtTabsView::clear()
});
}
-void QtTabsView::openTab(bool showTab, SearchMatch match)
+void QtTabsView::openTab(bool showTab, const SearchMatch& match)
{
m_onQtThread([=]() { insertTab(showTab, match); });
}
@@ -111,7 +113,7 @@ void QtTabsView::selectTab(bool next)
});
}
-void QtTabsView::updateTab(Id tabId, std::vector matches)
+void QtTabsView::updateTab(Id tabId, const std::vector& matches)
{
m_onQtThread([=]() {
for (int i = 0; i < m_tabBar->count(); i++)
@@ -133,7 +135,7 @@ void QtTabsView::addTab()
}
}
-void QtTabsView::insertTab(bool showTab, SearchMatch match)
+void QtTabsView::insertTab(bool showTab, const SearchMatch& match)
{
int tabId = TabId::nextTab();
@@ -259,7 +261,7 @@ void QtTabsView::setTabState(int idx, const std::vector& matches)
->setStyleSheet(
QStringLiteral("#type_circle { background-color: ") + QString::fromStdString(color) +
QStringLiteral("; } "
- "#type_circle[selected=true] { background-color: ") +
+ "#type_circle[selected=true] { background-color: ") +
QString::fromStdString(activeColor) + QStringLiteral("; } "));
}
@@ -277,11 +279,10 @@ void QtTabsView::closeTabsToRight(int tabNum)
{
LOG_INFO("Closing tabs to the right of tab nr. " + std::to_string(tabNum));
// We are closing tabs to the right, hence the increase.
- tabNum++;
+ tabNum++;
// Now close tabs at position tabNum until count has decreased low enough.
- while(tabNum < m_tabBar->count() )
+ while (tabNum < m_tabBar->count())
{
m_tabBar->removeTab(tabNum);
}
}
-
diff --git a/src/lib_gui/qt/view/QtTabsView.h b/src/lib_gui/qt/view/QtTabsView.h
index 3480951b..66a17c71 100644
--- a/src/lib_gui/qt/view/QtTabsView.h
+++ b/src/lib_gui/qt/view/QtTabsView.h
@@ -25,15 +25,15 @@ public:
// TabsView implementation
void clear() override;
- void openTab(bool showTab, SearchMatch match) override;
+ void openTab(bool showTab, const SearchMatch& match) override;
void closeTab() override;
void destroyTab(Id tabId) override;
void selectTab(bool next) override;
- void updateTab(Id tabId, std::vector matches) override;
+ void updateTab(Id tabId, const std::vector& matches) override;
private slots:
void addTab();
- void insertTab(bool showTab, SearchMatch match);
+ void insertTab(bool showTab, const SearchMatch& match);
void changedTab(int index);
void removeTab(int index);
void closeTabsToRight(int index);
diff --git a/src/lib_gui/qt/view/QtTooltipView.cpp b/src/lib_gui/qt/view/QtTooltipView.cpp
index e2480aad..ab4ce995 100644
--- a/src/lib_gui/qt/view/QtTooltipView.cpp
+++ b/src/lib_gui/qt/view/QtTooltipView.cpp
@@ -26,7 +26,7 @@ void QtTooltipView::refreshView()
});
}
-void QtTooltipView::showTooltip(TooltipInfo info, const View* parent)
+void QtTooltipView::showTooltip(const TooltipInfo& info, const View* parent)
{
m_onQtThread([=]() {
if (m_widget->isHovered())
diff --git a/src/lib_gui/qt/view/QtTooltipView.h b/src/lib_gui/qt/view/QtTooltipView.h
index 8a81b0d4..b4783b75 100644
--- a/src/lib_gui/qt/view/QtTooltipView.h
+++ b/src/lib_gui/qt/view/QtTooltipView.h
@@ -18,7 +18,7 @@ public:
void refreshView() override;
// TooltipView implementation
- void showTooltip(TooltipInfo info, const View* parent) override;
+ void showTooltip(const TooltipInfo& info, const View* parent) override;
void hideTooltip(bool force) override;
bool tooltipVisible() const override;
diff --git a/src/lib_gui/qt/window/QtAbout.cpp b/src/lib_gui/qt/window/QtAbout.cpp
index 86c13665..ed371a17 100644
--- a/src/lib_gui/qt/window/QtAbout.cpp
+++ b/src/lib_gui/qt/window/QtAbout.cpp
@@ -69,12 +69,12 @@ void QtAbout::setupAbout()
QLabel* companyLabel = new QLabel(
QStringLiteral("Coati Software KG
"
- "Jakob-Haringer-Straße 1/127
"
- "5020 Salzburg
"
- "Austria
"
- "support@sourcetrail.com
"
- "sourcetrail.com"));
+ "Jakob-Haringer-Straße 1/127
"
+ "5020 Salzburg
"
+ "Austria
"
+ "support@sourcetrail.com
"
+ "sourcetrail.com"));
companyLabel->setOpenExternalLinks(true);
layoutHorz1->addWidget(companyLabel);
@@ -82,20 +82,20 @@ void QtAbout::setupAbout()
QLabel* developerLabel = new QLabel(
QStringLiteral("
"
- "Team:
"
- "Manuel Dobusch
"
- "Eberhard Gräther
"
- "Malte Langkabel
"
- "Viktoria Pfausler
"
- "Andreas Stallinger
"));
+ "Team:
"
+ "Manuel Dobusch
"
+ "Eberhard Gräther
"
+ "Malte Langkabel
"
+ "Viktoria Pfausler
"
+ "Andreas Stallinger
"));
developerLabel->setObjectName(QStringLiteral("small"));
layoutHorz1->addWidget(developerLabel);
}
windowLayout->addStretch();
- QLabel* acknowledgementsLabel = new QLabel(
- QStringLiteral("Acknowledgements:
"
+ QLabel* acknowledgementsLabel = new QLabel(QStringLiteral(
+ "Acknowledgements:
"
"Sourcetrail (aka Coati) 0.1 was created in the context of education at "
"Salzburg University "
"of Applied Sciences.
"
diff --git a/src/lib_gui/qt/window/QtBookmarkCreator.cpp b/src/lib_gui/qt/window/QtBookmarkCreator.cpp
index aa64a882..3b708589 100644
--- a/src/lib_gui/qt/window/QtBookmarkCreator.cpp
+++ b/src/lib_gui/qt/window/QtBookmarkCreator.cpp
@@ -29,8 +29,8 @@ void QtBookmarkCreator::setupBookmarkCreator()
{
// title
- QLabel* title = new QLabel(m_editBookmarkId ?
- QStringLiteral("Edit Bookmark") : QStringLiteral("Create Bookmark"));
+ QLabel* title = new QLabel(
+ m_editBookmarkId ? QStringLiteral("Edit Bookmark") : QStringLiteral("Create Bookmark"));
title->setObjectName(QStringLiteral("creator_title_label"));
mainLayout->addWidget(title);
}
diff --git a/src/lib_gui/qt/window/QtIndexingDialog.h b/src/lib_gui/qt/window/QtIndexingDialog.h
index 627fff69..f935f9c9 100644
--- a/src/lib_gui/qt/window/QtIndexingDialog.h
+++ b/src/lib_gui/qt/window/QtIndexingDialog.h
@@ -19,7 +19,7 @@ class QtIndexingDialog: public QtWindowBase
protected:
static QBoxLayout* createLayout(QWidget* parent);
- static QLabel* createTitleLabel(const QString &title, QBoxLayout* layout);
+ static QLabel* createTitleLabel(const QString& title, QBoxLayout* layout);
static QLabel* createMessageLabel(QBoxLayout* layout);
static QWidget* createErrorWidget(QBoxLayout* layout);
static QLabel* createFlagLabel(QWidget* parent);
diff --git a/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp b/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp
index de2c000c..d0534caa 100644
--- a/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp
+++ b/src/lib_gui/qt/window/QtIndexingProgressDialog.cpp
@@ -86,7 +86,8 @@ void QtIndexingProgressDialog::updateErrorCount(size_t errorCount, size_t fatalC
str += " (" + QString::number(fatalCount) + " Fatal)";
}
- QPushButton* errorCount = m_errorWidget->findChild(QStringLiteral("errorCount"));
+ QPushButton* errorCount = m_errorWidget->findChild(
+ QStringLiteral("errorCount"));
errorCount->setText(str);
m_errorWidget->show();
diff --git a/src/lib_gui/qt/window/QtIndexingReportDialog.cpp b/src/lib_gui/qt/window/QtIndexingReportDialog.cpp
index 1ecaa617..f744bc0d 100644
--- a/src/lib_gui/qt/window/QtIndexingReportDialog.cpp
+++ b/src/lib_gui/qt/window/QtIndexingReportDialog.cpp
@@ -73,7 +73,8 @@ QtIndexingReportDialog::QtIndexingReportDialog(
}
else if (shallow)
{
- QPushButton* startInDepthButton = new QPushButton(QStringLiteral("Start In-Depth Indexing"));
+ QPushButton* startInDepthButton = new QPushButton(
+ QStringLiteral("Start In-Depth Indexing"));
startInDepthButton->setObjectName(QStringLiteral("windowButton"));
connect(
startInDepthButton,
@@ -86,8 +87,8 @@ QtIndexingReportDialog::QtIndexingReportDialog(
buttons->addStretch();
QPushButton* confirmButton = new QPushButton(
- interrupted ? QStringLiteral("Keep") :
- (shallow ? QStringLiteral("Later") : QStringLiteral("OK")));
+ interrupted ? QStringLiteral("Keep")
+ : (shallow ? QStringLiteral("Later") : QStringLiteral("OK")));
confirmButton->setObjectName(QStringLiteral("windowButton"));
confirmButton->setDefault(true);
connect(
@@ -125,7 +126,8 @@ void QtIndexingReportDialog::updateErrorCount(size_t errorCount, size_t fatalCou
str += QStringLiteral(" (") + QString::number(fatalCount) + QStringLiteral(" Fatal)");
}
- QPushButton* errorCount = m_errorWidget->findChild(QStringLiteral("errorCount"));
+ QPushButton* errorCount = m_errorWidget->findChild(
+ QStringLiteral("errorCount"));
errorCount->setText(str);
m_errorWidget->show();
diff --git a/src/lib_gui/qt/window/QtMainWindow.cpp b/src/lib_gui/qt/window/QtMainWindow.cpp
index 80827497..896a8d69 100644
--- a/src/lib_gui/qt/window/QtMainWindow.cpp
+++ b/src/lib_gui/qt/window/QtMainWindow.cpp
@@ -520,13 +520,14 @@ void QtMainWindow::showErrorHelpMessage()
void QtMainWindow::showChangelog()
{
- QDesktopServices::openUrl(
- QUrl(QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail/blob/master/CHANGELOG.md")));
+ QDesktopServices::openUrl(QUrl(
+ QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail/blob/master/CHANGELOG.md")));
}
void QtMainWindow::showBugtracker()
{
- QDesktopServices::openUrl(QUrl(QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail/issues")));
+ QDesktopServices::openUrl(
+ QUrl(QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail/issues")));
}
void QtMainWindow::showLicenses()
diff --git a/src/lib_gui/qt/window/QtStartScreen.cpp b/src/lib_gui/qt/window/QtStartScreen.cpp
index 5622fdc6..63417688 100644
--- a/src/lib_gui/qt/window/QtStartScreen.cpp
+++ b/src/lib_gui/qt/window/QtStartScreen.cpp
@@ -202,8 +202,8 @@ void QtStartScreen::setupStartScreen()
githubButton->setIcon(m_githubIcon);
githubButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(githubButton, &QPushButton::clicked, []() {
- QDesktopServices::openUrl(
- QUrl(QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail"), QUrl::TolerantMode));
+ QDesktopServices::openUrl(QUrl(
+ QStringLiteral("https://github.com/CoatiSoftware/Sourcetrail"), QUrl::TolerantMode));
});
col->addWidget(githubButton);
@@ -216,7 +216,8 @@ void QtStartScreen::setupStartScreen()
patreonButton->setIcon(m_patreonIcon);
patreonButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(patreonButton, &QPushButton::clicked, []() {
- QDesktopServices::openUrl(QUrl(QStringLiteral("https://www.patreon.com/sourcetrail"), QUrl::TolerantMode));
+ QDesktopServices::openUrl(
+ QUrl(QStringLiteral("https://www.patreon.com/sourcetrail"), QUrl::TolerantMode));
});
col->addWidget(patreonButton);
diff --git a/src/lib_gui/qt/window/QtWindow.cpp b/src/lib_gui/qt/window/QtWindow.cpp
index a3ebb941..aae0f9be 100644
--- a/src/lib_gui/qt/window/QtWindow.cpp
+++ b/src/lib_gui/qt/window/QtWindow.cpp
@@ -114,7 +114,7 @@ std::wstring QtWindow::getTitle() const
return L"";
}
-void QtWindow::updateSubTitle(QString subTitle)
+void QtWindow::updateSubTitle(const QString& subTitle)
{
if (m_subTitle)
{
@@ -122,7 +122,7 @@ void QtWindow::updateSubTitle(QString subTitle)
}
}
-void QtWindow::updateNextButton(QString text)
+void QtWindow::updateNextButton(const QString& text)
{
if (m_nextButton)
{
@@ -130,7 +130,7 @@ void QtWindow::updateNextButton(QString text)
}
}
-void QtWindow::updatePreviousButton(QString text)
+void QtWindow::updatePreviousButton(const QString& text)
{
if (m_previousButton)
{
@@ -138,7 +138,7 @@ void QtWindow::updatePreviousButton(QString text)
}
}
-void QtWindow::updateCloseButton(QString text)
+void QtWindow::updateCloseButton(const QString& text)
{
if (m_closeButton)
{
diff --git a/src/lib_gui/qt/window/QtWindow.h b/src/lib_gui/qt/window/QtWindow.h
index 035f8b59..5ef71ea5 100644
--- a/src/lib_gui/qt/window/QtWindow.h
+++ b/src/lib_gui/qt/window/QtWindow.h
@@ -29,11 +29,11 @@ public:
void updateTitle(const QString& title);
std::wstring getTitle() const;
- void updateSubTitle(QString subTitle);
+ void updateSubTitle(const QString& subTitle);
- void updateNextButton(QString text);
- void updatePreviousButton(QString text);
- void updateCloseButton(QString text);
+ void updateNextButton(const QString& text);
+ void updatePreviousButton(const QString& text);
+ void updateCloseButton(const QString& text);
void setNextEnabled(bool enabled);
void setPreviousEnabled(bool enabled);
diff --git a/src/lib_gui/utility/path_detector/CombinedPathDetector.cpp b/src/lib_gui/utility/path_detector/CombinedPathDetector.cpp
index 5b633ddf..23db7562 100644
--- a/src/lib_gui/utility/path_detector/CombinedPathDetector.cpp
+++ b/src/lib_gui/utility/path_detector/CombinedPathDetector.cpp
@@ -35,7 +35,7 @@ std::vector CombinedPathDetector::getPaths() const
return std::vector();
}
-std::vector CombinedPathDetector::getPaths(std::string detectorName) const
+std::vector CombinedPathDetector::getPaths(const std::string& detectorName) const
{
for (const std::shared_ptr& detector: m_detectors)
{
diff --git a/src/lib_gui/utility/path_detector/CombinedPathDetector.h b/src/lib_gui/utility/path_detector/CombinedPathDetector.h
index 42fe337d..7d61d68b 100644
--- a/src/lib_gui/utility/path_detector/CombinedPathDetector.h
+++ b/src/lib_gui/utility/path_detector/CombinedPathDetector.h
@@ -18,7 +18,7 @@ public:
std::vector getWorkingDetectorNames();
std::vector getPaths() const override;
- std::vector getPaths(std::string detectorName) const;
+ std::vector getPaths(const std::string& detectorName) const;
private:
std::vector> m_detectors;
diff --git a/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp b/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp
index a2e39782..df7319aa 100644
--- a/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp
+++ b/src/lib_gui/utility/path_detector/cxx_header/CxxVs10To14HeaderPathDetector.cpp
@@ -88,7 +88,7 @@ FilePath CxxVs10To14HeaderPathDetector::getVsInstallPathUsingRegistry() const
key += "Wow6432Node\\";
}
key += "Microsoft\\";
- key += (m_isExpress ? "VCExpress" : "VisualStudio");
+ key += (m_isExpress ? QStringLiteral("VCExpress") : QStringLiteral("VisualStudio"));
key += "\\" + QString::number(m_version) + ".0";
QSettings expressKey(
diff --git a/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp b/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp
index 59d2dcff..bc851205 100644
--- a/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp
+++ b/src/lib_gui/utility/path_detector/cxx_header/utilityCxxHeaderDetection.cpp
@@ -49,7 +49,7 @@ std::vector getWindowsSdkHeaderSearchPaths(ApplicationArchitectureType
if (sdkIncludePath.exists())
{
bool usingSubdirectories = false;
- for (const std::wstring subDirectory: {L"shared", L"um", L"winrt"})
+ for (const std::wstring& subDirectory: {L"shared", L"um", L"winrt"})
{
const FilePath sdkSubdirectory = sdkIncludePath.getConcatenated(subDirectory);
if (sdkSubdirectory.exists())
@@ -90,16 +90,16 @@ std::vector getWindowsSdkHeaderSearchPaths(ApplicationArchitectureType
FilePath getWindowsSdkRootPathUsingRegistry(
ApplicationArchitectureType architectureType, const std::string& sdkVersion)
{
- QString key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\";
+ QString key = QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\");
if (architectureType == APPLICATION_ARCHITECTURE_X86_32)
{
- key += "Wow6432Node\\";
+ key += QStringLiteral("Wow6432Node\\");
}
- key += ("Microsoft\\Microsoft SDKs\\Windows\\" + sdkVersion).c_str();
+ key += QStringLiteral("Microsoft\\Microsoft SDKs\\Windows\\") + sdkVersion.c_str();
QSettings expressKey(
key, QSettings::NativeFormat); // NativeFormat means from Registry on Windows.
- QString value = expressKey.value("InstallationFolder").toString();
+ QString value = expressKey.value(QStringLiteral("InstallationFolder")).toString();
FilePath path(value.toStdWString());
if (path.exists())
diff --git a/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp b/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp
index 22c44eb4..147c98e9 100644
--- a/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp
+++ b/src/lib_gui/utility/path_detector/jre_system_library/JreSystemLibraryPathDetector.cpp
@@ -8,7 +8,8 @@
JreSystemLibraryPathDetector::JreSystemLibraryPathDetector(
std::shared_ptr javaPathDetector)
- : PathDetector(javaPathDetector->getName() + " System Library"), m_javaPathDetector(javaPathDetector)
+ : PathDetector(javaPathDetector->getName() + " System Library")
+ , m_javaPathDetector(javaPathDetector)
{
}