Commit 9967fc22 authored by Anupam Basak's avatar Anupam Basak

Fix compilation warnings

parent 2e162635
......@@ -40,38 +40,14 @@ public:
* getContacts must be done async and
* emit a signal with FMH::MODEL_LIST representing the contacts
*/
virtual void getContacts() const
{
}
virtual void getContacts()
{
}
/**
* getAccounts returns a FMH::MODEL_LIST
* representing the avalible accounts handling the contacts
*/
virtual FMH::MODEL_LIST getAccounts(...) const
{
return FMH::MODEL_LIST();
}
virtual FMH::MODEL_LIST getAccounts(...)
{
return FMH::MODEL_LIST();
}
/**
* getContact returns a contact represented by a FMH::MODEL,
* to do so, it needs a valid id
*/
virtual FMH::MODEL getContact(const QString &id) const
{
Q_UNUSED(id)
return FMH::MODEL();
}
virtual FMH::MODEL getContact(const QString &id)
{
Q_UNUSED(id)
......@@ -85,12 +61,6 @@ public:
* FMH::MODEL_KEY::ACCOUNT = name of the account
* FMH::MODEL_KEY::ACCOUNT_TYPE = type of the account
*/
virtual bool insertContact(const FMH::MODEL &contact) const
{
Q_UNUSED(contact)
return false;
}
virtual bool insertContact(const FMH::MODEL &contact)
{
Q_UNUSED(contact)
......@@ -102,13 +72,6 @@ public:
* and the up-to-date values represented as a FMH::MODEL,
* and returns whether the contact was sucessfulyl updated or not
*/
virtual bool updateContact(const QString &id, const FMH::MODEL &contact) const
{
Q_UNUSED(id)
Q_UNUSED(contact)
return false;
}
virtual bool updateContact(const QString &id, const FMH::MODEL &contact)
{
Q_UNUSED(id)
......@@ -120,16 +83,19 @@ public:
* removeContact takes the id of the contact to be removed and return
* whether the contact was sucesfully removed or not
*/
virtual bool removeContact(const QString &id) const
virtual bool removeContact(const QString &id)
{
Q_UNUSED(id)
return false;
}
virtual bool removeContact(const QString &id)
/**
* getAccounts returns a FMH::MODEL_LIST
* representing the avalible accounts handling the contacts
*/
virtual FMH::MODEL_LIST getAccounts(...)
{
Q_UNUSED(id)
return false;
return FMH::MODEL_LIST();
}
signals:
......
......@@ -27,7 +27,7 @@ void AndroidInterface::call(const QString &tel) const
MAUIAndroid::call(tel);
}
bool AndroidInterface::insertContact(const FMH::MODEL &contact) const
bool AndroidInterface::insertContact(const FMH::MODEL &contact)
{
qDebug() << "ADDING CONTACT TO ACCOUNT" << contact;
MAUIAndroid::addContact(contact[FMH::MODEL_KEY::N],
......@@ -81,7 +81,7 @@ FMH::MODEL AndroidInterface::getContact(const QString &id) const
return FMH::toModel(MAUIAndroid::getContact(id));
}
bool AndroidInterface::updateContact(const QString &id, const FMH::MODEL &contact) const
bool AndroidInterface::updateContact(const QString &id, const FMH::MODEL &contact)
{
for (const auto &key : contact.keys())
MAUIAndroid::updateContact(id, FMH::MODEL_NAME[key], contact[key]);
......
......@@ -13,16 +13,14 @@ public:
static AndroidInterface *getInstance();
void call(const QString &tel) const;
bool insertContact(const FMH::MODEL &contact) const override final;
void getCallLogs();
FMH::MODEL_LIST getAccounts(const GET_TYPE &type = GET_TYPE::CACHED);
FMH::MODEL getContact(const QString &id) override final;
void getContacts(const GET_TYPE &type = GET_TYPE::CACHED);
void getContacts() override final;
void getCallLogs();
FMH::MODEL getContact(const QString &id) const override final;
bool updateContact(const QString &id, const FMH::MODEL &contact) const override final;
bool insertContact(const FMH::MODEL &contact) override final;
bool updateContact(const QString &id, const FMH::MODEL &contact) override final;
bool removeContact(const QString &id) override final;
private:
......
......@@ -6,6 +6,13 @@
#endif
#include <QDebug>
ContactImage::ContactImage(ImageType type)
: QQuickImageProvider(type, Flags())
, no_image(QImage(":/portrait.jpg"))
{
// this->blockSignals(false);
}
ContactImage::ContactImage(ImageType type, Flags flags)
: QQuickImageProvider(type, flags)
, no_image(QImage(":/portrait.jpg"))
......
......@@ -8,7 +8,8 @@ class ContactImage : public QObject, public QQuickImageProvider
{
Q_OBJECT
public:
ContactImage(ImageType type, Flags flags = nullptr);
ContactImage(ImageType type);
ContactImage(ImageType type, Flags flags);
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize) override;
public slots:
......
......@@ -92,7 +92,7 @@ void LinuxInterface::getContacts()
const auto uri = model.get(i, KPeople::PersonsModel::PersonUriRole).toString();
KPeople::PersonData person(uri);
auto contact = FMH::MODEL{
auto contact = FMH::MODEL {
{FMH::MODEL_KEY::ID, person.personUri()}, {FMH::MODEL_KEY::N, person.name()}, {FMH::MODEL_KEY::EMAIL, person.email()}, {FMH::MODEL_KEY::TEL, person.contactCustomProperty("phoneNumber").toString()},
// {FMH::MODEL_KEY::PHOTO, person.pictureUrl().toString()}
};
......
......@@ -34,14 +34,10 @@ private:
public:
explicit LinuxInterface(QObject *parent = nullptr);
void getContacts() override final;
FMH::MODEL getContact(const QString &id) override final;
void getContacts() override final;
bool insertContact(const FMH::MODEL &contact) override final;
bool updateContact(const QString &id, const FMH::MODEL &contact) override final;
bool removeContact(const QString &id) override final;
/**
......
......@@ -59,7 +59,7 @@ CallLogs::ORDER CallLogs::getOrder() const
void CallLogs::getList(const bool &cached)
{
Q_UNUSED(cached)
QFutureWatcher<FMH::MODEL_LIST> *watcher = new QFutureWatcher<FMH::MODEL_LIST>;
connect(watcher, &QFutureWatcher<FMH::MODEL_LIST>::finished, [=]() {
emit this->preListChanged();
......
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