Use proxy objects on lambdas instead of raw pointers

When the object is destroyed the connections will be removed
automatically by Qt.

fixes #433
This commit is contained in:
Konstantinos Sideris 2018-09-07 12:24:09 +03:00
parent a1af99becb
commit 896fe069b6
10 changed files with 79 additions and 67 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include <QMetaType>
#include <QObject>
#include <QString>
#include <mtx/responses.hpp>
@ -17,6 +18,16 @@ Q_DECLARE_METATYPE(std::string)
Q_DECLARE_METATYPE(std::vector<std::string>)
Q_DECLARE_METATYPE(std::vector<QString>)
class MediaProxy : public QObject
{
Q_OBJECT
signals:
void imageDownloaded(const QPixmap &);
void imageSaved(const QString &, const QByteArray &);
void fileDownloaded(const QByteArray &);
};
namespace http {
mtx::http::Client *
client();