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
2078a309
Commit
2078a309
authored
Mar 14, 2018
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): clean some pieces of code and improve build (providers)
parent
b05e003d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
31 deletions
+31
-31
AvatarProvider.cpp
src/app/providers/AvatarProvider.cpp
+6
-6
ImageProvider.cpp
src/app/providers/ImageProvider.cpp
+19
-19
ThumbnailProvider.cpp
src/app/providers/ThumbnailProvider.cpp
+6
-6
No files found.
src/app/providers/AvatarProvider.cpp
View file @
2078a309
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
* Author: Ronan Abhamon
* Author: Ronan Abhamon
*/
*/
#include "
../../utils/Util
s.hpp"
#include "
app/paths/Path
s.hpp"
#include "
../paths/Path
s.hpp"
#include "
utils/Util
s.hpp"
#include "AvatarProvider.hpp"
#include "AvatarProvider.hpp"
...
@@ -32,8 +32,8 @@ const QString AvatarProvider::PROVIDER_ID = "avatar";
...
@@ -32,8 +32,8 @@ const QString AvatarProvider::PROVIDER_ID = "avatar";
AvatarProvider
::
AvatarProvider
()
:
QQuickImageProvider
(
AvatarProvider
::
AvatarProvider
()
:
QQuickImageProvider
(
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
)
{
)
{
mAvatarsPath
=
::
Utils
::
coreStringToAppString
(
Paths
::
getAvatarsDirPath
());
mAvatarsPath
=
Utils
::
coreStringToAppString
(
Paths
::
getAvatarsDirPath
());
}
}
QImage
AvatarProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
size
,
const
QSize
&
)
{
QImage
AvatarProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
size
,
const
QSize
&
)
{
...
...
src/app/providers/ImageProvider.cpp
View file @
2078a309
...
@@ -25,14 +25,14 @@
...
@@ -25,14 +25,14 @@
#include <QPainter>
#include <QPainter>
#include <QSvgRenderer>
#include <QSvgRenderer>
#include "
..
/App.hpp"
#include "
app
/App.hpp"
#include "ImageProvider.hpp"
#include "ImageProvider.hpp"
using
namespace
std
;
// =============================================================================
// =============================================================================
using
namespace
std
;
namespace
{
namespace
{
// Max image size in bytes. (100Kb)
// Max image size in bytes. (100Kb)
constexpr
qint64
cMaxImageSize
=
102400
;
constexpr
qint64
cMaxImageSize
=
102400
;
...
@@ -72,8 +72,8 @@ static QByteArray parseFillAndStroke (QXmlStreamAttributes &readerAttributes, co
...
@@ -72,8 +72,8 @@ static QByteArray parseFillAndStroke (QXmlStreamAttributes &readerAttributes, co
continue
;
continue
;
}
}
::
removeAttribute
(
readerAttributes
,
list
[
2
]);
removeAttribute
(
readerAttributes
,
list
[
2
]);
attributes
.
append
(
::
buildByteArrayAttribute
(
list
[
2
].
toLatin1
(),
colorValue
.
value
<
QColor
>
().
name
().
toLatin1
()));
attributes
.
append
(
buildByteArrayAttribute
(
list
[
2
].
toLatin1
(),
colorValue
.
value
<
QColor
>
().
name
().
toLatin1
()));
}
}
return
attributes
;
return
attributes
;
...
@@ -115,7 +115,7 @@ static QByteArray parseStyle (QXmlStreamAttributes &readerAttributes, const Colo
...
@@ -115,7 +115,7 @@ static QByteArray parseStyle (QXmlStreamAttributes &readerAttributes, const Colo
}
}
}
}
::
removeAttribute
(
readerAttributes
,
"style"
);
removeAttribute
(
readerAttributes
,
"style"
);
if
(
attribute
.
length
()
>
0
)
{
if
(
attribute
.
length
()
>
0
)
{
attribute
.
prepend
(
"style=
\"
"
);
attribute
.
prepend
(
"style=
\"
"
);
...
@@ -128,8 +128,8 @@ static QByteArray parseStyle (QXmlStreamAttributes &readerAttributes, const Colo
...
@@ -128,8 +128,8 @@ static QByteArray parseStyle (QXmlStreamAttributes &readerAttributes, const Colo
static
QByteArray
parseAttributes
(
const
QXmlStreamReader
&
reader
,
const
Colors
&
colors
)
{
static
QByteArray
parseAttributes
(
const
QXmlStreamReader
&
reader
,
const
Colors
&
colors
)
{
QXmlStreamAttributes
readerAttributes
=
reader
.
attributes
();
QXmlStreamAttributes
readerAttributes
=
reader
.
attributes
();
QByteArray
attributes
=
::
parseFillAndStroke
(
readerAttributes
,
colors
);
QByteArray
attributes
=
parseFillAndStroke
(
readerAttributes
,
colors
);
attributes
.
append
(
::
parseStyle
(
readerAttributes
,
colors
));
attributes
.
append
(
parseStyle
(
readerAttributes
,
colors
));
for
(
const
auto
&
attribute
:
readerAttributes
)
{
for
(
const
auto
&
attribute
:
readerAttributes
)
{
const
QByteArray
prefix
=
attribute
.
prefix
().
toLatin1
();
const
QByteArray
prefix
=
attribute
.
prefix
().
toLatin1
();
...
@@ -139,7 +139,7 @@ static QByteArray parseAttributes (const QXmlStreamReader &reader, const Colors
...
@@ -139,7 +139,7 @@ static QByteArray parseAttributes (const QXmlStreamReader &reader, const Colors
}
}
attributes
.
append
(
attributes
.
append
(
::
buildByteArrayAttribute
(
attribute
.
name
().
toLatin1
(),
attribute
.
value
().
toLatin1
())
buildByteArrayAttribute
(
attribute
.
name
().
toLatin1
(),
attribute
.
value
().
toLatin1
())
);
);
}
}
...
@@ -177,9 +177,9 @@ static QByteArray parseStartElement (const QXmlStreamReader &reader, const Color
...
@@ -177,9 +177,9 @@ static QByteArray parseStartElement (const QXmlStreamReader &reader, const Color
QByteArray
startElement
=
"<"
;
QByteArray
startElement
=
"<"
;
startElement
.
append
(
reader
.
name
().
toLatin1
());
startElement
.
append
(
reader
.
name
().
toLatin1
());
startElement
.
append
(
" "
);
startElement
.
append
(
" "
);
startElement
.
append
(
::
parseAttributes
(
reader
,
colors
));
startElement
.
append
(
parseAttributes
(
reader
,
colors
));
startElement
.
append
(
" "
);
startElement
.
append
(
" "
);
startElement
.
append
(
::
parseDeclarations
(
reader
));
startElement
.
append
(
parseDeclarations
(
reader
));
startElement
.
append
(
">"
);
startElement
.
append
(
">"
);
return
startElement
;
return
startElement
;
}
}
...
@@ -209,15 +209,15 @@ static QByteArray computeContent (QFile &file) {
...
@@ -209,15 +209,15 @@ static QByteArray computeContent (QFile &file) {
break
;
break
;
case
QXmlStreamReader
:
:
StartDocument
:
case
QXmlStreamReader
:
:
StartDocument
:
content
.
append
(
::
parseStartDocument
(
reader
));
content
.
append
(
parseStartDocument
(
reader
));
break
;
break
;
case
QXmlStreamReader
:
:
StartElement
:
case
QXmlStreamReader
:
:
StartElement
:
content
.
append
(
::
parseStartElement
(
reader
,
*
colors
));
content
.
append
(
parseStartElement
(
reader
,
*
colors
));
break
;
break
;
case
QXmlStreamReader
:
:
EndElement
:
case
QXmlStreamReader
:
:
EndElement
:
content
.
append
(
::
parseEndElement
(
reader
));
content
.
append
(
parseEndElement
(
reader
));
break
;
break
;
case
QXmlStreamReader
:
:
Characters
:
case
QXmlStreamReader
:
:
Characters
:
...
@@ -239,7 +239,7 @@ const QString ImageProvider::PROVIDER_ID = "internal";
...
@@ -239,7 +239,7 @@ const QString ImageProvider::PROVIDER_ID = "internal";
ImageProvider
::
ImageProvider
()
:
QQuickImageProvider
(
ImageProvider
::
ImageProvider
()
:
QQuickImageProvider
(
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
)
{}
)
{}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
src/app/providers/ThumbnailProvider.cpp
View file @
2078a309
...
@@ -20,8 +20,8 @@
...
@@ -20,8 +20,8 @@
* Author: Ronan Abhamon
* Author: Ronan Abhamon
*/
*/
#include "
../../utils/Util
s.hpp"
#include "
app/paths/Path
s.hpp"
#include "
../paths/Path
s.hpp"
#include "
utils/Util
s.hpp"
#include "ThumbnailProvider.hpp"
#include "ThumbnailProvider.hpp"
...
@@ -32,8 +32,8 @@ const QString ThumbnailProvider::PROVIDER_ID = "thumbnail";
...
@@ -32,8 +32,8 @@ const QString ThumbnailProvider::PROVIDER_ID = "thumbnail";
ThumbnailProvider
::
ThumbnailProvider
()
:
QQuickImageProvider
(
ThumbnailProvider
::
ThumbnailProvider
()
:
QQuickImageProvider
(
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
Image
,
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
QQmlImageProviderBase
::
ForceAsynchronousImageLoading
)
{
)
{
mThumbnailsPath
=
::
Utils
::
coreStringToAppString
(
Paths
::
getThumbnailsDirPath
());
mThumbnailsPath
=
Utils
::
coreStringToAppString
(
Paths
::
getThumbnailsDirPath
());
}
}
QImage
ThumbnailProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
size
,
const
QSize
&
)
{
QImage
ThumbnailProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
size
,
const
QSize
&
)
{
...
...
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