Commit 2cf94b0b authored by Kevin Funk's avatar Kevin Funk
Browse files

clang-tidy: performance-unnecessary-value-param

(Without the transformations to std::move(...))

(cherry picked from commit f5b25083)
parent a399ed82
......@@ -8,7 +8,7 @@ set(KDEVELOP_VERSION_PATCH 40)
set( KDEVELOP_VERSION "${KDEVELOP_VERSION_MAJOR}.${KDEVELOP_VERSION_MINOR}.${KDEVELOP_VERSION_PATCH}" )
# plugin versions listed in the .desktop files
set(KDEV_PLUGIN_VERSION 29)
set(KDEV_PLUGIN_VERSION 30)
# we need some parts of the ECM CMake helpers
find_package (ECM 5.14.0 REQUIRED NO_MODULE)
......
......@@ -105,7 +105,7 @@ QModelIndex FrameStackModelPrivate::indexForThreadNumber(int threadNumber)
return QModelIndex();
}
void FrameStackModel::setFrames(int threadNumber, QList<FrameItem> frames)
void FrameStackModel::setFrames(int threadNumber, const QList<FrameItem>& frames)
{
QModelIndex threadIndex = d->indexForThreadNumber(threadNumber);
Q_ASSERT(threadIndex.isValid());
......
......@@ -59,7 +59,7 @@ public:
* @note The currentFrame property will be set to the first frame
* containing debug information
*/
void setFrames(int threadNumber, QList<FrameItem> frames);
void setFrames(int threadNumber, const QList<FrameItem>& frames);
void insertFrames(int threadNumber, const QList<FrameItem> &frames);
void setHasMoreFrames(int threadNumber, bool hasMoreFrames);
FrameItem frame(const QModelIndex &index) override;
......
......@@ -247,7 +247,7 @@ void PathMappingsWidget::loadFromConfiguration(const KConfigGroup& cfg)
static_cast<PathMappingModel*>(m_pathMappingTable->model())->loadFromConfiguration(cfg);
}
void PathMappingsWidget::saveToConfiguration(KConfigGroup cfg) const
void PathMappingsWidget::saveToConfiguration(const KConfigGroup& cfg) const
{
static_cast<PathMappingModel*>(m_pathMappingTable->model())->saveToConfiguration(cfg);
}
......
......@@ -52,7 +52,7 @@ public:
explicit PathMappingsWidget(QWidget* parent = nullptr);
void loadFromConfiguration(const KConfigGroup& cfg);
void saveToConfiguration(KConfigGroup cfg) const;
void saveToConfiguration(const KConfigGroup& cfg) const;
Q_SIGNALS:
void changed();
......
......@@ -75,7 +75,7 @@ StaticAssistantsManager::~StaticAssistantsManager()
{
}
void StaticAssistantsManager::registerAssistant(const StaticAssistant::Ptr assistant)
void StaticAssistantsManager::registerAssistant(const StaticAssistant::Ptr& assistant)
{
if (d->m_registeredAssistants.contains(assistant))
return;
......@@ -83,7 +83,7 @@ void StaticAssistantsManager::registerAssistant(const StaticAssistant::Ptr assis
d->m_registeredAssistants << assistant;
}
void StaticAssistantsManager::unregisterAssistant(const StaticAssistant::Ptr assistant)
void StaticAssistantsManager::unregisterAssistant(const StaticAssistant::Ptr& assistant)
{
d->m_registeredAssistants.removeOne(assistant);
}
......
......@@ -57,8 +57,8 @@ public:
explicit StaticAssistantsManager(QObject* parent = nullptr);
~StaticAssistantsManager() override;
void registerAssistant(const StaticAssistant::Ptr assistant);
void unregisterAssistant(const StaticAssistant::Ptr assistant);
void registerAssistant(const StaticAssistant::Ptr& assistant);
void unregisterAssistant(const StaticAssistant::Ptr& assistant);
QVector<StaticAssistant::Ptr> registeredAssistants() const;
void notifyAssistants(const IndexedString& url, const KDevelop::ReferencedTopDUContext& context);
......
......@@ -72,7 +72,7 @@ ClassModel::~ClassModel()
delete m_topNode;
}
void ClassModel::updateFilterString(QString a_newFilterString)
void ClassModel::updateFilterString(const QString& a_newFilterString)
{
m_allClassesNode->updateFilterString(a_newFilterString);
foreach ( ClassModelNodes::FilteredProjectFolder* folder, m_projectNodes ) {
......
......@@ -102,7 +102,7 @@ public:
public Q_SLOTS:
/// Call this to update the filter string for the search results folder.
void updateFilterString(QString a_newFilterString);
void updateFilterString(const QString& a_newFilterString);
/// removes the project-specific node
void removeProjectNode(KDevelop::IProject* project);
......
......@@ -38,7 +38,7 @@ QString CodeCompletionContext::extractLastLine(const QString& str) {
int completionRecursionDepth = 0;
CodeCompletionContext::CodeCompletionContext(DUContextPointer context, const QString& text, const KDevelop::CursorInRevision& position, int depth)
CodeCompletionContext::CodeCompletionContext(const DUContextPointer& context, const QString& text, const KDevelop::CursorInRevision& position, int depth)
: m_text(text), m_depth(depth), m_valid(true), m_position(position), m_duContext(context), m_parentContext(nullptr)
{
IntPusher( completionRecursionDepth, completionRecursionDepth+1 );
......
......@@ -50,7 +50,7 @@ namespace KDevelop {
*
* @warning The du-chain must be unlocked when this is called
* */
CodeCompletionContext(KDevelop::DUContextPointer context, const QString& text, const KDevelop::CursorInRevision& position, int depth = 0);
CodeCompletionContext(const KDevelop::DUContextPointer& context, const QString& text, const KDevelop::CursorInRevision& position, int depth = 0);
virtual ~CodeCompletionContext();
/**
......
......@@ -28,7 +28,7 @@
namespace KDevelop {
void insertFunctionParenText(KTextEditor::View* view, const KTextEditor::Cursor& pos, DeclarationPointer declaration, bool jumpForbidden)
void insertFunctionParenText(KTextEditor::View* view, const KTextEditor::Cursor& pos, const DeclarationPointer& declaration, bool jumpForbidden)
{
bool spaceBeforeParen = false; ///@todo Take this from some astyle config or something
bool spaceBetweenParens = false;
......
......@@ -30,7 +30,7 @@ namespace KTextEditor {
namespace KDevelop {
class Declaration;
void KDEVPLATFORMLANGUAGE_EXPORT insertFunctionParenText(KTextEditor::View* view, const KTextEditor::Cursor& pos, KDevelop::DeclarationPointer declaration, bool jumpForbidden = false);
void KDEVPLATFORMLANGUAGE_EXPORT insertFunctionParenText(KTextEditor::View* view, const KTextEditor::Cursor& pos, const KDevelop::DeclarationPointer& declaration, bool jumpForbidden = false);
}
#endif
......@@ -151,7 +151,7 @@ QList<IndexedType> CompletionTreeItem::typeForArgumentMatching() const {
return QList<IndexedType>();
}
CompletionCustomGroupNode::CompletionCustomGroupNode(QString groupName, int _inheritanceDepth) {
CompletionCustomGroupNode::CompletionCustomGroupNode(const QString& groupName, int _inheritanceDepth) {
role = (KTextEditor::CodeCompletionModel::ExtraItemDataRoles)Qt::DisplayRole;
roleValue = groupName;
inheritanceDepth = _inheritanceDepth;
......
......@@ -136,7 +136,7 @@ public:
/// The items in the group will be shown in the completion-list with a group-header that contains the given name
struct KDEVPLATFORMLANGUAGE_EXPORT CompletionCustomGroupNode : public CompletionTreeNode {
/// @param inheritanceDepth See KTextEditor::CodeCompletionModel::GroupRole
explicit CompletionCustomGroupNode(QString groupName, int inheritanceDepth = 700);
explicit CompletionCustomGroupNode(const QString& groupName, int inheritanceDepth = 700);
int inheritanceDepth;
};
......
......@@ -74,7 +74,7 @@ public:
//We connect directly, so we can do the pre-grouping within the background thread
connect(m_worker, &CodeCompletionWorker::foundDeclarationsReal, m_model, &CodeCompletionModel::foundDeclarations, Qt::QueuedConnection);
connect(m_model, &CodeCompletionModel::completionsNeeded, m_worker, static_cast<void(CodeCompletionWorker::*)(DUChainPointer<KDevelop::DUContext>,const Cursor&,View*)>(&CodeCompletionWorker::computeCompletions), Qt::QueuedConnection);
connect(m_model, &CodeCompletionModel::completionsNeeded, m_worker, static_cast<void(CodeCompletionWorker::*)(const DUChainPointer<KDevelop::DUContext>&, const Cursor&, View*)>(&CodeCompletionWorker::computeCompletions), Qt::QueuedConnection);
connect(m_model, &CodeCompletionModel::doSpecialProcessingInBackground, m_worker, &CodeCompletionWorker::doSpecialProcessing);
exec();
}
......@@ -368,7 +368,7 @@ KDevelop::TopDUContextPointer CodeCompletionModel::currentTopContext() const
return m_currentTopContext;
}
void CodeCompletionModel::setCurrentTopContext(KDevelop::TopDUContextPointer topContext)
void CodeCompletionModel::setCurrentTopContext(const KDevelop::TopDUContextPointer& topContext)
{
m_currentTopContext = topContext;
}
......
......@@ -83,7 +83,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT CodeCompletionModel : public KTextEditor::Code
///Convenience-storage for use by the inherited completion model
KDevelop::TopDUContextPointer currentTopContext() const;
void setCurrentTopContext(KDevelop::TopDUContextPointer topContext);
void setCurrentTopContext(const KDevelop::TopDUContextPointer& topContext);
///Tracks navigation widget so they can be interactive with through the keyboard later on
void addNavigationWidget(const CompletionTreeElement* element, QWidget* widget) const;
......
......@@ -162,7 +162,7 @@ struct CodeCompletionItemTester
struct InsertIntoDUChain
{
///Artificially inserts a file called @p name with the text @p text
InsertIntoDUChain(QString name, QString text) : m_insertedCode(IndexedString(name), text), m_topContext(0) {
InsertIntoDUChain(const QString& name, const QString& text) : m_insertedCode(IndexedString(name), text), m_topContext(0) {
}
~InsertIntoDUChain() {
......@@ -199,7 +199,7 @@ struct InsertIntoDUChain
}
///Helper function: get a declaration based on its qualified identifier
Declaration* getDeclaration(QString id) {
Declaration* getDeclaration(const QString& id) {
get();
if(!topContext())
return 0;
......
......@@ -72,7 +72,7 @@ void CodeCompletionWorker::foundDeclarations(const QList<CompletionTreeElementPo
emit foundDeclarationsReal(items, completionContext);
}
void CodeCompletionWorker::computeCompletions(KDevelop::DUContextPointer context, const KTextEditor::Cursor& position, KTextEditor::View* view)
void CodeCompletionWorker::computeCompletions(const KDevelop::DUContextPointer& context, const KTextEditor::Cursor& position, KTextEditor::View* view)
{
{
QMutexLocker lock(m_mutex);
......@@ -196,7 +196,7 @@ QList<QExplicitlySharedDataPointer<CompletionTreeElement> > CodeCompletionWorker
* 2. Group by inheritance depth
* 3. Group by simplified attributes
* */
CodeCompletionItemGrouper<ArgumentHintDepthExtractor, CodeCompletionItemGrouper<InheritanceDepthExtractor, CodeCompletionItemGrouper<SimplifiedAttributesExtractor> > > argumentHintDepthGrouper(tree, nullptr, items);
CodeCompletionItemGrouper<ArgumentHintDepthExtractor, CodeCompletionItemGrouper<InheritanceDepthExtractor, CodeCompletionItemGrouper<SimplifiedAttributesExtractor> > > argumentHintDepthGrouper(tree, nullptr, std::move(items));
return tree;
}
......
......@@ -92,7 +92,7 @@ class KDEVPLATFORMLANGUAGE_EXPORT CodeCompletionWorker : public QObject
public Q_SLOTS:
///Connection from the foreground thread within CodeCompletionModel
void computeCompletions(KDevelop::DUContextPointer context, const KTextEditor::Cursor& position, KTextEditor::View* view);
void computeCompletions(const KDevelop::DUContextPointer& context, const KTextEditor::Cursor& position, KTextEditor::View* view);
///This can be used to do special processing within the background, completely bypassing the normal computeCompletions(..) etc. system.
///It will be executed within the background when the model emits doSpecialProcessingInBackground
virtual void doSpecialProcessing(uint data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment