Commit ca549b83 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): add a `AvatarProvider` class, in progress

parent 30c92d55
......@@ -50,6 +50,7 @@ list(APPEND LIBS "${CMAKE_SOURCE_DIR}/../OUTPUT/desktop/lib64/libbelcard.so")
set(SOURCES
src/app/App.cpp
src/app/AvatarProvider.cpp
src/app/Database.cpp
src/app/DefaultTranslator.cpp
src/app/Logger.cpp
......@@ -70,6 +71,7 @@ set(SOURCES
set(HEADERS
src/app/App.hpp
src/app/AvatarProvider.hpp
src/app/Database.hpp
src/app/DefaultTranslator.hpp
src/app/Logger.hpp
......
#include "Database.hpp"
#include "../utils.hpp"
#include "AvatarProvider.hpp"
// ===================================================================
AvatarProvider::AvatarProvider () :
QQuickImageProvider(
QQmlImageProviderBase::Image,
QQmlImageProviderBase::ForceAsynchronousImageLoading
) {
m_avatars_path = Utils::linphoneStringToQString(Database::getAvatarsPath());
}
QImage AvatarProvider::requestImage (
const QString &id,
QSize *size,
const QSize &requested_size
) {
// TODO: use a shared image from contact.
}
#ifndef AVATAR_PROVIDER_H_
#define AVATAR_PROVIDER_H_
#include <QQuickImageProvider>
// ===================================================================
class AvatarProvider : public QQuickImageProvider {
public:
AvatarProvider ();
~AvatarProvider () = default;
QImage requestImage (
const QString &id,
QSize *size,
const QSize &requested_size
) override;
private:
QString m_avatars_path;
};
#endif // AVATAR_PROVIDER_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment