From 3ec0456a91a1e14b4dd36f39817e286900b961d2 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Fri, 31 Jul 2020 08:26:33 +0200 Subject: [PATCH] Add missing Q_REQUIRED_RESULT --- src/composer-ng/nestedlisthelper_p.h | 6 +++--- src/composer-ng/richtextcomposerimages.h | 2 +- src/composer-ng/richtextexternalcomposer.cpp | 2 +- src/inserthtmldialog.h | 2 +- src/insertimagedialog.h | 8 ++++---- src/insertimagewidget.h | 8 ++++---- src/inserttabledialog.h | 10 +++++----- .../abstracttexttospeechconfiginterface.h | 8 ++++---- src/texttospeech/abstracttexttospeechinterface.h | 4 ++-- src/texttospeech/texttospeech.h | 12 ++++++------ src/texttospeech/texttospeechactions.h | 2 +- src/texttospeech/texttospeechconfiginterface.h | 8 ++++---- src/texttospeech/texttospeechinterface.h | 2 +- 13 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/composer-ng/nestedlisthelper_p.h b/src/composer-ng/nestedlisthelper_p.h index f2f8ac8..5472927 100644 --- a/src/composer-ng/nestedlisthelper_p.h +++ b/src/composer-ng/nestedlisthelper_p.h @@ -23,7 +23,7 @@ #define NESTEDLISTHELPER_H //@cond PRIVATE - +#include class QTextEdit; class QKeyEvent; @@ -109,7 +109,7 @@ public: * * @return Whether the item can be indented. */ - bool canIndent() const; + Q_REQUIRED_RESULT bool canIndent() const; /** * \brief Check whether the current item in the list may be dedented. @@ -120,7 +120,7 @@ public: * * @return Whether the item can be dedented. */ - bool canDedent() const; + Q_REQUIRED_RESULT bool canDedent() const; private: QTextCursor topOfSelection(); diff --git a/src/composer-ng/richtextcomposerimages.h b/src/composer-ng/richtextcomposerimages.h index 553b64d..36b0524 100644 --- a/src/composer-ng/richtextcomposerimages.h +++ b/src/composer-ng/richtextcomposerimages.h @@ -109,7 +109,7 @@ public: * * @return a modified HTML code, where the \ tags got replaced */ - static QByteArray imageNamesToContentIds(const QByteArray &htmlBody, const ImageList &imageList); + static Q_REQUIRED_RESULT QByteArray imageNamesToContentIds(const QByteArray &htmlBody, const ImageList &imageList); Q_REQUIRED_RESULT QSharedPointer createEmbeddedImage(const QImage &img, const QString &imageName) const; private: diff --git a/src/composer-ng/richtextexternalcomposer.cpp b/src/composer-ng/richtextexternalcomposer.cpp index 126a9fc..752bd51 100644 --- a/src/composer-ng/richtextexternalcomposer.cpp +++ b/src/composer-ng/richtextexternalcomposer.cpp @@ -41,7 +41,7 @@ public: QString extEditorPath; KProcess *externalEditorProcess = nullptr; QTemporaryFile *extEditorTempFile = nullptr; - RichTextComposer *richTextComposer = nullptr; + RichTextComposer *const richTextComposer = nullptr; bool useExtEditor = false; }; diff --git a/src/inserthtmldialog.h b/src/inserthtmldialog.h index d2c783c..4d5ee26 100644 --- a/src/inserthtmldialog.h +++ b/src/inserthtmldialog.h @@ -34,7 +34,7 @@ class KPIMTEXTEDIT_TESTS_EXPORT InsertHtmlDialog : public QDialog public: explicit InsertHtmlDialog(QWidget *parent = nullptr); ~InsertHtmlDialog(); - QString html() const; + Q_REQUIRED_RESULT QString html() const; void setSelectedText(const QString &str); private: diff --git a/src/insertimagedialog.h b/src/insertimagedialog.h index b48bfbb..b44cfe6 100644 --- a/src/insertimagedialog.h +++ b/src/insertimagedialog.h @@ -34,16 +34,16 @@ public: explicit InsertImageDialog(QWidget *parent = nullptr); ~InsertImageDialog(); - int imageWidth() const; - int imageHeight() const; + Q_REQUIRED_RESULT int imageWidth() const; + Q_REQUIRED_RESULT int imageHeight() const; void setImageWidth(int value); void setImageHeight(int value); - QUrl imageUrl() const; + Q_REQUIRED_RESULT QUrl imageUrl() const; void setImageUrl(const QUrl &url); - bool keepOriginalSize() const; + Q_REQUIRED_RESULT bool keepOriginalSize() const; private: friend class InsertImageDialogPrivate; diff --git a/src/insertimagewidget.h b/src/insertimagewidget.h index 92fca91..d383910 100644 --- a/src/insertimagewidget.h +++ b/src/insertimagewidget.h @@ -35,15 +35,15 @@ public: ~InsertImageWidget(); void setImageWidth(int value); - int imageWidth() const; + Q_REQUIRED_RESULT int imageWidth() const; void setImageHeight(int value); - int imageHeight() const; + Q_REQUIRED_RESULT int imageHeight() const; - QUrl imageUrl() const; + Q_REQUIRED_RESULT QUrl imageUrl() const; void setImageUrl(const QUrl &url); - bool keepOriginalSize() const; + Q_REQUIRED_RESULT bool keepOriginalSize() const; Q_SIGNALS: void enableButtonOk(bool enabled); diff --git a/src/inserttabledialog.h b/src/inserttabledialog.h index 9e303f2..0343eb8 100644 --- a/src/inserttabledialog.h +++ b/src/inserttabledialog.h @@ -32,17 +32,17 @@ class InsertTableDialog : public QDialog public: explicit InsertTableDialog(QWidget *parent); ~InsertTableDialog(); - int columns() const; - int rows() const; - int border() const; + Q_REQUIRED_RESULT int columns() const; + Q_REQUIRED_RESULT int rows() const; + Q_REQUIRED_RESULT int border() const; void setColumns(int col); void setRows(int rows); void setBorder(int border); - QTextLength::Type typeOfLength() const; + Q_REQUIRED_RESULT QTextLength::Type typeOfLength() const; void setTypeOfLength(QTextLength::Type type); - int length() const; + Q_REQUIRED_RESULT int length() const; void setLength(int); private: diff --git a/src/texttospeech/abstracttexttospeechconfiginterface.h b/src/texttospeech/abstracttexttospeechconfiginterface.h index 2d5e108..c551677 100644 --- a/src/texttospeech/abstracttexttospeechconfiginterface.h +++ b/src/texttospeech/abstracttexttospeechconfiginterface.h @@ -35,12 +35,12 @@ class KPIMTEXTEDIT_EXPORT AbstractTextToSpeechConfigInterface : public QObject public: explicit AbstractTextToSpeechConfigInterface(QObject *parent = nullptr); ~AbstractTextToSpeechConfigInterface(); - virtual QVector availableLocales() const; - virtual QLocale locale() const; + virtual Q_REQUIRED_RESULT QVector availableLocales() const; + virtual Q_REQUIRED_RESULT QLocale locale() const; virtual void setLocale(const QLocale &locale); - virtual QStringList availableEngines() const; - virtual QStringList availableVoices() const; + virtual Q_REQUIRED_RESULT QStringList availableEngines() const; + virtual Q_REQUIRED_RESULT QStringList availableVoices() const; virtual void setEngine(const QString &engineName); }; } diff --git a/src/texttospeech/abstracttexttospeechinterface.h b/src/texttospeech/abstracttexttospeechinterface.h index d1175a5..22f5be4 100644 --- a/src/texttospeech/abstracttexttospeechinterface.h +++ b/src/texttospeech/abstracttexttospeechinterface.h @@ -33,9 +33,9 @@ public: explicit AbstractTextToSpeechInterface(QObject *parent = nullptr); ~AbstractTextToSpeechInterface(); - virtual bool isReady() const; + virtual Q_REQUIRED_RESULT bool isReady() const; virtual void say(const QString &text); - virtual int volume() const; + virtual Q_REQUIRED_RESULT int volume() const; virtual void setVolume(int value); virtual void reloadSettings(); }; diff --git a/src/texttospeech/texttospeech.h b/src/texttospeech/texttospeech.h index 70d260d..2b9ba6c 100644 --- a/src/texttospeech/texttospeech.h +++ b/src/texttospeech/texttospeech.h @@ -38,7 +38,7 @@ public: ~TextToSpeech(); - bool isReady() const; + Q_REQUIRED_RESULT bool isReady() const; enum State { Ready = 0, @@ -47,12 +47,12 @@ public: BackendError }; - double volume() const; - QVector availableLocales() const; - QStringList availableEngines() const; - QStringList availableVoices() const; + Q_REQUIRED_RESULT double volume() const; + Q_REQUIRED_RESULT QVector availableLocales() const; + Q_REQUIRED_RESULT QStringList availableEngines() const; + Q_REQUIRED_RESULT QStringList availableVoices() const; - QLocale locale() const; + Q_REQUIRED_RESULT QLocale locale() const; void reloadSettings(); public Q_SLOTS: diff --git a/src/texttospeech/texttospeechactions.h b/src/texttospeech/texttospeechactions.h index 055ed66..708bef5 100644 --- a/src/texttospeech/texttospeechactions.h +++ b/src/texttospeech/texttospeechactions.h @@ -41,7 +41,7 @@ public: QAction *playPauseAction() const; - TextToSpeechWidget::State state() const; + Q_REQUIRED_RESULT TextToSpeechWidget::State state() const; public Q_SLOTS: void setState(TextToSpeechWidget::State); diff --git a/src/texttospeech/texttospeechconfiginterface.h b/src/texttospeech/texttospeechconfiginterface.h index b06bca2..ac41862 100644 --- a/src/texttospeech/texttospeechconfiginterface.h +++ b/src/texttospeech/texttospeechconfiginterface.h @@ -35,11 +35,11 @@ public: explicit TextToSpeechConfigInterface(QObject *parent = nullptr); ~TextToSpeechConfigInterface() override; - QVector availableLocales() const override; - QLocale locale() const override; + Q_REQUIRED_RESULT QVector availableLocales() const override; + Q_REQUIRED_RESULT QLocale locale() const override; - QStringList availableEngines() const override; - QStringList availableVoices() const override; + Q_REQUIRED_RESULT QStringList availableEngines() const override; + Q_REQUIRED_RESULT QStringList availableVoices() const override; void setEngine(const QString &engineName) override; QTextToSpeech *mTextToSpeech = nullptr; }; diff --git a/src/texttospeech/texttospeechinterface.h b/src/texttospeech/texttospeechinterface.h index 0f1da0b..b13b133 100644 --- a/src/texttospeech/texttospeechinterface.h +++ b/src/texttospeech/texttospeechinterface.h @@ -38,7 +38,7 @@ public: explicit TextToSpeechInterface(TextToSpeechWidget *textToSpeechWidget, QObject *parent = nullptr); ~TextToSpeechInterface() override; - bool isReady() const override; + Q_REQUIRED_RESULT bool isReady() const override; void say(const QString &text) override; Q_REQUIRED_RESULT int volume() const override; void setVolume(int value) override; -- GitLab