Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
cddc05a1
Commit
cddc05a1
authored
Jun 19, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ImageProvider): add const when necessary
parent
b74698da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
ImageProvider.cpp
src/app/providers/ImageProvider.cpp
+15
-14
No files found.
src/app/providers/ImageProvider.cpp
View file @
cddc05a1
...
...
@@ -46,11 +46,12 @@ static QByteArray buildByteArrayAttribute (const QByteArray &name, const QByteAr
return
attribute
;
}
static
QByteArray
fillFillAndStroke
(
QXmlStreamAttributes
&
readerAttributes
,
bool
&
fill
,
bool
&
stroke
,
const
Colors
&
colors
)
{
static
QByteArray
fillFillAndStroke
(
const
QXmlStreamAttributes
&
readerAttributes
,
bool
&
fill
,
bool
&
stroke
,
const
Colors
&
colors
)
{
static
QRegExp
regex
(
"^color-([^-]+)-(fill|stroke)$"
);
QByteArray
attributes
;
QByteArray
value
=
readerAttributes
.
value
(
"class"
).
toLatin1
();
const
QByteArray
value
=
readerAttributes
.
value
(
"class"
).
toLatin1
();
if
(
!
value
.
length
())
return
attributes
;
...
...
@@ -61,13 +62,13 @@ static QByteArray fillFillAndStroke (QXmlStreamAttributes &readerAttributes, boo
continue
;
const
QString
colorName
=
list
[
1
];
QVariant
colorValue
=
colors
.
property
(
colorName
.
toStdString
().
c_str
());
const
QVariant
colorValue
=
colors
.
property
(
colorName
.
toStdString
().
c_str
());
if
(
!
colorValue
.
isValid
())
{
qWarning
()
<<
QStringLiteral
(
"Color name `%1` does not exist."
).
arg
(
colorName
);
continue
;
}
QByteArray
property
=
list
[
2
].
toLatin1
();
const
QByteArray
property
=
list
[
2
].
toLatin1
();
if
(
property
==
QStringLiteral
(
"fill"
))
fill
=
true
;
else
...
...
@@ -84,20 +85,20 @@ static QByteArray fillFillAndStroke (QXmlStreamAttributes &readerAttributes, boo
return
attributes
;
}
static
QByteArray
parseAttributes
(
QXmlStreamReader
&
reader
,
const
Colors
&
colors
)
{
QXmlStreamAttributes
readerAttributes
=
reader
.
attributes
();
static
QByteArray
parseAttributes
(
const
QXmlStreamReader
&
reader
,
const
Colors
&
colors
)
{
const
QXmlStreamAttributes
readerAttributes
=
reader
.
attributes
();
bool
fill
=
false
,
stroke
=
false
;
QByteArray
attributes
=
fillFillAndStroke
(
readerAttributes
,
fill
,
stroke
,
colors
);
for
(
const
auto
&
attribute
:
readerAttributes
)
{
QByteArray
name
=
attribute
.
name
().
toLatin1
();
const
QByteArray
name
=
attribute
.
name
().
toLatin1
();
if
(
fill
&&
name
==
QStringLiteral
(
"fill"
))
continue
;
if
(
stroke
&&
name
==
QStringLiteral
(
"stroke"
))
continue
;
QByteArray
prefix
=
attribute
.
prefix
().
toLatin1
();
QByteArray
value
=
attribute
.
value
().
toLatin1
();
const
QByteArray
prefix
=
attribute
.
prefix
().
toLatin1
();
const
QByteArray
value
=
attribute
.
value
().
toLatin1
();
if
(
prefix
.
length
()
>
0
)
{
attributes
.
append
(
prefix
);
...
...
@@ -110,10 +111,10 @@ static QByteArray parseAttributes (QXmlStreamReader &reader, const Colors &color
return
attributes
;
}
static
QByteArray
parseDeclarations
(
QXmlStreamReader
&
reader
)
{
static
QByteArray
parseDeclarations
(
const
QXmlStreamReader
&
reader
)
{
QByteArray
declarations
;
for
(
const
auto
&
declaration
:
reader
.
namespaceDeclarations
())
{
QByteArray
prefix
=
declaration
.
prefix
().
toLatin1
();
const
QByteArray
prefix
=
declaration
.
prefix
().
toLatin1
();
if
(
prefix
.
length
()
>
0
)
{
declarations
.
append
(
"xmlns:"
);
declarations
.
append
(
prefix
);
...
...
@@ -128,7 +129,7 @@ static QByteArray parseDeclarations (QXmlStreamReader &reader) {
return
declarations
;
}
static
QByteArray
parseStartDocument
(
QXmlStreamReader
&
reader
)
{
static
QByteArray
parseStartDocument
(
const
QXmlStreamReader
&
reader
)
{
QByteArray
startDocument
=
"<?xml version=
\"
"
;
startDocument
.
append
(
reader
.
documentVersion
().
toLatin1
());
startDocument
.
append
(
"
\"
encoding=
\"
"
);
...
...
@@ -137,7 +138,7 @@ static QByteArray parseStartDocument (QXmlStreamReader &reader) {
return
startDocument
;
}
static
QByteArray
parseStartElement
(
QXmlStreamReader
&
reader
,
const
Colors
&
colors
)
{
static
QByteArray
parseStartElement
(
const
QXmlStreamReader
&
reader
,
const
Colors
&
colors
)
{
QByteArray
startElement
=
"<"
;
startElement
.
append
(
reader
.
name
().
toLatin1
());
startElement
.
append
(
" "
);
...
...
@@ -148,7 +149,7 @@ static QByteArray parseStartElement (QXmlStreamReader &reader, const Colors &col
return
startElement
;
}
static
QByteArray
parseEndElement
(
QXmlStreamReader
&
reader
)
{
static
QByteArray
parseEndElement
(
const
QXmlStreamReader
&
reader
)
{
QByteArray
endElement
=
"</"
;
endElement
.
append
(
reader
.
name
().
toLatin1
());
endElement
.
append
(
">"
);
...
...
Write
Preview
Markdown
is supported
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