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
9636a21e
Commit
9636a21e
authored
Dec 05, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/app/AvatarProvider): use it on app (to test)
parent
ca549b83
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
3 deletions
+11
-3
App.cpp
tests/src/app/App.cpp
+3
-0
App.hpp
tests/src/app/App.hpp
+2
-0
AvatarProvider.cpp
tests/src/app/AvatarProvider.cpp
+5
-3
AvatarProvider.hpp
tests/src/app/AvatarProvider.hpp
+1
-0
No files found.
tests/src/app/App.cpp
View file @
9636a21e
...
...
@@ -42,6 +42,9 @@ App::App (int &argc, char **argv) : QApplication(argc, argv) {
.
arg
(
current_locale
.
name
());
}
// Provide avatars loader.
m_engine
.
addImageProvider
(
AvatarProvider
::
PROVIDER_ID
,
&
m_avatar_provider
);
setWindowIcon
(
QIcon
(
WINDOW_ICON_PATH
));
// Provide `+custom` folders for custom components.
...
...
tests/src/app/App.hpp
View file @
9636a21e
...
...
@@ -6,6 +6,7 @@
#include <QQmlFileSelector>
#include <QSystemTrayIcon>
#include "AvatarProvider.hpp"
#include "DefaultTranslator.hpp"
class
Notifier
;
...
...
@@ -51,6 +52,7 @@ private:
QQmlFileSelector
*
m_file_selector
=
nullptr
;
QSystemTrayIcon
*
m_system_tray_icon
=
nullptr
;
AvatarProvider
m_avatar_provider
;
DefaultTranslator
m_default_translator
;
QTranslator
m_english_translator
;
...
...
tests/src/app/AvatarProvider.cpp
View file @
9636a21e
...
...
@@ -5,6 +5,8 @@
// ===================================================================
const
QString
AvatarProvider
::
PROVIDER_ID
=
"avatar"
;
AvatarProvider
::
AvatarProvider
()
:
QQuickImageProvider
(
QQmlImageProviderBase
::
Image
,
...
...
@@ -15,8 +17,8 @@ AvatarProvider::AvatarProvider () :
QImage
AvatarProvider
::
requestImage
(
const
QString
&
id
,
QSize
*
size
,
const
QSize
&
requested_size
QSize
*
,
const
QSize
&
)
{
// TODO: use a shared image from contact.
return
QImage
(
m_avatars_path
+
id
);
}
tests/src/app/AvatarProvider.hpp
View file @
9636a21e
...
...
@@ -16,6 +16,7 @@ public:
const
QSize
&
requested_size
)
override
;
static
const
QString
PROVIDER_ID
;
private:
QString
m_avatars_path
;
};
...
...
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