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:
const QString message;
const int markupLength = 1;
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:
void rowChanged();
void columnChanged();
......
......@@ -203,6 +203,7 @@ namespace Driver {
}
#else
Q_UNUSED(path)
#warning Driverloading is only supported for Windows
#endif
return false;
......
......@@ -12,6 +12,7 @@ LedConsumer::LedConsumer():Consumer(ValueType::RGB),name("No Name"){
}
void LedConsumer::timerEvent(QTimerEvent *event){
Q_UNUSED(event)
if(lastName != name.getString()){
emit nameChanged();
lastName = name.getString();
......
......@@ -23,7 +23,7 @@ class LedConsumer : public ModelVector<rgb_t>, public Consumer
int waitCounter = 0;
bool active = false;
protected:
void timerEvent(QTimerEvent*event);
void timerEvent(QTimerEvent*event) override;
public:
inline static ModelVector<LedConsumer*> allLedConsumer;
LedConsumer();
......
......@@ -172,7 +172,7 @@ typedef Modules::Program* (*CreateProgramm)(unsigned int index);
if(!QFileInfo::exists(fileName)&&!QFileInfo::exists(fileName+".old")){
if(!QFile::rename(name,fileName)){
auto msg = ("Renaming from " + name + " to " + fileName + " does not work").toLatin1();
qCritical(msg.data());
qCritical("%s",msg.data());
}
return fileName;
}
......
......@@ -140,10 +140,10 @@ namespace Modules {
inline rgb_t::rgb_t(const hsl_t hsl) {
// 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 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 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);
g = static_cast<brightness_t>(f(8) * 255.f);
......
......@@ -35,7 +35,7 @@ class Spotify : public QObject
QOAuth2AuthorizationCodeFlow spotify;
detail::KnownUserVector knownUser;
bool isAutoLoginingUser = false;
int currentAutoLoginedUser;
std::size_t currentAutoLoginedUser;
explicit Spotify(QObject *parent = nullptr);
public:
static Spotify& get(){static Spotify s; return s;}
......
......@@ -36,12 +36,12 @@ void filter()override{
}
}
bool doStep(Modules::time_diff_t){
bool doStep(Modules::time_diff_t)override{
return false;
}
virtual const char* getName()const {return "TestFilter";}
virtual unsigned int computeOutputLength(unsigned int inputLength) {return inputLength;}
virtual const char* getName()const override{return "TestFilter";}
virtual unsigned int computeOutputLength(unsigned int inputLength) override{return inputLength;}
};
class ControlConsumer : public Modules::TypedConsumer<Modules::brightness_t>{
......
......@@ -13,6 +13,7 @@ void unzipPowershellNew(const QFileInfo& zip, const QFileInfo& unzip, const std:
auto p = new QProcess();
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){
Q_UNUSED(exitStatus)
if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with powershell new";
qDebug().noquote() << "stderr : " << p->readAllStandardError();
......@@ -28,6 +29,7 @@ void unzipPowershell(const QFileInfo& zip, const QFileInfo& unzip, const std::fu
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'); }");
QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){
Q_UNUSED(exitStatus)
if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with powershell";
qDebug().noquote() << "stderr : " << p->readAllStandardError();
......@@ -44,6 +46,7 @@ void unzipWinrar(const QFileInfo& zip, const QFileInfo& unzip, const std::functi
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());
QObject::connect(p,qOverload<int,QProcess::ExitStatus>(&QProcess::finished),[p,zip,unzip,callback](auto exitCode, auto exitStatus){
Q_UNUSED(exitStatus)
if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with winrar";
qDebug().noquote() << "stderr : " << p->readAllStandardError();
......@@ -60,6 +63,7 @@ void unzip7Zip(const QFileInfo& zip, const QFileInfo& unzip, const std::function
auto p = new QProcess();
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){
Q_UNUSED(exitStatus)
if(exitCode != 0){
qDebug() << "Failed to unzip " << zip << " to " << unzip << " with 7zip";
qDebug().noquote() << "stderr : " << p->readAllStandardError();
......
#ifndef ZIP_H
#define UZIP_H
#define ZIP_H
#include <QFileInfo>
#include <functional>
......@@ -9,4 +9,4 @@ 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