Commit aeb5f59d authored by Leander Schulten's avatar Leander Schulten

Fix Warnings

parent 6db147a3
Pipeline #184475 passed with stage
in 2 minutes and 21 seconds
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
const QString message; const QString message;
const int markupLength = 1; const int markupLength = 1;
const bool error; const bool error;
CodeMarkup(int row, int column, int markupLength, bool error,const QString &message):row(row), column(column), markupLength(markupLength), error(error), message(message){} CodeMarkup(int row, int column, int markupLength, bool error,const QString &message):row(row), column(column), message(message), markupLength(markupLength), error(error){}
signals: signals:
void rowChanged(); void rowChanged();
void columnChanged(); void columnChanged();
......
...@@ -203,6 +203,7 @@ namespace Driver { ...@@ -203,6 +203,7 @@ namespace Driver {
} }
#else #else
Q_UNUSED(path)
#warning Driverloading is only supported for Windows #warning Driverloading is only supported for Windows
#endif #endif
return false; return false;
......
...@@ -12,6 +12,7 @@ LedConsumer::LedConsumer():Consumer(ValueType::RGB),name("No Name"){ ...@@ -12,6 +12,7 @@ LedConsumer::LedConsumer():Consumer(ValueType::RGB),name("No Name"){
} }
void LedConsumer::timerEvent(QTimerEvent *event){ void LedConsumer::timerEvent(QTimerEvent *event){
Q_UNUSED(event)
if(lastName != name.getString()){ if(lastName != name.getString()){
emit nameChanged(); emit nameChanged();
lastName = name.getString(); lastName = name.getString();
......
...@@ -23,7 +23,7 @@ class LedConsumer : public ModelVector<rgb_t>, public Consumer ...@@ -23,7 +23,7 @@ class LedConsumer : public ModelVector<rgb_t>, public Consumer
int waitCounter = 0; int waitCounter = 0;
bool active = false; bool active = false;
protected: protected:
void timerEvent(QTimerEvent*event); void timerEvent(QTimerEvent*event) override;
public: public:
inline static ModelVector<LedConsumer*> allLedConsumer; inline static ModelVector<LedConsumer*> allLedConsumer;
LedConsumer(); LedConsumer();
......
...@@ -172,7 +172,7 @@ typedef Modules::Program* (*CreateProgramm)(unsigned int index); ...@@ -172,7 +172,7 @@ typedef Modules::Program* (*CreateProgramm)(unsigned int index);
if(!QFileInfo::exists(fileName)&&!QFileInfo::exists(fileName+".old")){ if(!QFileInfo::exists(fileName)&&!QFileInfo::exists(fileName+".old")){
if(!QFile::rename(name,fileName)){ if(!QFile::rename(name,fileName)){
auto msg = ("Renaming from " + name + " to " + fileName + " does not work").toLatin1(); auto msg = ("Renaming from " + name + " to " + fileName + " does not work").toLatin1();
qCritical(msg.data()); qCritical("%s",msg.data());
} }
return fileName; return fileName;
} }
......
...@@ -140,10 +140,10 @@ namespace Modules { ...@@ -140,10 +140,10 @@ namespace Modules {
inline rgb_t::rgb_t(const hsl_t hsl) { inline rgb_t::rgb_t(const hsl_t hsl) {
// see https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative // see https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_RGB_alternative
const auto kf = [&](const auto n) { return std::fmod(n + hsl.h / 30, 12.f); }; const auto kf = [&](const auto n) { return std::fmod(n + hsl.h / 30, 12.f); };
const auto a = [&](const auto n) { return hsl.s * std::min(hsl.l, 1 - hsl.l); }; const auto a = [&]() { return hsl.s * std::min(hsl.l, 1 - hsl.l); };
const auto f = [&](const auto n) { const auto f = [&](const auto n) {
const auto k = kf(n); const auto k = kf(n);
return hsl.l - a(n) * std::max(std::min(1.f, std::min(k - 3, 9 - k)), -1.f); return hsl.l - a() * std::max(std::min(1.f, std::min(k - 3, 9 - k)), -1.f);
}; };
r = static_cast<brightness_t>(f(0) * 255.f); r = static_cast<brightness_t>(f(0) * 255.f);
g = static_cast<brightness_t>(f(8) * 255.f); g = static_cast<brightness_t>(f(8) * 255.f);
......
...@@ -35,7 +35,7 @@ class Spotify : public QObject ...@@ -35,7 +35,7 @@ class Spotify : public QObject
QOAuth2AuthorizationCodeFlow spotify; QOAuth2AuthorizationCodeFlow spotify;
detail::KnownUserVector knownUser; detail::KnownUserVector knownUser;
bool isAutoLoginingUser = false; bool isAutoLoginingUser = false;
int currentAutoLoginedUser; std::size_t currentAutoLoginedUser;
explicit Spotify(QObject *parent = nullptr); explicit Spotify(QObject *parent = nullptr);
public: public:
static Spotify& get(){static Spotify s; return s;} static Spotify& get(){static Spotify s; return s;}
......
...@@ -36,12 +36,12 @@ void filter()override{ ...@@ -36,12 +36,12 @@ void filter()override{
} }
} }
bool doStep(Modules::time_diff_t){ bool doStep(Modules::time_diff_t)override{
return false; return false;
} }
virtual const char* getName()const {return "TestFilter";} virtual const char* getName()const override{return "TestFilter";}
virtual unsigned int computeOutputLength(unsigned int inputLength) {return inputLength;} virtual unsigned int computeOutputLength(unsigned int inputLength) override{return inputLength;}
}; };
class ControlConsumer : public Modules::TypedConsumer<Modules::brightness_t>{ class ControlConsumer : public Modules::TypedConsumer<Modules::brightness_t>{
......
...@@ -13,6 +13,7 @@ void unzipPowershellNew(const QFileInfo& zip, const QFileInfo& unzip, const std: ...@@ -13,6 +13,7 @@ void unzipPowershellNew(const QFileInfo& zip, const QFileInfo& unzip, const std:
auto p = new QProcess(); auto p = new QProcess();
p->start(QStringLiteral("powershell.exe"), QStringList() << QStringLiteral("Expand-Archive") << QStringLiteral("-Force") << "\"" + zip.absoluteFilePath() + "\"" << "\"" + unzip.absoluteFilePath() + "\""); p->start(QStringLiteral("powershell.exe"), QStringList() << QStringLiteral("Expand-Archive") << QStringLiteral("-Force") << "\"" + zip.absoluteFilePath() + "\"" << "\"" + unzip.absoluteFilePath() + "\"");
QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){ QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){
Q_UNUSED(exitStatus)
if(exitCode != 0){ if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with powershell new"; qDebug() << "Failed to unzip " << zip << " to " << unzip << " with powershell new";
qDebug().noquote() << "stderr : " << p->readAllStandardError(); qDebug().noquote() << "stderr : " << p->readAllStandardError();
...@@ -28,6 +29,7 @@ void unzipPowershell(const QFileInfo& zip, const QFileInfo& unzip, const std::fu ...@@ -28,6 +29,7 @@ void unzipPowershell(const QFileInfo& zip, const QFileInfo& unzip, const std::fu
auto p = new QProcess(); auto p = new QProcess();
p->start(QStringLiteral("powershell.exe"), QStringList() << QStringLiteral("-nologo") << QStringLiteral("-noprofile") << "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('"+zip.absoluteFilePath()+"', '"+unzip.absoluteFilePath()+"/unzippedDir'); }"); p->start(QStringLiteral("powershell.exe"), QStringList() << QStringLiteral("-nologo") << QStringLiteral("-noprofile") << "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('"+zip.absoluteFilePath()+"', '"+unzip.absoluteFilePath()+"/unzippedDir'); }");
QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){ QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){
Q_UNUSED(exitStatus)
if(exitCode != 0){ if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with powershell"; qDebug() << "Failed to unzip " << zip << " to " << unzip << " with powershell";
qDebug().noquote() << "stderr : " << p->readAllStandardError(); qDebug().noquote() << "stderr : " << p->readAllStandardError();
...@@ -44,6 +46,7 @@ void unzipWinrar(const QFileInfo& zip, const QFileInfo& unzip, const std::functi ...@@ -44,6 +46,7 @@ void unzipWinrar(const QFileInfo& zip, const QFileInfo& unzip, const std::functi
auto p = new QProcess(); auto p = new QProcess();
p->start(QStringLiteral("C:\\Program Files\\WinRAR\\winrar.exe"), QStringList() << QStringLiteral("x") << QStringLiteral("-ibck") << QStringLiteral("-o+") << zip.absoluteFilePath() << QStringLiteral("*.*") << unzip.absoluteFilePath()); p->start(QStringLiteral("C:\\Program Files\\WinRAR\\winrar.exe"), QStringList() << QStringLiteral("x") << QStringLiteral("-ibck") << QStringLiteral("-o+") << zip.absoluteFilePath() << QStringLiteral("*.*") << unzip.absoluteFilePath());
QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){ QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){
Q_UNUSED(exitStatus)
if(exitCode != 0){ if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with winrar"; qDebug() << "Failed to unzip " << zip << " to " << unzip << " with winrar";
qDebug().noquote() << "stderr : " << p->readAllStandardError(); qDebug().noquote() << "stderr : " << p->readAllStandardError();
...@@ -60,6 +63,7 @@ void unzip7Zip(const QFileInfo& zip, const QFileInfo& unzip, const std::function ...@@ -60,6 +63,7 @@ void unzip7Zip(const QFileInfo& zip, const QFileInfo& unzip, const std::function
auto p = new QProcess(); auto p = new QProcess();
p->start(QStringLiteral("C:\\Program Files\\7-Zip\\7z.exe"), QStringList() << QStringLiteral("x") << QStringLiteral("-y") << zip.absoluteFilePath() << "-o" + unzip.absoluteFilePath()); p->start(QStringLiteral("C:\\Program Files\\7-Zip\\7z.exe"), QStringList() << QStringLiteral("x") << QStringLiteral("-y") << zip.absoluteFilePath() << "-o" + unzip.absoluteFilePath());
QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){ QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){
Q_UNUSED(exitStatus)
if(exitCode != 0){ if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with 7zip"; qDebug() << "Failed to unzip " << zip << " to " << unzip << " with 7zip";
qDebug().noquote() << "stderr : " << p->readAllStandardError(); qDebug().noquote() << "stderr : " << p->readAllStandardError();
......
#ifndef ZIP_H #ifndef ZIP_H
#define UZIP_H #define ZIP_H
#include <QFileInfo> #include <QFileInfo>
#include <functional> #include <functional>
...@@ -9,4 +9,4 @@ namespace Zip { ...@@ -9,4 +9,4 @@ namespace Zip {
} // namespace Zip } // namespace Zip
#endif // UZIP_H #endif // ZIP_H
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