Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Leander Schulten
Lichtsteuerung
Commits
aeb5f59d
Commit
aeb5f59d
authored
Sep 18, 2019
by
Leander Schulten
Browse files
Fix Warnings
parent
6db147a3
Pipeline
#184475
passed with stage
in 2 minutes and 21 seconds
Changes
10
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/codeeditorhelper.h
View file @
aeb5f59d
...
...
@@ -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
();
...
...
src/dmx/driver.cpp
View file @
aeb5f59d
...
...
@@ -203,6 +203,7 @@ namespace Driver {
}
#else
Q_UNUSED
(
path
)
#warning Driverloading is only supported for Windows
#endif
return
false
;
...
...
src/modules/ledconsumer.cpp
View file @
aeb5f59d
...
...
@@ -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
();
...
...
src/modules/ledconsumer.h
View file @
aeb5f59d
...
...
@@ -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
();
...
...
src/modules/modulemanager.cpp
View file @
aeb5f59d
...
...
@@ -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
;
}
...
...
src/modules/types.h
View file @
aeb5f59d
...
...
@@ -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
);
...
...
src/spotify/spotify.h
View file @
aeb5f59d
...
...
@@ -35,7 +35,7 @@ class Spotify : public QObject
QOAuth2AuthorizationCodeFlow
spotify
;
detail
::
KnownUserVector
knownUser
;
bool
isAutoLoginingUser
=
false
;
in
t
currentAutoLoginedUser
;
std
::
size_
t
currentAutoLoginedUser
;
explicit
Spotify
(
QObject
*
parent
=
nullptr
);
public:
static
Spotify
&
get
(){
static
Spotify
s
;
return
s
;}
...
...
src/test/testprogrammblock.h
View file @
aeb5f59d
...
...
@@ -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
>
{
...
...
src/zip.cpp
View file @
aeb5f59d
...
...
@@ -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
();
...
...
src/zip.h
View file @
aeb5f59d
#ifndef ZIP_H
#define
U
ZIP_H
#define ZIP_H
#include <QFileInfo>
#include <functional>
...
...
@@ -9,4 +9,4 @@ namespace Zip {
}
// namespace Zip
#endif //
U
ZIP_H
#endif // ZIP_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment