From 9689b5d4e2f39ce740a7f67eb4be963d61e69ad0 Mon Sep 17 00:00:00 2001
From: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Wed, 12 Apr 2017 01:38:10 -0400
Subject: [PATCH] account: Add missing introspection macros
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Allows accounts to be created using bindings other than C++ and
also allow the "GammaRay" introspection debugger to work.

Change-Id: I20af7073c01d3002463908daff97073f3fd23a8d
Reviewed-by: Nicolas Jäger <nicolas.jager@savoirfairelinux.com>
---
 src/account.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/account.h b/src/account.h
index 96f7591e..36612b6a 100644
--- a/src/account.h
+++ b/src/account.h
@@ -352,7 +352,7 @@ class LIB_EXPORT Account : public ItemBase {
        *Perform an action
        * @return If the state changed
        */
-      bool performAction(Account::EditAction action);
+      Q_INVOKABLE bool performAction(Account::EditAction action);
       Account::EditState editState() const;
 
       //Getters
@@ -460,10 +460,10 @@ class LIB_EXPORT Account : public ItemBase {
       uint    internalId                   () const;
       QString lastSipRegistrationStatus    () const;
 
-      bool    exportOnRing      (const QString& password) const;
-      bool    registerName      (const QString& password, const QString& name) const;
-      bool    lookupName        (const QString& name                         ) const;
-      bool    lookupAddress     (const QString& address                      ) const;
+      Q_INVOKABLE bool exportOnRing (const QString& password) const;
+      Q_INVOKABLE bool registerName (const QString& password, const QString& name) const;
+      Q_INVOKABLE bool lookupName   (const QString& name                         ) const;
+      Q_INVOKABLE bool lookupAddress(const QString& address                      ) const;
 
       bool   isUsedForOutgogingCall () const;
       uint   totalCallCount         () const;
@@ -575,6 +575,7 @@ class LIB_EXPORT Account : public ItemBase {
 
       QSharedPointer<AccountPrivate> d_ptr;
       Q_DECLARE_PRIVATE(Account)
+      Q_DISABLE_COPY(Account)
 
    Q_SIGNALS:
       ///The account state (Invalid,Trying,Registered) changed
@@ -603,8 +604,8 @@ class LIB_EXPORT Account : public ItemBase {
       /// contact request accepted
       void contactRequestAccepted(const ContactRequest*);
 };
-// Q_DISABLE_COPY(Account)
 Q_DECLARE_METATYPE(Account*)
+Q_DECLARE_METATYPE(const Account*)
 Q_DECLARE_METATYPE(Account::RegistrationState)
 Q_DECLARE_METATYPE(Account::EditAction)
 Q_DECLARE_METATYPE(Account::Protocol)
-- 
GitLab