benlau/quickandroid

Compie issue

Closed this issue · 3 comments

When compiing using -Wall -Werror flags, the compile fails at:

../../qaimagewriter.cpp:77:34: warning: unused parameter 'fileUrl' [-Wunused-parameter]
 void QAImageWriter::save(QString fileUrl)

This could be avoided by adding a Q_UNUSED macro

diff --git a/qaimagewriter.cpp b/qaimagewriter.cpp
index 5240fcf..bc0af0b 100644
--- a/qaimagewriter.cpp
+++ b/qaimagewriter.cpp
@@ -76,6 +76,7 @@ void QAImageWriter::setImage(const QImage &image)

 void QAImageWriter::save(QString fileUrl)
 {
+    Q_UNUSED(fileUrl)
     if (m_running) {
         qWarning() << "ImageWriter::save() - It is already running.";
         return;

But what is the reason there is a filename argument for the save function while it's not used at all? (should it not simply be removed)..
With the current function it's possible to call save with an argument, and end up with something 'wrong' without ever knowing about it..

In short:
using Q_UNUSED solves the compiler issue, but is in my opinion the wrong thing to do.
leaving 2 possible solutions; 1 remove the filename as argument, or use the argument in case it's given.

hi @kneeke

Thanks for reporting this problem. I have forgotten to implement this function. It is fixed in master branch. And I will add "-Wall -Werror" flag in test case for verification.

@benlau Can you please update version in qmp.json?

@molchanoviv Done. 0.1.6.1 has been published on qpm.io