Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix compiler warnings: unused-parameter

Freya Lupendf81ccfdbcdd
diff --git a/libs/flake/text/KoFontChangeTracker.cpp b/libs/flake/text/KoFontChangeTracker.cpp
index 66bcc62e93..b026eed9ed 100644
--- a/libs/flake/text/KoFontChangeTracker.cpp
+++ b/libs/flake/text/KoFontChangeTracker.cpp
@@ -11,7 +11,7 @@
struct KoFontChangeTracker::Private {
- Private(QStringList paths = QStringList(), int refresh = 500)
+ Private(QStringList paths = QStringList())
: fileSystemWatcher(paths) {
}
@@ -25,7 +25,7 @@ KoFontChangeTracker::KoFontChangeTracker(QStringList paths, QObject *parent)
: QObject(parent)
, d(new Private(paths))
{
- connect(&d->fileSystemWatcher, SIGNAL(directoryChanged(QString)), SLOT(directoriesChanged(QString)));
+ connect(&d->fileSystemWatcher, SIGNAL(directoryChanged(QString)), SLOT(directoriesChanged()));
}
KoFontChangeTracker::~KoFontChangeTracker()
@@ -38,7 +38,7 @@ void KoFontChangeTracker::resetChangeTracker()
}
-void KoFontChangeTracker::directoriesChanged(QString path)
+void KoFontChangeTracker::directoriesChanged()
{
if (!d->filesChanged) {
d->filesChanged = true;
diff --git a/libs/flake/text/KoFontChangeTracker.h b/libs/flake/text/KoFontChangeTracker.h
index e02e40fe7f..4a8d7fee8a 100644
--- a/libs/flake/text/KoFontChangeTracker.h
+++ b/libs/flake/text/KoFontChangeTracker.h
@@ -25,7 +25,7 @@ public:
Q_SIGNALS:
void sigUpdateConfig();
private Q_SLOTS:
- void directoriesChanged(QString path);
+ void directoriesChanged();
private:
struct Private;
QScopedPointer<Private> d;
diff --git a/libs/flake/text/KoSvgTextShapeLayoutFunc.h b/libs/flake/text/KoSvgTextShapeLayoutFunc.h
index 2c68f13b1e..3836162078 100644
--- a/libs/flake/text/KoSvgTextShapeLayoutFunc.h
+++ b/libs/flake/text/KoSvgTextShapeLayoutFunc.h
@@ -19,7 +19,6 @@ void addWordToLine(QVector<CharacterResult> &result,
QPointF &currentPos,
QVector<int> &wordIndices,
LineBox &currentLine,
- bool ltr,
bool isHorizontal);
void finalizeLine(QVector<CharacterResult> &result,
diff --git a/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp b/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp
index 282c10b0cf..d3fcaf0f26 100644
--- a/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp
+++ b/libs/flake/text/KoSvgTextShapeLayoutFunc_inShape.cpp
@@ -555,7 +555,7 @@ QVector<LineBox> flowTextInShapes(const KoSvgTextProperties &properties,
}
} else {
currentLine.currentChunk = i;
- addWordToLine(result, currentPos, wordIndices, currentLine, ltr, isHorizontal);
+ addWordToLine(result, currentPos, wordIndices, currentLine, isHorizontal);
break;
}
}
@@ -669,7 +669,7 @@ QVector<LineBox> flowTextInShapes(const KoSvgTextProperties &properties,
wordIndices = wordNew;
}
}
- addWordToLine(result, currentPos, wordIndices, currentLine, ltr, isHorizontal);
+ addWordToLine(result, currentPos, wordIndices, currentLine, isHorizontal);
} else {
currentLine = LineBox();
QPointF advance = currentPos;
diff --git a/libs/flake/text/KoSvgTextShapeLayoutFunc_lines.cpp b/libs/flake/text/KoSvgTextShapeLayoutFunc_lines.cpp
index f3e6c24042..21e019ae79 100644
--- a/libs/flake/text/KoSvgTextShapeLayoutFunc_lines.cpp
+++ b/libs/flake/text/KoSvgTextShapeLayoutFunc_lines.cpp
@@ -55,7 +55,6 @@ void addWordToLine(QVector<CharacterResult> &result,
QPointF &currentPos,
QVector<int> &wordIndices,
LineBox &currentLine,
- bool ltr,
bool isHorizontal)
{
QPointF lineAdvance = currentPos;
@@ -521,10 +520,10 @@ QVector<LineBox> breakLines(const KoSvgTextProperties &properties,
if (abs(lineLength) - inlineSize.customValue > 0.01) {
softBreak = true;
} else {
- addWordToLine(result, currentPos, wordIndices, currentLine, ltr, isHorizontal);
+ addWordToLine(result, currentPos, wordIndices, currentLine, isHorizontal);
}
} else {
- addWordToLine(result, currentPos, wordIndices, currentLine, ltr, isHorizontal);
+ addWordToLine(result, currentPos, wordIndices, currentLine, isHorizontal);
}
}
@@ -564,7 +563,7 @@ QVector<LineBox> breakLines(const KoSvgTextProperties &properties,
if (wordLength <= inlineSize.customValue) {
partialWord.append(i);
} else {
- addWordToLine(result, currentPos, partialWord, currentLine, ltr, isHorizontal);
+ addWordToLine(result, currentPos, partialWord, currentLine, isHorizontal);
finalizeLine(result,
currentPos,
@@ -589,7 +588,7 @@ QVector<LineBox> breakLines(const KoSvgTextProperties &properties,
wordIndices = partialWord;
}
}
- addWordToLine(result, currentPos, wordIndices, currentLine, ltr, isHorizontal);
+ addWordToLine(result, currentPos, wordIndices, currentLine, isHorizontal);
}
if (charResult.breakType == BreakType::HardBreak) {
@@ -613,7 +612,7 @@ QVector<LineBox> breakLines(const KoSvgTextProperties &properties,
if (currentLine.lastLine) {
if (!wordIndices.isEmpty()) {
- addWordToLine(result, currentPos, wordIndices, currentLine, ltr, isHorizontal);
+ addWordToLine(result, currentPos, wordIndices, currentLine, isHorizontal);
}
finalizeLine(result,
currentPos,
diff --git a/libs/image/commands/KisBatchUpdateLayerModificationCommand.cpp b/libs/image/commands/KisBatchUpdateLayerModificationCommand.cpp
index fd3c4da35a..9b04e312bc 100644
--- a/libs/image/commands/KisBatchUpdateLayerModificationCommand.cpp
+++ b/libs/image/commands/KisBatchUpdateLayerModificationCommand.cpp
@@ -12,7 +12,7 @@ KisBatchUpdateLayerModificationCommand::KisBatchUpdateLayerModificationCommand(K
RecipeSP recipe,
KisCommandUtils::FlipFlopCommand::State state,
KUndo2Command *parent)
- : KisCommandUtils::FlipFlopCommand(state)
+ : KisCommandUtils::FlipFlopCommand(state, parent)
, m_image(image)
, m_recipe(recipe)
{
diff --git a/libs/image/kis_node.cpp b/libs/image/kis_node.cpp
index 632c981607..f5a1f81469 100644
--- a/libs/image/kis_node.cpp
+++ b/libs/image/kis_node.cpp
@@ -662,6 +662,9 @@ void KisNode::handleKeyframeChannelFrameAboutToBeRemoved(const KisKeyframeChanne
void KisNode::handleKeyframeChannelFrameHasBeenRemoved(const KisKeyframeChannel *channel, int time)
{
+ Q_UNUSED(channel);
+ Q_UNUSED(time);
+
KIS_SAFE_ASSERT_RECOVER_RETURN(m_d->frameRemovalUpdateRecipe);
m_d->frameRemovalUpdateRecipe->notify(this);
m_d->frameRemovalUpdateRecipe = std::nullopt;
diff --git a/libs/image/tests/KisSpatialContainerTest.cpp b/libs/image/tests/KisSpatialContainerTest.cpp
index cc1fe99a8d..81fc93fd49 100644
--- a/libs/image/tests/KisSpatialContainerTest.cpp
+++ b/libs/image/tests/KisSpatialContainerTest.cpp
@@ -25,10 +25,6 @@ void writeOutVector(QVector<QPointF> &vector)
}
}
-void createPoints(QRandomGenerator& randGen, int n, QVector<QPointF>& initial, QVector<QPointF>& firstChange, QVector<QPointF>& secondChange, KisSpatialContainer &container) {
-
-}
-
void KisSpatialContainerTest::testSpatialContainerAddMovePoints()
{
QRandomGenerator gen(1000);
diff --git a/libs/image/tests/kis_algebra_2d_test.cpp b/libs/image/tests/kis_algebra_2d_test.cpp
index db949715b4..d2ba0af7ce 100644
--- a/libs/image/tests/kis_algebra_2d_test.cpp
+++ b/libs/image/tests/kis_algebra_2d_test.cpp
@@ -1358,6 +1358,8 @@ void testRemoveGutterOneCase(const QString testName, const QPainterPath& shape1,
qCritical() << "Expected:" << expectedVector;
qCritical() << "Actual:" << actualVector;
+#else
+ Q_UNUSED(testName);
#endif
QCOMPARE(actualVector.segmentsCount(), expectedSize);
diff --git a/libs/ui/KisPlatformPluginInterfaceFactory.cpp b/libs/ui/KisPlatformPluginInterfaceFactory.cpp
index 1b187af799..0b0e482678 100644
--- a/libs/ui/KisPlatformPluginInterfaceFactory.cpp
+++ b/libs/ui/KisPlatformPluginInterfaceFactory.cpp
@@ -93,6 +93,7 @@ QString KisPlatformPluginInterfaceFactory::colorManagementReport(QWidget *widget
return "Surface color management is not supported on this platform\n";
}
#else
+ Q_UNUSED(widget);
return "Surface color management is disabled\n";
#endif
}
@@ -108,6 +109,7 @@ QString KisPlatformPluginInterfaceFactory::osPreferredColorSpaceReport(QWidget *
return "Surface color management is not supported on this platform\n";
}
#else
+ Q_UNUSED(widget);
return "Surface color management is disabled\n";
#endif
}
diff --git a/libs/ui/animation/KisFFMpegWrapper.cpp b/libs/ui/animation/KisFFMpegWrapper.cpp
index e43e99d6a9..79b0a600d9 100644
--- a/libs/ui/animation/KisFFMpegWrapper.cpp
+++ b/libs/ui/animation/KisFFMpegWrapper.cpp
@@ -406,6 +406,9 @@ void KisFFMpegWrapper::fixUpNonEmbeddedProcessEnvironment(const QString &process
env.remove("LD_LIBRARY_PATH");
process.setProcessEnvironment(env);
}
+#else
+ Q_UNUSED(processPath);
+ Q_UNUSED(process);
#endif /* Q_OS_LINUX */
}
diff --git a/libs/ui/canvas/kis_canvas2.cpp b/libs/ui/canvas/kis_canvas2.cpp
index e198a58742..0d108e2923 100644
--- a/libs/ui/canvas/kis_canvas2.cpp
+++ b/libs/ui/canvas/kis_canvas2.cpp
@@ -1544,6 +1544,8 @@ void KisCanvas2::slotSurfaceFormatChanged(const KisDisplayConfig &config)
auto newState = m_d->multiSurfaceSetupManager.onCanvasSurfaceFormatChanged(*m_d->multiSurfaceState, config);
m_d->assignChangedMultiSurfaceStateSkipCanvasSurface(newState);
+#else
+ Q_UNUSED(config);
#endif
}
diff --git a/libs/ui/canvas/kis_canvas_decoration.h b/libs/ui/canvas/kis_canvas_decoration.h
index 2a4e2d9fd1..473b61709c 100644
--- a/libs/ui/canvas/kis_canvas_decoration.h
+++ b/libs/ui/canvas/kis_canvas_decoration.h
@@ -64,7 +64,7 @@ public:
static bool comparePriority(KisCanvasDecorationSP decoration1, KisCanvasDecorationSP decoration2);
virtual void notifyWindowMinimized(bool minimized);
- virtual void setCanvasWidget(KisCanvasWidgetBase* canvas) {};
+ virtual void setCanvasWidget(KisCanvasWidgetBase* canvas) { Q_UNUSED(canvas); };
public Q_SLOTS:
/**
diff --git a/libs/ui/input/kis_input_manager.cpp b/libs/ui/input/kis_input_manager.cpp
index 09b4df24f5..62e7b19c7a 100644
--- a/libs/ui/input/kis_input_manager.cpp
+++ b/libs/ui/input/kis_input_manager.cpp
@@ -870,7 +870,7 @@ bool KisInputManager::eventFilterImpl(QEvent * event)
if (ignoreCancel) {
d->matcher.touchEndEvent(touchEvent);
} else {
- d->matcher.touchCancelEvent(touchEvent, d->previousPos);
+ d->matcher.touchCancelEvent(touchEvent);
}
// reset state
d->lastPointCount = 0;
diff --git a/libs/ui/input/kis_shortcut_matcher.cpp b/libs/ui/input/kis_shortcut_matcher.cpp
index 17f776cfbf..a1187d1e5b 100644
--- a/libs/ui/input/kis_shortcut_matcher.cpp
+++ b/libs/ui/input/kis_shortcut_matcher.cpp
@@ -514,7 +514,7 @@ bool KisShortcutMatcher::touchEndEvent(QTouchEvent *event)
return retval;
}
-void KisShortcutMatcher::touchCancelEvent(QTouchEvent *event, const QPointF &localPos)
+void KisShortcutMatcher::touchCancelEvent(QTouchEvent *event)
{
Private::RecursionNotifier notifier(this);
diff --git a/libs/ui/input/kis_shortcut_matcher.h b/libs/ui/input/kis_shortcut_matcher.h
index e84d905172..a6a7f4c95c 100644
--- a/libs/ui/input/kis_shortcut_matcher.h
+++ b/libs/ui/input/kis_shortcut_matcher.h
@@ -184,7 +184,7 @@ public:
* right here i.e without a valid TouchEnd, so we should immediately stop
* all running actions.
*/
- void touchCancelEvent(QTouchEvent *event, const QPointF &localPos);
+ void touchCancelEvent(QTouchEvent *event);
/**
* Effectively a long-press touch event, generated by KisInputManager
diff --git a/libs/ui/kis_selection_actions_panel.cpp b/libs/ui/kis_selection_actions_panel.cpp
index 3e9169458f..6def6b3e3f 100644
--- a/libs/ui/kis_selection_actions_panel.cpp
+++ b/libs/ui/kis_selection_actions_panel.cpp
@@ -170,6 +170,8 @@ void KisSelectionActionsPanel::setEnabled(bool enabled)
bool KisSelectionActionsPanel::eventFilter(QObject *obj, QEvent *event)
{
+ Q_UNUSED(obj);
+
switch (event->type()) {
case QEvent::MouseButtonPress: {
const QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
diff --git a/libs/ui/opengl/kis_opengl.cpp b/libs/ui/opengl/kis_opengl.cpp
index c0465c2bf8..465e898327 100644
--- a/libs/ui/opengl/kis_opengl.cpp
+++ b/libs/ui/opengl/kis_opengl.cpp
@@ -616,6 +616,7 @@ KisOpenGL::RendererConfig generateSurfaceConfig(KisOpenGL::OpenGLRenderer render
#if defined Q_OS_MACOS
format.setVersion(4, 1);
format.setProfile(QSurfaceFormat::CoreProfile);
+ Q_UNUSED(inhibitCompatibilityProfile);
#else
// If asked for 3.0 "Core", Qt will instead request
// an OpenGL ES context.
diff --git a/libs/widgetutils/KisFontFamilyValidator.cpp b/libs/widgetutils/KisFontFamilyValidator.cpp
index ebf8991bd0..687b66719b 100644
--- a/libs/widgetutils/KisFontFamilyValidator.cpp
+++ b/libs/widgetutils/KisFontFamilyValidator.cpp
@@ -16,6 +16,8 @@ KisFontFamilyValidator::KisFontFamilyValidator(const QStringList &families, QObj
QValidator::State KisFontFamilyValidator::validate(QString &input, int &pos) const
{
+ Q_UNUSED(pos);
+
for (const QString &family : m_families) {
if (input == family) {
return State::Acceptable;
diff --git a/plugins/extensions/resourcemanager/dlg_create_bundle.cpp b/plugins/extensions/resourcemanager/dlg_create_bundle.cpp
index 9d8f02c5fd..17abc13bb6 100644
--- a/plugins/extensions/resourcemanager/dlg_create_bundle.cpp
+++ b/plugins/extensions/resourcemanager/dlg_create_bundle.cpp
@@ -150,7 +150,7 @@ DlgCreateBundle::~DlgCreateBundle()
delete m_ui;
}
-QVector<KisTagSP> DlgCreateBundle::getTagsForEmbeddingInResource(QVector<KisTagSP> resourceTags, QString resourceType) const
+QVector<KisTagSP> DlgCreateBundle::getTagsForEmbeddingInResource(QString resourceType) const
{
QVector<KisTagSP> tagsToEmbed;
KisTagModel *tagModel = new KisTagModel(resourceType);
@@ -223,7 +223,7 @@ bool DlgCreateBundle::putResourcesInTheBundle(KoResourceBundleSP bundle)
m_selectedTagIds = m_pageTagChooser->selectedTagIds();
- QVector<KisTagSP> tags = getTagsForEmbeddingInResource(resModel->tagsForResource(id), res->resourceType().first);
+ QVector<KisTagSP> tags = getTagsForEmbeddingInResource(res->resourceType().first);
bundle->addResource(res->resourceType().first, res->filename(), tags, res->md5Sum(), res->resourceId(), prettyFilename);
if (m_bundleCreaterMode == "Creator") {
diff --git a/plugins/extensions/resourcemanager/dlg_create_bundle.h b/plugins/extensions/resourcemanager/dlg_create_bundle.h
index c68e1df4e8..d5f87f8e60 100644
--- a/plugins/extensions/resourcemanager/dlg_create_bundle.h
+++ b/plugins/extensions/resourcemanager/dlg_create_bundle.h
@@ -41,7 +41,7 @@ private Q_SLOTS:
void reject() override;
void saveToConfiguration(bool full);
- QVector<KisTagSP> getTagsForEmbeddingInResource(QVector<KisTagSP> resourceTags, QString resourceType) const;
+ QVector<KisTagSP> getTagsForEmbeddingInResource(QString resourceType) const;
public Q_SLOTS:
diff --git a/plugins/impex/libkra/kis_kra_loader.cpp b/plugins/impex/libkra/kis_kra_loader.cpp
index f82a69fd42..c540338fd0 100644
--- a/plugins/impex/libkra/kis_kra_loader.cpp
+++ b/plugins/impex/libkra/kis_kra_loader.cpp
@@ -384,7 +384,7 @@ KisImageSP KisKraLoader::loadXML(const QDomElement& imageElement)
} else if (e.tagName() == "assistants") {
loadAssistantsList(e);
} else if (e.tagName() == "audio") {
- backCompat_loadAudio(e, image, m_d->document);
+ backCompat_loadAudio(e, m_d->document);
}
}
@@ -669,7 +669,7 @@ void KisKraLoader::loadAudio(KoStore *store, KisDocument *kisDoc)
}
}
-void KisKraLoader::backCompat_loadAudio(const QDomElement& elem, KisImageSP image, KisDocument *document)
+void KisKraLoader::backCompat_loadAudio(const QDomElement& elem, KisDocument *document)
{
QDomDocument dom;
dom.appendChild(dom.importNode(elem, true));
diff --git a/plugins/impex/libkra/kis_kra_loader.h b/plugins/impex/libkra/kis_kra_loader.h
index c87875982a..eded575efc 100644
--- a/plugins/impex/libkra/kis_kra_loader.h
+++ b/plugins/impex/libkra/kis_kra_loader.h
@@ -49,7 +49,7 @@ public:
void loadStoryboards(KoStore *store, KisDocument *doc);
void loadAnimationMetadata(KoStore *store, KisImageSP image);
void loadAudio(KoStore *store, KisDocument *kisDoc);
- Q_DECL_DEPRECATED void backCompat_loadAudio(const QDomElement &elem, KisImageSP image, KisDocument *document);
+ Q_DECL_DEPRECATED void backCompat_loadAudio(const QDomElement &elem, KisDocument *document);
vKisNodeSP selectedNodes() const;
diff --git a/plugins/tools/tool_transform2/tests/TransformStrokeStrategyTest.cpp b/plugins/tools/tool_transform2/tests/TransformStrokeStrategyTest.cpp
index 9d1ce043cf..f9846116e9 100644
--- a/plugins/tools/tool_transform2/tests/TransformStrokeStrategyTest.cpp
+++ b/plugins/tools/tool_transform2/tests/TransformStrokeStrategyTest.cpp
@@ -185,6 +185,9 @@ protected:
void iterationEndedCallback(KisImageWSP image, KisNodeSP activeNode, int iteration) override
{
+ Q_UNUSED(image);
+ Q_UNUSED(activeNode);
+
qDebug() << "Waiting for the final update...";
/// the delay in the mask is 3000ms, so we should wait a little bit longer to catch
/// spurious updates