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
b74698da
Commit
b74698da
authored
Jun 19, 2017
by
Wescoeur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ImageProvider): add a timer to calculate image loading
parent
824ba007
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
ImageProvider.cpp
src/app/providers/ImageProvider.cpp
+7
-1
No files found.
src/app/providers/ImageProvider.cpp
View file @
b74698da
...
...
@@ -20,13 +20,14 @@
* Author: Ronan Abhamon
*/
#include <QElapsedTimer>
#include <QFile>
#include <QFileInfo>
#include <QImage>
#include <QPainter>
#include <QSvgRenderer>
#include <QXmlStreamReader>
#include <QtDebug>
#include <QXmlStreamReader>
#include "../App.hpp"
...
...
@@ -207,6 +208,9 @@ ImageProvider::ImageProvider () : QQuickImageProvider(
// -----------------------------------------------------------------------------
QImage
ImageProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
,
const
QSize
&
)
{
QElapsedTimer
timer
;
timer
.
start
();
const
QString
path
=
QStringLiteral
(
":/assets/images/%1"
).
arg
(
id
);
// 1. Read and update XML content.
...
...
@@ -245,5 +249,7 @@ QImage ImageProvider::requestImage (const QString &id, QSize *, const QSize &) {
QPainter
painter
(
&
image
);
renderer
.
render
(
&
painter
);
qInfo
()
<<
QStringLiteral
(
"Image `%1` loaded in %2 milliseconds."
).
arg
(
path
).
arg
(
timer
.
elapsed
());
return
image
;
}
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