diff --git a/.gitignore b/.gitignore index ab0e4ad3..7f6019ed 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ CMakeCache.txt /lib .directory *.pyc +compile_commands.json diff --git a/include/commandline/Option.h b/include/commandline/Option.h index b6525393..43ab70ee 100644 --- a/include/commandline/Option.h +++ b/include/commandline/Option.h @@ -26,11 +26,12 @@ public: ); Option(const QCommandLineOption &other); + virtual ~Option() = default; virtual bool validate(Parser &parser, QString &value); QString name(); - QString getError(); - QString value(Parser &parser); + QString getError(); + QString value(Parser &parser); const char* getCString(Parser &parser); protected: diff --git a/include/flatbufserver/FlatBufferConnection.h b/include/flatbufserver/FlatBufferConnection.h index d98dd13e..51fe4f2a 100644 --- a/include/flatbufserver/FlatBufferConnection.h +++ b/include/flatbufserver/FlatBufferConnection.h @@ -18,7 +18,7 @@ namespace hyperionnet { -class Reply; +struct Reply; } /// diff --git a/include/grabber/AmlogicWrapper.h b/include/grabber/AmlogicWrapper.h index 31d9d4c9..5a8378f6 100644 --- a/include/grabber/AmlogicWrapper.h +++ b/include/grabber/AmlogicWrapper.h @@ -24,7 +24,7 @@ public slots: /// /// Performs a single frame grab and computes the led-colors /// - virtual void action(); + void action() override; private: /// The actual grabber diff --git a/include/grabber/DispmanxFrameGrabber.h b/include/grabber/DispmanxFrameGrabber.h index 1aea2e01..949f8887 100644 --- a/include/grabber/DispmanxFrameGrabber.h +++ b/include/grabber/DispmanxFrameGrabber.h @@ -42,7 +42,7 @@ public: /// ///@brief Set new width and height for dispmanx, overwrite Grabber.h impl - virtual bool setWidthHeight(int width, int height); + bool setWidthHeight(int width, int height) override; private: /// diff --git a/include/grabber/DispmanxWrapper.h b/include/grabber/DispmanxWrapper.h index f62e6002..d0975ffc 100644 --- a/include/grabber/DispmanxWrapper.h +++ b/include/grabber/DispmanxWrapper.h @@ -26,7 +26,7 @@ public slots: /// /// Performs a single frame grab and computes the led-colors /// - virtual void action(); + void action() override; private: /// The actual grabber diff --git a/include/grabber/FramebufferFrameGrabber.h b/include/grabber/FramebufferFrameGrabber.h index 0ba5b6b8..e688961a 100644 --- a/include/grabber/FramebufferFrameGrabber.h +++ b/include/grabber/FramebufferFrameGrabber.h @@ -32,7 +32,7 @@ public: /// /// @brief Overwrite Grabber.h implememtation /// - virtual void setDevicePath(const QString& path); + void setDevicePath(const QString& path) override; private: /// Framebuffer device e.g. /dev/fb0 diff --git a/include/grabber/FramebufferWrapper.h b/include/grabber/FramebufferWrapper.h index a782d10a..34ee545b 100644 --- a/include/grabber/FramebufferWrapper.h +++ b/include/grabber/FramebufferWrapper.h @@ -26,7 +26,7 @@ public slots: /// /// Performs a single frame grab and computes the led-colors /// - virtual void action(); + void action() override; private: /// The actual grabber diff --git a/include/grabber/OsxFrameGrabber.h b/include/grabber/OsxFrameGrabber.h index 5d692396..2694734c 100644 --- a/include/grabber/OsxFrameGrabber.h +++ b/include/grabber/OsxFrameGrabber.h @@ -40,7 +40,7 @@ public: /// /// @brief Overwrite Grabber.h implementation /// - virtual void setDisplayIndex(int index); + void setDisplayIndex(int index) override; private: /// display diff --git a/include/grabber/OsxWrapper.h b/include/grabber/OsxWrapper.h index 093fa162..88e401b1 100644 --- a/include/grabber/OsxWrapper.h +++ b/include/grabber/OsxWrapper.h @@ -26,7 +26,7 @@ public slots: /// /// Performs a single frame grab and computes the led-colors /// - virtual void action(); + void action() override; private: /// The actual grabber diff --git a/include/grabber/QtGrabber.h b/include/grabber/QtGrabber.h index 3460a038..8863c36e 100644 --- a/include/grabber/QtGrabber.h +++ b/include/grabber/QtGrabber.h @@ -27,22 +27,22 @@ public: /// @param[out] image The snapped screenshot (should be initialized with correct width and /// height) /// - virtual int grabFrame(Image & image); + int grabFrame(Image & image); /// /// @brief Set a new video mode /// - virtual void setVideoMode(VideoMode mode); + void setVideoMode(VideoMode mode) override; /// /// @brief Apply new width/height values, overwrite Grabber.h implementation as qt doesn't use width/height, just pixelDecimation to calc dimensions /// - virtual bool setWidthHeight(int width, int height) { return true; }; + bool setWidthHeight(int width, int height) override { return true; }; /// /// @brief Apply new pixelDecimation /// - virtual void setPixelDecimation(int pixelDecimation); + void setPixelDecimation(int pixelDecimation) override; /// /// Set the crop values @@ -51,12 +51,12 @@ public: /// @param cropTop Top pixel crop /// @param cropBottom Bottom pixel crop /// - virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom); + void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom) override; /// /// @brief Apply display index /// - virtual void setDisplayIndex(int index); + void setDisplayIndex(int index) override; private slots: /// diff --git a/include/grabber/QtWrapper.h b/include/grabber/QtWrapper.h index 67135ed7..a6da25e3 100644 --- a/include/grabber/QtWrapper.h +++ b/include/grabber/QtWrapper.h @@ -25,7 +25,7 @@ public slots: /// /// Performs a single frame grab and computes the led-colors /// - virtual void action(); + void action() override; private: /// The actual grabber diff --git a/include/grabber/V4L2Wrapper.h b/include/grabber/V4L2Wrapper.h index ff3f5f90..9238d55c 100644 --- a/include/grabber/V4L2Wrapper.h +++ b/include/grabber/V4L2Wrapper.h @@ -22,11 +22,11 @@ public: bool getCecDetectionEnable(); public slots: - bool start(); - void stop(); + bool start() override; + void stop() override; void setSignalThreshold(double redSignalThreshold, double greenSignalThreshold, double blueSignalThreshold); - void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom); + void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom) override; void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax); void setSignalDetectionEnable(bool enable); void setCecDetectionEnable(bool enable); @@ -38,7 +38,7 @@ private slots: void newFrame(const Image & image); void readError(const char* err); - virtual void action(); + void action() override; private: /// The V4L2 grabber diff --git a/include/grabber/X11Grabber.h b/include/grabber/X11Grabber.h index f39d5aa8..7b0b3bd0 100644 --- a/include/grabber/X11Grabber.h +++ b/include/grabber/X11Grabber.h @@ -34,23 +34,23 @@ public: /// @param[out] image The snapped screenshot (should be initialized with correct width and /// height) /// - virtual int grabFrame(Image & image, bool forceUpdate=false); + int grabFrame(Image & image, bool forceUpdate=false); /// /// update dimension according current screen int updateScreenDimensions(bool force=false); - virtual void setVideoMode(VideoMode mode); + void setVideoMode(VideoMode mode) override; /// /// @brief Apply new width/height values, overwrite Grabber.h implementation as X11 doesn't use width/height, just pixelDecimation to calc dimensions /// - virtual bool setWidthHeight(int width, int height) { return true; }; + bool setWidthHeight(int width, int height) override { return true; }; /// /// @brief Apply new pixelDecimation /// - virtual void setPixelDecimation(int pixelDecimation); + void setPixelDecimation(int pixelDecimation) override; /// /// Set the crop values @@ -59,7 +59,7 @@ public: /// @param cropTop Top pixel crop /// @param cropBottom Bottom pixel crop /// - virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom); + void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom) override; protected: bool nativeEventFilter(const QByteArray & eventType, void * message, long int * result) override; diff --git a/include/grabber/X11Wrapper.h b/include/grabber/X11Wrapper.h index 93dc1e5e..84d3b267 100644 --- a/include/grabber/X11Wrapper.h +++ b/include/grabber/X11Wrapper.h @@ -35,7 +35,7 @@ public slots: /// /// Performs a single frame grab and computes the led-colors /// - virtual void action(); + void action() override; private: /// The actual grabber diff --git a/libsrc/commandline/ColorsOption.cpp b/libsrc/commandline/ColorsOption.cpp index 7caa5f28..d7499a51 100644 --- a/libsrc/commandline/ColorsOption.cpp +++ b/libsrc/commandline/ColorsOption.cpp @@ -22,7 +22,7 @@ bool ColorsOption::validate(Parser & parser, QString & value) QRegularExpressionMatch match = hexRe.match(value); if(match.hasMatch()) { - for(const QString m : match.capturedTexts()) + for(const QString & m : match.capturedTexts()) { _colors.push_back(QColor(QString("#%1").arg(m))); } diff --git a/libsrc/hyperion/HyperionIManager.cpp b/libsrc/hyperion/HyperionIManager.cpp index 58d7d17e..83e190bc 100644 --- a/libsrc/hyperion/HyperionIManager.cpp +++ b/libsrc/hyperion/HyperionIManager.cpp @@ -41,7 +41,7 @@ const QVector HyperionIManager::getInstanceData() void HyperionIManager::startAll() { - for(const auto entry : _instanceTable->getAllInstances(true)) + for(const auto & entry : _instanceTable->getAllInstances(true)) { startInstance(entry["instance"].toInt()); } diff --git a/libsrc/hyperion/SettingsManager.cpp b/libsrc/hyperion/SettingsManager.cpp index 44de6357..153ffb4d 100644 --- a/libsrc/hyperion/SettingsManager.cpp +++ b/libsrc/hyperion/SettingsManager.cpp @@ -41,7 +41,7 @@ SettingsManager::SettingsManager(const quint8& instance, QObject* parent) // transform json to string lists QStringList keyList = defaultConfig.keys(); QStringList defValueList; - for(const auto key : keyList) + for(const auto & key : keyList) { if(defaultConfig[key].isObject()) { @@ -54,7 +54,7 @@ SettingsManager::SettingsManager(const quint8& instance, QObject* parent) } // fill database with default data if required - for(const auto key : keyList) + for(const auto & key : keyList) { QString val = defValueList.takeFirst(); // prevent overwrite @@ -65,7 +65,7 @@ SettingsManager::SettingsManager(const quint8& instance, QObject* parent) // need to validate all data in database constuct the entire data object // TODO refactor schemaChecker to accept QJsonArray in validate(); QJsonDocument container? To validate them per entry... QJsonObject dbConfig; - for(const auto key : keyList) + for(const auto & key : keyList) { QJsonDocument doc = _sTable->getSettingsRecord(key); if(doc.isArray()) @@ -140,7 +140,7 @@ bool SettingsManager::saveSettings(QJsonObject config, const bool& correct) // extract keys and data QStringList keyList = config.keys(); QStringList newValueList; - for(const auto key : keyList) + for(const auto & key : keyList) { if(config[key].isObject()) { @@ -153,7 +153,7 @@ bool SettingsManager::saveSettings(QJsonObject config, const bool& correct) } // compare database data with new data to emit/save changes accordingly - for(const auto key : keyList) + for(const auto & key : keyList) { QString data = newValueList.takeFirst(); if(_sTable->getSettingsRecordString(key) != data)