Commit 82fa598f authored by Laurent Montel's avatar Laurent Montel 😁

Continue to implement it

parent 106b98ab
......@@ -21,6 +21,9 @@
*/
#include "addresseslocationgrantleeformater.h"
#include "addressgrantleeobject.h"
#include <QVariantList>
AddressesLocationGrantleeFormater::AddressesLocationGrantleeFormater(QObject *parent)
: QObject(parent)
......@@ -35,6 +38,13 @@ AddressesLocationGrantleeFormater::~AddressesLocationGrantleeFormater()
QString AddressesLocationGrantleeFormater::formatAddresses(const KContacts::Address::List &addresses)
{
QVariantList addressList;
const int nbAddress(addresses.count());
addressList.reserve(nbAddress);
for (int i = 0; i < nbAddress; ++i) {
AddressGrantleeObject *addressObj = new AddressGrantleeObject(addresses.at(i), i);
addressList << QVariant::fromValue(static_cast<QObject *>(addressObj));
}
//TODO
return QString();
}
......@@ -22,9 +22,10 @@
#include "addressgrantleeobject.h"
AddressGrantleeObject::AddressGrantleeObject(const KContacts::Address &address, QObject *parent)
AddressGrantleeObject::AddressGrantleeObject(const KContacts::Address &address, int addressIndex, QObject *parent)
: QObject(parent),
mAddress(address)
mAddress(address),
mAddressIndex(addressIndex)
{
}
......@@ -33,3 +34,15 @@ AddressGrantleeObject::~AddressGrantleeObject()
{
}
QString AddressGrantleeObject::removeAddressAction() const
{
//TODO
return {};
}
QString AddressGrantleeObject::modifyAddressAction() const
{
//TODO
return {};
}
......@@ -28,12 +28,17 @@
class AddressGrantleeObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString removeAddressAction READ removeAddressAction)
Q_PROPERTY(QString modifyAddressAction READ modifyAddressAction)
public:
explicit AddressGrantleeObject(const KContacts::Address &address, QObject *parent = Q_NULLPTR);
explicit AddressGrantleeObject(const KContacts::Address &address, int addressIndex, QObject *parent = Q_NULLPTR);
~AddressGrantleeObject();
QString removeAddressAction() const;
QString modifyAddressAction() const;
private:
KContacts::Address mAddress;
int mAddressIndex;
};
#endif // ADDRESSGRANTLEEOBJECT_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