Commit 2634c427 authored by Laurent Montel's avatar Laurent Montel 😁

Start to add grantlee support

parent 46fbcfb3
......@@ -35,6 +35,7 @@ kconfig_add_kcfg_files(akonadicontact_actions_SRCS actions/contactactionssetting
set(akonadicontact_addresslocation_editor_SRCS
editor/addresseditor/addresslocationwidget.cpp
editor/addresseditor/addresseslocationviewer.cpp
editor/addresseditor/addresseslocationgrantleeformater.cpp
)
set(akonadicontact_editor_SRCS
......
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "addresseslocationgrantleeformater.h"
AddressesLocationGrantleeFormater::AddressesLocationGrantleeFormater(QObject *parent)
: QObject(parent)
{
}
AddressesLocationGrantleeFormater::~AddressesLocationGrantleeFormater()
{
}
QString AddressesLocationGrantleeFormater::formatAddresses(const KContacts::Address::List &addresses)
{
//TODO
return QString();
}
/*
This file is part of Akonadi Contact.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016 Laurent Montel <laurent.montel@kdab.com>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef ADDRESSESLOCATIONGRANTLEEFORMATER_H
#define ADDRESSESLOCATIONGRANTLEEFORMATER_H
#include <QObject>
#include <KContacts/Address>
class AddressesLocationGrantleeFormater : public QObject
{
Q_OBJECT
public:
explicit AddressesLocationGrantleeFormater(QObject *parent = Q_NULLPTR);
~AddressesLocationGrantleeFormater();
QString formatAddresses(const KContacts::Address::List &addresses);
};
#endif // ADDRESSESLOCATIONGRANTLEEFORMATER_H
......@@ -33,6 +33,19 @@ AddressesLocationViewer::~AddressesLocationViewer()
}
void AddressesLocationViewer::updateView()
{
//TODO
}
void AddressesLocationViewer::addAddress(const KContacts::Address &address)
{
if (!address.isEmpty()) {
mAddresses.append(address);
updateView();
}
}
KContacts::Address::List AddressesLocationViewer::addresses() const
{
return mAddresses;
......
......@@ -35,10 +35,13 @@ public:
~AddressesLocationViewer();
void addAddress(const KContacts::Address &address);
KContacts::Address::List addresses() const;
void setAddresses(const KContacts::Address::List &addresses);
private:
void updateView();
KContacts::Address::List mAddresses;
};
......
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