aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-10 23:20:27 +0200
committerMontel Laurent <[email protected]>2017-10-10 23:20:27 +0200
commit32c9536a24224b28027d764a9c2968480b0425a0 (patch)
treecd1fea031f6c975f1fe9b0871c773bb70eda9545
parent7ddb5cc3e79fa7211f2b315f7be9062891fd8cc4 (diff)
Remove qtwebengine dep
-rw-r--r--CMakeLists.txt6
-rw-r--r--src/contact-editor/CMakeLists.txt33
-rw-r--r--src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.cpp20
-rw-r--r--src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.h11
-rw-r--r--src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.cpp89
-rw-r--r--src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.h54
-rw-r--r--src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp38
-rw-r--r--src/contact-editor/editor/addresseditor/addresseslocationwidget.h7
-rw-r--r--src/contact-editor/editor/addresseditor/addressgrantleeobject.cpp128
-rw-r--r--src/contact-editor/editor/addresseditor/addressgrantleeobject.h68
-rw-r--r--src/contact-editor/editor/addresseditor/addresslocationwidget.cpp294
-rw-r--r--src/contact-editor/editor/addresseditor/addresslocationwidget.h85
-rw-r--r--src/contact-editor/editor/addresseditor/addresstypedialog.cpp92
-rw-r--r--src/contact-editor/editor/addresseditor/addresstypedialog.h50
-rw-r--r--src/contact-editor/editor/addresseditor/autotests/CMakeLists.txt31
-rw-r--r--src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.cpp43
-rw-r--r--src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.h38
-rw-r--r--src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.cpp51
-rw-r--r--src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.h39
-rw-r--r--src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.cpp121
-rw-r--r--src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.h40
-rw-r--r--src/contact-editor/editor/addresseditor/html/CMakeLists.txt1
-rw-r--r--src/contact-editor/editor/addresseditor/html/default/addresseslocation.css16
-rw-r--r--src/contact-editor/editor/addresseditor/html/default/addresseslocation.html29
-rw-r--r--src/contact-editor/editor/addresseditor/iconnamecache.cpp55
-rw-r--r--src/contact-editor/editor/addresseditor/iconnamecache_p.h53
-rw-r--r--src/contact-editor/editor/addresseditor/selectaddresstypecombobox.cpp114
-rw-r--r--src/contact-editor/editor/addresseditor/selectaddresstypecombobox.h73
-rw-r--r--src/contact-editor/editor/addresseditor/tests/CMakeLists.txt34
-rw-r--r--src/contact-editor/editor/addresseditor/tests/main.cpp35
-rw-r--r--src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.cpp62
-rw-r--r--src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.h43
-rw-r--r--src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.cpp142
-rw-r--r--src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.h60
-rw-r--r--src/contact-editor/editor/generalinfoeditor/autotests/CMakeLists.txt4
35 files changed, 56 insertions, 2003 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index faa3e35..719171d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
-set(PIM_VERSION "5.6.40")
+set(PIM_VERSION "5.6.41")
project(Akonadi-Contact VERSION ${PIM_VERSION})
@@ -31,7 +31,7 @@ set(KMIMELIB_VERSION "5.6.40")
set(AKONADI_VERSION "5.6.40")
set(QT_REQUIRED_VERSION "5.8.0")
-find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebEngine WebEngineWidgets)
+find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test)
########### Find packages ###########
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
@@ -40,7 +40,7 @@ find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
-find_package(Grantlee5 "5.1" CONFIG REQUIRED)
+#find_package(Grantlee5 "5.1" CONFIG REQUIRED)
find_package(KF5Contacts ${KCONTACTS_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIMELIB_VERSION} CONFIG REQUIRED)
diff --git a/src/contact-editor/CMakeLists.txt b/src/contact-editor/CMakeLists.txt
index b9ad718..6991e44 100644
--- a/src/contact-editor/CMakeLists.txt
+++ b/src/contact-editor/CMakeLists.txt
@@ -30,6 +30,10 @@ configure_file(config-contact-editor.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-
add_subdirectory(editor/im)
+
+set(contacteditor_abstractaddresslocation_SRCS
+ editor/addresseditor/abstractaddresslocationwidget.cpp)
+
set(contacteditor_customfieldseditor_SRCS
editor/customfieldeditor/customfieldswidget.cpp
editor/customfieldeditor/customfieldeditorwidget.cpp
@@ -86,22 +90,11 @@ set(contacteditor_editor_generalinfo_SRCS
${contacteditor_editor_generalinfo_phone_SRCS}
${contacteditor_editor_generalinfo_web_SRCS}
${contacteditor_editor_generalinfo_mail_SRCS}
- )
-
-set(contacteditor_addresslocation_web_editor_SRCS
- editor/addresseditor/webengine/addresseslocationengineviewer.cpp
- editor/addresseditor/webengine/addresseslocationenginepage.cpp
+ ${contacteditor_abstractaddresslocation_SRCS}
)
set(contacteditor_addresslocation_editor_SRCS
- ${contacteditor_addresslocation_web_editor_SRCS}
- editor/addresseditor/addresslocationwidget.cpp
- editor/addresseditor/addresseslocationgrantleeformater.cpp
- editor/addresseditor/addressgrantleeobject.cpp
- editor/addresseditor/iconnamecache.cpp
editor/addresseditor/addresseslocationwidget.cpp
- editor/addresseditor/selectaddresstypecombobox.cpp
- editor/addresseditor/addresstypedialog.cpp
)
set(contacteditor_personal_editor_SRCS
@@ -174,9 +167,6 @@ target_link_libraries(KF5ContactEditor
KF5::Service
KF5::TextWidgets
KF5::WidgetsAddons
- Grantlee5::Templates
- Qt5::WebEngine
- Qt5::WebEngineWidgets
)
set_target_properties(KF5ContactEditor PROPERTIES
@@ -212,16 +202,25 @@ ecm_generate_headers(ContactEditorWidget_CamelCase_HEADERS
RELATIVE editor/widgets/
)
+ecm_generate_headers(ContactEditorAddressLocationWidget_CamelCase_HEADERS
+ HEADER_NAMES
+ AbstractAddressLocationWidget
+ REQUIRED_HEADERS ContactEditorAddressLocationWidget_HEADERS
+ PREFIX ContactEditor
+ RELATIVE editor/addresseditor/
+ )
install( FILES
${ContactEditor_CamelCase_HEADERS}
${ContactEditorWidget_CamelCase_HEADERS}
+ ${ContactEditorAddressLocationWidget_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor COMPONENT Devel
)
install( FILES
${ContactEditor_HEADERS}
${ContactEditorWidget_HEADERS}
+ ${ContactEditorAddressLocationWidget_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/contacteditor_export.h
editor/im/improtocols.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor COMPONENT Devel
@@ -230,8 +229,6 @@ install( FILES
if (BUILD_TESTING)
- add_subdirectory(editor/addresseditor/autotests/)
- add_subdirectory(editor/addresseditor/tests)
add_subdirectory(editor/generalinfoeditor/autotests/)
add_subdirectory(editor/generalinfoeditor/tests)
add_subdirectory(editor/customfieldeditor/autotests/)
@@ -242,6 +239,4 @@ endif()
install(FILES editor/pics/world.jpg DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/pics)
install(FILES editor/data/zone.tab DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/data)
-add_subdirectory(editor/addresseditor/html)
-
install( FILES contact-editor.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
diff --git a/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.cpp b/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.cpp
index aa74f42..ee324d9 100644
--- a/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.cpp
+++ b/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.cpp
@@ -27,3 +27,23 @@ AbstractAddressLocationWidget::AbstractAddressLocationWidget(QWidget *parent)
{
}
+
+AbstractAddressLocationWidget::~AbstractAddressLocationWidget()
+{
+
+}
+
+void AbstractAddressLocationWidget::loadContact(const KContacts::Addressee &contact)
+{
+ Q_UNUSED(contact);
+}
+
+void AbstractAddressLocationWidget::storeContact(KContacts::Addressee &contact) const
+{
+ Q_UNUSED(contact);
+}
+
+void AbstractAddressLocationWidget::setReadOnly(bool readOnly)
+{
+ Q_UNUSED(readOnly);
+}
diff --git a/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.h b/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.h
index 5145fff..0f02417 100644
--- a/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.h
+++ b/src/contact-editor/editor/addresseditor/abstractaddresslocationwidget.h
@@ -24,14 +24,23 @@
#define ABSTRACTADDRESSLOCATIONWIDGET_H
#include <QWidget>
+
+#include <KContacts/Addressee>
+#include "contacteditor_export.h"
+
namespace ContactEditor
{
-class AbstractAddressLocationWidget : public QWidget
+class CONTACTEDITOR_EXPORT AbstractAddressLocationWidget : public QWidget
{
Q_OBJECT
public:
explicit AbstractAddressLocationWidget(QWidget *parent = nullptr);
~AbstractAddressLocationWidget();
+
+ virtual void loadContact(const KContacts::Addressee &contact);
+ virtual void storeContact(KContacts::Addressee &contact) const;
+
+ virtual void setReadOnly(bool readOnly);
};
}
#endif // ABSTRACTADDRESSLOCATIONWIDGET_H
diff --git a/src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.cpp b/src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.cpp
deleted file mode 100644
index 2413b71..0000000
--- a/src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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"
-#include "addressgrantleeobject.h"
-#include <grantlee/engine.h>
-#include <QVariantList>
-#include <QStandardPaths>
-
-using namespace ContactEditor;
-
-AddressesLocationGrantleeFormater::AddressesLocationGrantleeFormater(QObject *parent)
- : QObject(parent)
- , mEngine(new Grantlee::Engine)
- , mReadOnly(false)
-{
- mTemplateLoader = QSharedPointer<Grantlee::FileSystemTemplateLoader>(new Grantlee::FileSystemTemplateLoader);
- mGrantleeThemePath = QStandardPaths::locate(QStandardPaths::GenericDataLocation,
- QStringLiteral("contacteditor/grantleetheme/default/"),
- QStandardPaths::LocateDirectory);
- changeGrantleePath(mGrantleeThemePath);
-}
-
-AddressesLocationGrantleeFormater::~AddressesLocationGrantleeFormater()
-{
- delete mEngine;
- mTemplateLoader.clear();
-}
-
-QString AddressesLocationGrantleeFormater::formatAddresses(const KContacts::Address::List &addresses)
-{
- QVariantList addressList;
- const int nbAddress(addresses.count());
- addressList.reserve(nbAddress);
- QList<AddressGrantleeObject *> lstAddress;
- lstAddress.reserve(nbAddress);
- for (int i = 0; i < nbAddress; ++i) {
- AddressGrantleeObject *addressObj = new AddressGrantleeObject(addresses.at(i), i);
- addressList << QVariant::fromValue(static_cast<QObject *>(addressObj));
- lstAddress.append(addressObj);
- }
- QVariantHash addressHash;
- addressHash.insert(QStringLiteral("addresses"), addressList);
- addressHash.insert(QStringLiteral("absoluteThemePath"), mGrantleeThemePath);
- addressHash.insert(QStringLiteral("readOnly"), mReadOnly);
-
- Grantlee::Context context(addressHash);
- const QString contentHtml = mSelfcontainedTemplate->render(&context);
- qDeleteAll(lstAddress);
- return contentHtml;
-}
-
-void AddressesLocationGrantleeFormater::setReadOnly(bool readOnly)
-{
- mReadOnly = readOnly;
-}
-
-void AddressesLocationGrantleeFormater::changeGrantleePath(const QString &path)
-{
- if (!mTemplateLoader) {
- mTemplateLoader = QSharedPointer<Grantlee::FileSystemTemplateLoader>(new Grantlee::FileSystemTemplateLoader);
- }
- mTemplateLoader->setTemplateDirs(QStringList() << path);
- mEngine->addTemplateLoader(mTemplateLoader);
-
- mSelfcontainedTemplate = mEngine->loadByName(QStringLiteral("addresseslocation.html"));
- if (mSelfcontainedTemplate->error()) {
- mErrorMessage += mSelfcontainedTemplate->errorString() + QLatin1String("<br>");
- }
-}
diff --git a/src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.h b/src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.h
deleted file mode 100644
index ede83cd..0000000
--- a/src/contact-editor/editor/addresseditor/addresseslocationgrantleeformater.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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>
-#include <QSharedPointer>
-#include <grantlee/templateloader.h>
-namespace Grantlee {
-class Engine;
-}
-namespace ContactEditor {
-class AddressesLocationGrantleeFormater : public QObject
-{
- Q_OBJECT
-public:
- explicit AddressesLocationGrantleeFormater(QObject *parent = nullptr);
- ~AddressesLocationGrantleeFormater();
-
- QString formatAddresses(const KContacts::Address::List &addresses);
- void setReadOnly(bool readOnly);
-private:
- void changeGrantleePath(const QString &path);
- Grantlee::Engine *mEngine = nullptr;
- QString mErrorMessage;
- QString mGrantleeThemePath;
- QSharedPointer<Grantlee::FileSystemTemplateLoader> mTemplateLoader;
- Grantlee::Template mSelfcontainedTemplate;
- bool mReadOnly;
-};
-}
-#endif // ADDRESSESLOCATIONGRANTLEEFORMATER_H
diff --git a/src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp b/src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp
index d9a911d..0840943 100644
--- a/src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp
+++ b/src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp
@@ -21,25 +21,11 @@
*/
#include "addresseslocationwidget.h"
-#include "webengine/addresseslocationengineviewer.h"
-#include "addresslocationwidget.h"
using namespace ContactEditor;
AddressesLocationWidget::AddressesLocationWidget(QWidget *parent)
- : QSplitter(parent)
+ : QWidget(parent)
{
- setChildrenCollapsible(false);
- mAddressLocationWidget = new AddressLocationWidget(this);
- mAddressLocationWidget->setObjectName(QStringLiteral("addresslocationwidget"));
- addWidget(mAddressLocationWidget);
- mAddressesLocationViewer = new AddressesLocationEngineViewer(this);
- mAddressesLocationViewer->setObjectName(QStringLiteral("addresseslocationviewer"));
- addWidget(mAddressesLocationViewer);
- connect(mAddressesLocationViewer, &AddressesLocationEngineViewer::modifyAddress, mAddressLocationWidget, &AddressLocationWidget::slotModifyAddress);
- connect(mAddressLocationWidget, &AddressLocationWidget::addNewAddress, mAddressesLocationViewer, &AddressesLocationEngineViewer::addAddress);
- connect(mAddressLocationWidget, &AddressLocationWidget::updateAddressCanceled, mAddressesLocationViewer, &AddressesLocationEngineViewer::updateAddressCanceled);
- connect(mAddressLocationWidget, &AddressLocationWidget::updateAddress, mAddressesLocationViewer, &AddressesLocationEngineViewer::replaceAddress);
- setSizes(QList<int>() << 400 << 300);
}
AddressesLocationWidget::~AddressesLocationWidget()
@@ -48,31 +34,15 @@ AddressesLocationWidget::~AddressesLocationWidget()
void AddressesLocationWidget::loadContact(const KContacts::Addressee &contact)
{
- mAddressesLocationViewer->setAddresses(contact.addresses());
+ //TODO
}
void AddressesLocationWidget::storeContact(KContacts::Addressee &contact) const
{
- // delete all previous addresses
- const KContacts::Address::List oldAddresses = contact.addresses();
- const int numberOfOldAddresses(oldAddresses.count());
- for (int i = 0; i < numberOfOldAddresses; ++i) {
- contact.removeAddress(oldAddresses.at(i));
- }
-
- const KContacts::Address::List addressList = mAddressesLocationViewer->addresses();
- // insert the new ones
- const int numberOfAddress(addressList.count());
- for (int i = 0; i < numberOfAddress; ++i) {
- const KContacts::Address address(addressList.at(i));
- if (!address.isEmpty()) {
- contact.insertAddress(address);
- }
- }
+ //TODO
}
void AddressesLocationWidget::setReadOnly(bool readOnly)
{
- mAddressesLocationViewer->setReadOnly(readOnly);
- mAddressLocationWidget->setReadOnly(readOnly);
+ //TODO
}
diff --git a/src/contact-editor/editor/addresseditor/addresseslocationwidget.h b/src/contact-editor/editor/addresseditor/addresseslocationwidget.h
index 9fa7f2b..6faa598 100644
--- a/src/contact-editor/editor/addresseditor/addresseslocationwidget.h
+++ b/src/contact-editor/editor/addresseditor/addresseslocationwidget.h
@@ -26,9 +26,7 @@
#include <QSplitter>
#include <KContacts/Addressee>
namespace ContactEditor {
-class AddressLocationWidget;
-class AddressesLocationEngineViewer;
-class AddressesLocationWidget : public QSplitter
+class AddressesLocationWidget : public QWidget
{
Q_OBJECT
public:
@@ -39,9 +37,6 @@ public:
void storeContact(KContacts::Addressee &contact) const;
void setReadOnly(bool readOnly);
-private:
- AddressesLocationEngineViewer *mAddressesLocationViewer = nullptr;
- AddressLocationWidget *mAddressLocationWidget = nullptr;
};
}
#endif // ADDRESSESLOCATIONWIDGET_H
diff --git a/src/contact-editor/editor/addresseditor/addressgrantleeobject.cpp b/src/contact-editor/editor/addresseditor/addressgrantleeobject.cpp
deleted file mode 100644
index f250c35..0000000
--- a/src/contact-editor/editor/addresseditor/addressgrantleeobject.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "addressgrantleeobject.h"
-#include "iconnamecache_p.h"
-#include <KIconLoader>
-#include <KLocalizedString>
-#include <QUrlQuery>
-using namespace ContactEditor;
-AddressGrantleeObject::AddressGrantleeObject(const KContacts::Address &address, int addressIndex, QObject *parent)
- : QObject(parent)
- , mAddress(address)
- , mAddressIndex(addressIndex)
-{
- mIconSize = KIconLoader::global()->currentSize(KIconLoader::Small);
-}
-
-AddressGrantleeObject::~AddressGrantleeObject()
-{
-}
-
-QString AddressGrantleeObject::formattedAddress() const
-{
- QString str;
- if (mAddress.label().isEmpty()) {
- str = mAddress.formattedAddress().trimmed().toHtmlEscaped();
- } else {
- str = mAddress.label().toHtmlEscaped();
- }
- return str;
-}
-
-QString AddressGrantleeObject::createActionUrl(const QString &actionName) const
-{
- QUrl url;
- url.setScheme(QStringLiteral("addresslocationaction"));
- url.setPath(actionName);
- QUrlQuery query;
- query.addQueryItem(QStringLiteral("id"), QString::number(mAddressIndex));
- url.setQuery(query);
- return url.toDisplayString();
-}
-
-QString AddressGrantleeObject::preferredAddressAction() const
-{
- QString text;
- if (preferredAddress()) {
- const QString iconPath = QUrl::fromLocalFile(IconNameCache::instance()->iconPath(QStringLiteral("bookmarks"), KIconLoader::Small)).url();
- text = QStringLiteral("<img class=\"headimage\" height=\"%3\" width=\"%3\" title=\"%1\" src=\"%2\"></a>\n")
- .arg(i18n("Remove Address"), iconPath, QString::number(mIconSize));
- }
- return text;
-}
-
-QString AddressGrantleeObject::postOfficeBox() const
-{
- return mAddress.postOfficeBox();
-}
-
-QString AddressGrantleeObject::street() const
-{
- return mAddress.street();
-}
-
-QString AddressGrantleeObject::locality() const
-{
- return mAddress.locality();
-}
-
-QString AddressGrantleeObject::region() const
-{
- return mAddress.region();
-}
-
-QString AddressGrantleeObject::postalCode() const
-{
- return mAddress.postalCode();
-}
-
-QString AddressGrantleeObject::country() const
-{
- return mAddress.country();
-}
-
-QString AddressGrantleeObject::removeAddressAction() const
-{
- const QString iconPath = QUrl::fromLocalFile(IconNameCache::instance()->iconPath(QStringLiteral("edit-delete"), KIconLoader::Small)).url();
- const QString text = QStringLiteral("<a href=\"%1\"><img class=\"headimage\" height=\"%4\" width=\"%4\" title=\"%3\" src=\"%2\"></a>\n")
- .arg(createActionUrl(QStringLiteral("removeaddress")), iconPath, i18n("Remove Address"), QString::number(mIconSize));
- return text;
-}
-
-QString AddressGrantleeObject::modifyAddressAction() const
-{
- const QString iconPath = QUrl::fromLocalFile(IconNameCache::instance()->iconPath(QStringLiteral("document-edit"), KIconLoader::Small)).url();
- const QString text = QStringLiteral("<a href=\"%1\"><img class=\"headimage\" height=\"%4\" width=\"%4\" title=\"%3\" src=\"%2\"></a>\n")
- .arg(createActionUrl(QStringLiteral("editaddress")), iconPath, i18n("Edit Address"), QString::number(mIconSize));
- return text;
-}
-
-QString AddressGrantleeObject::addressType() const
-{
- return KContacts::Address::typeLabel(mAddress.type());
-}
-
-bool AddressGrantleeObject::preferredAddress() const
-{
- return mAddress.type() & KContacts::Address::Pref;
-}
diff --git a/src/contact-editor/editor/addresseditor/addressgrantleeobject.h b/src/contact-editor/editor/addresseditor/addressgrantleeobject.h
deleted file mode 100644
index fbcb50b..0000000
--- a/src/contact-editor/editor/addresseditor/addressgrantleeobject.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 ADDRESSGRANTLEEOBJECT_H
-#define ADDRESSGRANTLEEOBJECT_H
-
-#include <QObject>
-#include <KContacts/Address>
-namespace ContactEditor {
-class AddressGrantleeObject : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString removeAddressAction READ removeAddressAction)
- Q_PROPERTY(QString modifyAddressAction READ modifyAddressAction)
- Q_PROPERTY(QString formattedAddress READ formattedAddress)
- Q_PROPERTY(QString preferredAddressAction READ preferredAddressAction)
- Q_PROPERTY(QString addressType READ addressType)
- Q_PROPERTY(QString postOfficeBox READ postOfficeBox)
- Q_PROPERTY(QString street READ street)
- Q_PROPERTY(QString locality READ locality)
- Q_PROPERTY(QString region READ region)
- Q_PROPERTY(QString postalCode READ postalCode)
- Q_PROPERTY(QString country READ country)
- Q_PROPERTY(bool preferredAddress READ preferredAddress)
-public:
- explicit AddressGrantleeObject(const KContacts::Address &address, int addressIndex, QObject *parent = nullptr);
- ~AddressGrantleeObject();
-
- QString removeAddressAction() const;
- QString modifyAddressAction() const;
- QString formattedAddress() const;
- QString addressType() const;
- bool preferredAddress() const;
- QString preferredAddressAction() const;
- QString postOfficeBox() const;
- QString street() const;
- QString locality() const;
- QString region() const;
- QString postalCode() const;
- QString country() const;
-
-private:
- QString createActionUrl(const QString &actionName) const;
- KContacts::Address mAddress;
- int mAddressIndex;
- int mIconSize;
-};
-}
-#endif // ADDRESSGRANTLEEOBJECT_H
diff --git a/src/contact-editor/editor/addresseditor/addresslocationwidget.cpp b/src/contact-editor/editor/addresseditor/addresslocationwidget.cpp
deleted file mode 100644
index 5150213..0000000
--- a/src/contact-editor/editor/addresseditor/addresslocationwidget.cpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "addresslocationwidget.h"
-#include "selectaddresstypecombobox.h"
-
-#include <KComboBox>
-#include <KLineEdit>
-#include <KLocalizedString>
-
-#include <QVBoxLayout>
-#include <QLabel>
-#include <QCheckBox>
-#include <QPushButton>
-#include <QStackedWidget>
-using namespace ContactEditor;
-struct LocaleAwareLessThan : std::binary_function<QString, QString, bool> {
- bool operator()(const QString &s1, const QString &s2) const
- {
- return QString::localeAwareCompare(s1, s2) < 0;
- }
-};
-
-AddressLocationWidget::AddressLocationWidget(QWidget *parent)
- : QWidget(parent)
- , mCurrentAddress(-1)
- , mCurrentMode(CreateAddress)
-{
- QVBoxLayout *topLayout = new QVBoxLayout(this);
-
- QGridLayout *gridLayout = new QGridLayout;
- topLayout->addLayout(gridLayout);
-
- mTypeCombo = new SelectAddressTypeComboBox(this);
- mTypeCombo->setObjectName(QStringLiteral("typeaddress"));
- gridLayout->addWidget(mTypeCombo, 0, 0, 1, 2);
-
- QLabel *label = new QLabel(KContacts::Address::streetLabel(), this);
- label->setObjectName(QStringLiteral("streetlabel"));
- gridLayout->addWidget(label, 1, 0);
-
- mStreetEdit = new KLineEdit(this);
- mStreetEdit->setPlaceholderText(i18n("Add Street"));
- mStreetEdit->setObjectName(QStringLiteral("streetlineedit"));
- mStreetEdit->setTrapReturnKey(true);
- gridLayout->addWidget(mStreetEdit, 2, 0);
-
- label = new QLabel(KContacts::Address::postOfficeBoxLabel(), this);
- label->setObjectName(QStringLiteral("postofficeboxlabel"));
- gridLayout->addWidget(label, 1, 1);
-
- mPOBoxEdit = new KLineEdit(this);
- mPOBoxEdit->setPlaceholderText(i18n("Add Post Office Box"));
- mPOBoxEdit->setObjectName(QStringLiteral("postofficeboxlineedit"));
- mPOBoxEdit->setTrapReturnKey(true);
- gridLayout->addWidget(mPOBoxEdit, 2, 1);
-
- label = new QLabel(KContacts::Address::postalCodeLabel(), this);
- label->setObjectName(QStringLiteral("postalcodelabel"));
- gridLayout->addWidget(label, 3, 0);
- mPostalCodeEdit = new KLineEdit(this);
- mPostalCodeEdit->setPlaceholderText(i18n("Add Postal Code"));
- mPostalCodeEdit->setObjectName(QStringLiteral("postalcodelineedit"));
- mPostalCodeEdit->setTrapReturnKey(true);
- gridLayout->addWidget(mPostalCodeEdit, 4, 0);
-
- label = new QLabel(KContacts::Address::localityLabel(), this);
- label->setObjectName(QStringLiteral("localitylabel"));
- gridLayout->addWidget(label, 3, 1);
- mLocalityEdit = new KLineEdit(this);
- mLocalityEdit->setPlaceholderText(i18n("Add Locality"));
- mLocalityEdit->setObjectName(QStringLiteral("localitylineedit"));
- mLocalityEdit->setTrapReturnKey(true);
- gridLayout->addWidget(mLocalityEdit, 4, 1);
-
- label = new QLabel(KContacts::Address::regionLabel(), this);
- label->setObjectName(QStringLiteral("regionlabel"));
- gridLayout->addWidget(label, 5, 0);
- mRegionEdit = new KLineEdit(this);
- mRegionEdit->setPlaceholderText(i18n("Add Region"));
- mRegionEdit->setObjectName(QStringLiteral("regionlineedit"));
- mRegionEdit->setTrapReturnKey(true);
- gridLayout->addWidget(mRegionEdit, 6, 0);
-
- label = new QLabel(KContacts::Address::countryLabel(), this);
- label->setObjectName(QStringLiteral("countrylabel"));
- gridLayout->addWidget(label, 5, 1);
- mCountryCombo = new KComboBox(this);
- KLineEdit *edit = new KLineEdit(this);
- edit->setTrapReturnKey(true);
- mCountryCombo->setLineEdit(edit);
- mCountryCombo->setObjectName(QStringLiteral("countrycombobox"));
- mCountryCombo->setEditable(true);
- mCountryCombo->lineEdit()->setPlaceholderText(i18n("Add a Country"));
- mCountryCombo->setDuplicatesEnabled(false);
- gridLayout->addWidget(mCountryCombo, 6, 1);
-
- mPreferredCheckBox = new QCheckBox(i18nc("street/postal", "This is the preferred address"), this);
- mPreferredCheckBox->setObjectName(QStringLiteral("preferredcheckbox"));
- gridLayout->addWidget(mPreferredCheckBox, 7, 0, 1, 2);
-
- mButtonStack = new QStackedWidget(this);
- mButtonStack->setObjectName(QStringLiteral("buttonstacked"));
- topLayout->addWidget(mButtonStack);
-
- QWidget *addButtonWidget = new QWidget(this);
- QHBoxLayout *addButtonWidgetLayout = new QHBoxLayout(addButtonWidget);
- addButtonWidgetLayout->setMargin(0);
- mAddAddress = new QPushButton(i18n("Add Address"), this);
- mAddAddress->setObjectName(QStringLiteral("addbuttonaddress"));
- connect(mAddAddress, &QPushButton::clicked, this, &AddressLocationWidget::slotAddAddress);
- addButtonWidgetLayout->addWidget(mAddAddress);
- addButtonWidgetLayout->addStretch(1);
- mButtonStack->addWidget(addButtonWidget);
-
- QWidget *modifyButtonWidget = new QWidget(this);
- QHBoxLayout *modifyButtonWidgetLayout = new QHBoxLayout(modifyButtonWidget);
- modifyButtonWidgetLayout->setMargin(0);
- mButtonStack->addWidget(modifyButtonWidget);
-
- mModifyAddress = new QPushButton(i18n("Update Address"), this);
- mModifyAddress->setObjectName(QStringLiteral("modifybuttonaddress"));
- modifyButtonWidgetLayout->addWidget(mModifyAddress);
- connect(mModifyAddress, &QPushButton::clicked, this, &AddressLocationWidget::slotUpdateAddress);
-
- mCancelAddress = new QPushButton(i18n("Cancel"), this);
- mCancelAddress->setObjectName(QStringLiteral("cancelbuttonaddress"));
- connect(mCancelAddress, &QPushButton::clicked, this, &AddressLocationWidget::slotCancelModifyAddress);
- modifyButtonWidgetLayout->addWidget(mCancelAddress);
- modifyButtonWidgetLayout->addStretch(1);
- const int buttonWidth = qMax(mCancelAddress->width(), mModifyAddress->width());
- mModifyAddress->setMinimumWidth(buttonWidth);
- mCancelAddress->setMinimumWidth(buttonWidth);
-
- topLayout->addStretch(1);
- fillCountryCombo();
- switchMode();
-}
-
-AddressLocationWidget::~AddressLocationWidget()
-{
-}
-
-void AddressLocationWidget::setReadOnly(bool readOnly)
-{
- mPreferredCheckBox->setEnabled(!readOnly);
- mPOBoxEdit->setReadOnly(readOnly);
- mLocalityEdit->setReadOnly(readOnly);
- mRegionEdit->setReadOnly(readOnly);
- mPostalCodeEdit->setReadOnly(readOnly);
- mStreetEdit->setReadOnly(readOnly);
- mCountryCombo->setEnabled(!readOnly);
- mTypeCombo->setEnabled(!readOnly);
-
- mAddAddress->setEnabled(!readOnly);
- mModifyAddress->setEnabled(!readOnly);
- mCancelAddress->setEnabled(!readOnly);
-}
-
-void AddressLocationWidget::fillCountryCombo()
-{
- QStringList countries;
- const QList<QLocale> localeList = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
- countries.reserve(localeList.count());
- for (const QLocale &locale : localeList) {
- const QString localeStr = QLocale::countryToString(locale.country());
- if (countries.contains(localeStr)) {
- continue;
- }
- countries.append(localeStr);
- }
-
- std::sort(countries.begin(), countries.end(), LocaleAwareLessThan());
-
- mCountryCombo->addItems(countries);
- mCountryCombo->setAutoCompletion(true);
- mCountryCombo->completionObject()->setItems(countries);
- mCountryCombo->completionObject()->setIgnoreCase(true);
-
- const QString currentCountry = QLocale::countryToString(QLocale().country());
- mCountryCombo->setCurrentIndex(mCountryCombo->findText(currentCountry));
-}
-
-void AddressLocationWidget::slotAddAddress()
-{
- KContacts::Address addr = address();
- if (!addr.isEmpty()) {
- Q_EMIT addNewAddress(addr);
- reset();
- }
-}
-
-void AddressLocationWidget::setAddress(const KContacts::Address &address)
-{
- mAddress = address;
- mTypeCombo->setType(mAddress.type());
- mStreetEdit->setText(mAddress.street());
- mRegionEdit->setText(address.region());
- mLocalityEdit->setText(address.locality());
- mPostalCodeEdit->setText(address.postalCode());
- mPOBoxEdit->setText(address.postOfficeBox());
- mPreferredCheckBox->setChecked(address.type() &KContacts::Address::Pref);
- if (address.isEmpty()) {
- mCountryCombo->setItemText(mCountryCombo->currentIndex(),
- QLocale::countryToString(QLocale().country()));
- } else {
- mCountryCombo->setItemText(mCountryCombo->currentIndex(), mAddress.country());
- }
-}
-
-KContacts::Address AddressLocationWidget::address() const
-{
- KContacts::Address address(mAddress);
-
- address.setType(mTypeCombo->type());
- address.setLocality(mLocalityEdit->text());
- address.setRegion(mRegionEdit->text());
- address.setPostalCode(mPostalCodeEdit->text());
- address.setCountry(mCountryCombo->currentText());
- address.setPostOfficeBox(mPOBoxEdit->text());
- address.setStreet(mStreetEdit->text());
- if (mPreferredCheckBox->isChecked()) {
- address.setType(address.type() | KContacts::Address::Pref);
- } else {
- address.setType(address.type() & ~(KContacts::Address::Pref));
- }
- return address;
-}
-
-void AddressLocationWidget::switchMode()
-{
- switch (mCurrentMode) {
- case CreateAddress:
- mButtonStack->setCurrentIndex(0);
- break;
- case ModifyAddress:
- mButtonStack->setCurrentIndex(1);
- break;
- }
-}
-
-void AddressLocationWidget::slotModifyAddress(const KContacts::Address &address, int currentIndex)
-{
- setAddress(address);
- mCurrentMode = ModifyAddress;
- mCurrentAddress = currentIndex;
- switchMode();
-}
-
-void AddressLocationWidget::clear()
-{
- mCurrentMode = CreateAddress;
- setAddress(KContacts::Address());
- switchMode();
-}
-
-void AddressLocationWidget::slotUpdateAddress()
-{
- if (mCurrentMode == ModifyAddress) {
- Q_EMIT updateAddress(address(), mCurrentAddress);
- reset();
- }
-}
-
-void AddressLocationWidget::reset()
-{
- Q_EMIT updateAddressCanceled();
- mCurrentAddress = -1;
- clear();
-}
-
-void AddressLocationWidget::slotCancelModifyAddress()
-{
- reset();
-}
diff --git a/src/contact-editor/editor/addresseditor/addresslocationwidget.h b/src/contact-editor/editor/addresseditor/addresslocationwidget.h
deleted file mode 100644
index 07d8e47..0000000
--- a/src/contact-editor/editor/addresseditor/addresslocationwidget.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 ADDRESSLOCATIONWIDGET_H
-#define ADDRESSLOCATIONWIDGET_H
-
-#include <QWidget>
-#include <KContacts/Address>
-class QStackedWidget;
-class QCheckBox;
-class KLineEdit;
-class KComboBox;
-class QPushButton;
-namespace ContactEditor {
-class SelectAddressTypeComboBox;
-class AddressLocationWidget : public QWidget
-{
- Q_OBJECT
-public:
- enum Mode {
- CreateAddress = 0,
- ModifyAddress
- };
-
- explicit AddressLocationWidget(QWidget *parent = nullptr);
- ~AddressLocationWidget();
-
- void setAddress(const KContacts::Address &address);
- KContacts::Address address() const;
-
- void slotModifyAddress(const KContacts::Address &address, int currentIndex);
-
- void clear();
-
- void setReadOnly(bool readOnly);
-
-Q_SIGNALS:
- void addNewAddress(const KContacts::Address &address);
- void updateAddress(const KContacts::Address &address, int index);
- void updateAddressCanceled();
-
-private:
- void slotAddAddress();
- void slotUpdateAddress();
- void slotCancelModifyAddress();
- void fillCountryCombo();
- void switchMode();
- void reset();
- KContacts::Address mAddress;
- QCheckBox *mPreferredCheckBox = nullptr;
- KLineEdit *mPOBoxEdit = nullptr;
- KLineEdit *mLocalityEdit = nullptr;
- KLineEdit *mRegionEdit = nullptr;
- KLineEdit *mPostalCodeEdit = nullptr;
- KLineEdit *mStreetEdit = nullptr;
- KComboBox *mCountryCombo = nullptr;
- QPushButton *mAddAddress = nullptr;
- QPushButton *mModifyAddress = nullptr;
- QPushButton *mCancelAddress = nullptr;
- QStackedWidget *mButtonStack = nullptr;
- SelectAddressTypeComboBox *mTypeCombo = nullptr;
- int mCurrentAddress;
- Mode mCurrentMode;
-};
-}
-#endif // ADDRESSLOCATIONWIDGET_H
diff --git a/src/contact-editor/editor/addresseditor/addresstypedialog.cpp b/src/contact-editor/editor/addresseditor/addresstypedialog.cpp
deleted file mode 100644
index 176563f..0000000
--- a/src/contact-editor/editor/addresseditor/addresstypedialog.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (c) 2009 Tobias Koenig <[email protected]>
-
- 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 "addresstypedialog.h"
-#include <KLocalizedString>
-#include <QVBoxLayout>
-#include <QPushButton>
-#include <QDialogButtonBox>
-#include <QGroupBox>
-#include <QCheckBox>
-#include <QButtonGroup>
-using namespace ContactEditor;
-AddressTypeDialog::AddressTypeDialog(KContacts::Address::Type type, QWidget *parent)
- : QDialog(parent)
-{
- QVBoxLayout *mainLayout = new QVBoxLayout(this);
- setWindowTitle(i18nc("street/postal", "Edit Address Type"));
- QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
- QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
- okButton->setDefault(true);
- okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
- connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
- connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
-
- QWidget *page = new QWidget(this);
- mainLayout->addWidget(page);
- mainLayout->addWidget(buttonBox);
- QVBoxLayout *layout = new QVBoxLayout(page);
- layout->setMargin(0);
-
- QGroupBox *box = new QGroupBox(i18nc("street/postal", "Address Types"), page);
- mainLayout->addWidget(box);
- layout->addWidget(box);
- mGroup = new QButtonGroup(box);
- mGroup->setExclusive(false);
-
- QGridLayout *buttonLayout = new QGridLayout(box);
-
- mTypeList = KContacts::Address::typeList();
- mTypeList.removeAll(KContacts::Address::Pref);
-
- KContacts::Address::TypeList::ConstIterator it;
- int i = 0;
- int row = 0;
- KContacts::Address::TypeList::ConstIterator end(mTypeList.constEnd());
- for (it = mTypeList.constBegin(); it != end; ++it, ++i) {
- QCheckBox *cb = new QCheckBox(KContacts::Address::typeLabel(*it), box);
- cb->setChecked(type & mTypeList[i]);
- buttonLayout->addWidget(cb, row, i % 3);
-
- if (i % 3 == 2) {
- ++row;
- }
- mGroup->addButton(cb);
- }
-}
-
-AddressTypeDialog::~AddressTypeDialog()
-{
-}
-
-KContacts::Address::Type AddressTypeDialog::type() const
-{
- KContacts::Address::Type type;
- const int numberOfButtons(mGroup->buttons().count());
- for (int i = 0; i < numberOfButtons; ++i) {
- QCheckBox *box = qobject_cast<QCheckBox *>(mGroup->buttons().at(i));
- if (box && box->isChecked()) {
- type |= mTypeList[i];
- }
- }
-
- return type;
-}
diff --git a/src/contact-editor/editor/addresseditor/addresstypedialog.h b/src/contact-editor/editor/addresseditor/addresstypedialog.h
deleted file mode 100644
index 9c4e56b..0000000
--- a/src/contact-editor/editor/addresseditor/addresstypedialog.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (c) 2009 Tobias Koenig <[email protected]>
-
- 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 ADDRESSTYPEDIALOG_H
-#define ADDRESSTYPEDIALOG_H
-
-#include <QDialog>
-#include <KContacts/Address>
-class QButtonGroup;
-/**
- * Dialog for creating a new address types.
- *
- * @note This dialog is only used by AddressTypeCombo.
- */
-namespace ContactEditor {
-class AddressTypeDialog : public QDialog
-{
- Q_OBJECT
-public:
- AddressTypeDialog(KContacts::Address::Type type, QWidget *parent);
- ~AddressTypeDialog();
-
- KContacts::Address::Type type() const;
-
-private:
- QButtonGroup *mGroup = nullptr;
-
- KContacts::Address::TypeList mTypeList;
-};
-}
-
-#endif // ADDRESSTYPEDIALOG_H
diff --git a/src/contact-editor/editor/addresseditor/autotests/CMakeLists.txt b/src/contact-editor/editor/addresseditor/autotests/CMakeLists.txt
deleted file mode 100644
index ac641a0..0000000
--- a/src/contact-editor/editor/addresseditor/autotests/CMakeLists.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-include(ECMMarkAsTest)
-
-set(contacteditor_addresslocation_web_editor_SRCS
- ../webengine/addresseslocationengineviewer.cpp
- ../webengine/addresseslocationenginepage.cpp
- )
-set(contacteditor_webengine_LIB Qt5::WebEngine Qt5::WebEngineWidgets)
-
-ecm_qt_declare_logging_category(contacteditor_addresslocation_web_editor_SRCS HEADER contacteditor_debug.h IDENTIFIER CONTACTEDITOR_LOG CATEGORY_NAME org.kde.pim.contacteditor)
-
-set(addresseslocationviewer_SRCS addresseslocationviewertest.cpp ${contacteditor_addresslocation_web_editor_SRCS} ../addresseslocationgrantleeformater.cpp
- ../addressgrantleeobject.cpp ../iconnamecache.cpp)
-add_executable(addresseslocationviewer ${addresseslocationviewer_SRCS})
-add_test(NAME addresseslocationviewer COMMAND addresseslocationviewer)
-ecm_mark_as_test(addresseslocationviewer)
-target_link_libraries(addresseslocationviewer Qt5::Test Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n ${contacteditor_webengine_LIB} Grantlee5::Templates
- KF5::IconThemes KF5::WidgetsAddons)
-
-set(addresslocationwidget_SRCS addresslocationwidgettest.cpp ../addresslocationwidget.cpp ../selectaddresstypecombobox.cpp ../addresstypedialog.cpp)
-add_executable(addresslocationwidget ${addresslocationwidget_SRCS})
-add_test(NAME addresslocationwidget COMMAND addresslocationwidget)
-ecm_mark_as_test(addresslocationwidget)
-target_link_libraries(addresslocationwidget Qt5::Test Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion)
-
-set(addresseslocationwidget_SRCS addresseslocationwidgettest.cpp ../addresseslocationwidget.cpp ${contacteditor_addresslocation_web_editor_SRCS} ../addresseslocationgrantleeformater.cpp
- ../addressgrantleeobject.cpp ../iconnamecache.cpp ../addresslocationwidget.cpp ../selectaddresstypecombobox.cpp ../addresstypedialog.cpp)
-add_executable(addresseslocationwidget ${addresseslocationwidget_SRCS})
-add_test(NAME addresseslocationwidget COMMAND addresseslocationwidget)
-ecm_mark_as_test(addresseslocationwidget)
-target_link_libraries(addresseslocationwidget Qt5::Test Qt5::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion ${contacteditor_webengine_LIB}
- Grantlee5::Templates KF5::IconThemes KF5::WidgetsAddons)
diff --git a/src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.cpp b/src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.cpp
deleted file mode 100644
index 35d8ff4..0000000
--- a/src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "addresseslocationviewertest.h"
-#include "config-contact-editor.h"
-#include "../webengine/addresseslocationengineviewer.h"
-#include <QTest>
-using namespace ContactEditor;
-AddressesLocationViewerTest::AddressesLocationViewerTest(QObject *parent)
- : QObject(parent)
-{
-}
-
-AddressesLocationViewerTest::~AddressesLocationViewerTest()
-{
-}
-
-void AddressesLocationViewerTest::shouldHaveDefaultValue()
-{
- AddressesLocationEngineViewer w;
- QVERIFY(w.addresses().isEmpty());
-}
-
-QTEST_MAIN(AddressesLocationViewerTest)
diff --git a/src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.h b/src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.h
deleted file mode 100644
index b862790..0000000
--- a/src/contact-editor/editor/addresseditor/autotests/addresseslocationviewertest.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 ADDRESSESLOCATIONVIEWERTEST_H
-#define ADDRESSESLOCATIONVIEWERTEST_H
-
-#include <QObject>
-
-class AddressesLocationViewerTest : public QObject
-{
- Q_OBJECT
-public:
- explicit AddressesLocationViewerTest(QObject *parent = nullptr);
- ~AddressesLocationViewerTest();
-private Q_SLOTS:
- void shouldHaveDefaultValue();
-};
-
-#endif // ADDRESSESLOCATIONVIEWERTEST_H
diff --git a/src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.cpp b/src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.cpp
deleted file mode 100644
index ecbe3d5..0000000
--- a/src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "addresseslocationwidgettest.h"
-#include "config-contact-editor.h"
-#include "../webengine/addresseslocationengineviewer.h"
-
-#include "../addresseslocationwidget.h"
-#include <QTest>
-
-#include <editor/addresseditor/addresslocationwidget.h>
-using namespace ContactEditor;
-AddressesLocationWidgetTest::AddressesLocationWidgetTest(QObject *parent)
- : QObject(parent)
-{
-}
-
-AddressesLocationWidgetTest::~AddressesLocationWidgetTest()
-{
-}
-
-void AddressesLocationWidgetTest::shouldHaveDefaultValue()
-{
- AddressesLocationWidget w;
- AddressLocationWidget *addressLocationWidget = w.findChild<AddressLocationWidget *>(QStringLiteral("addresslocationwidget"));
- QVERIFY(addressLocationWidget);
-
- AddressesLocationEngineViewer *addressesLocationViewer = w.findChild<AddressesLocationEngineViewer *>(QStringLiteral("addresseslocationviewer"));
- QVERIFY(addressesLocationViewer);
-}
-
-QTEST_MAIN(AddressesLocationWidgetTest)
diff --git a/src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.h b/src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.h
deleted file mode 100644
index b5ac349..0000000
--- a/src/contact-editor/editor/addresseditor/autotests/addresseslocationwidgettest.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 ADDRESSESLOCATIONWIDGETTEST_H
-#define ADDRESSESLOCATIONWIDGETTEST_H
-
-#include <QObject>
-
-class AddressesLocationWidgetTest : public QObject
-{
- Q_OBJECT
-public:
- explicit AddressesLocationWidgetTest(QObject *parent = nullptr);
- ~AddressesLocationWidgetTest();
-
-private Q_SLOTS:
- void shouldHaveDefaultValue();
-};
-
-#endif // ADDRESSESLOCATIONWIDGETTEST_H
diff --git a/src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.cpp b/src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.cpp
deleted file mode 100644
index 03c2302..0000000
--- a/src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "addresslocationwidgettest.h"
-#include "../addresslocationwidget.h"
-#include <QLabel>
-#include <QPushButton>
-#include <KComboBox>
-#include <KLineEdit>
-#include <QTest>
-#include <QCheckBox>
-#include <editor/addresseditor/selectaddresstypecombobox.h>
-using namespace ContactEditor;
-AddressLocationWidgetTest::AddressLocationWidgetTest(QObject *parent)
- : QObject(parent)
-{
-}
-
-AddressLocationWidgetTest::~AddressLocationWidgetTest()
-{
-}
-
-void AddressLocationWidgetTest::shouldHaveDefaultValue()
-{
- AddressLocationWidget w;
-
- SelectAddressTypeComboBox *typeAddress = w.findChild<SelectAddressTypeComboBox *>(QStringLiteral("typeaddress"));
- QVERIFY(typeAddress);
-
- QLabel *streetlabel = w.findChild<QLabel *>(QStringLiteral("streetlabel"));
- QVERIFY(streetlabel);
- KLineEdit *mStreetEdit = w.findChild<KLineEdit *>(QStringLiteral("streetlineedit"));
- QVERIFY(mStreetEdit);
-
- QLabel *postofficeboxlabel = w.findChild<QLabel *>(QStringLiteral("postofficeboxlabel"));
- QVERIFY(postofficeboxlabel);
- KLineEdit *postofficeboxlineedit = w.findChild<KLineEdit *>(QStringLiteral("postofficeboxlineedit"));
- QVERIFY(postofficeboxlineedit);
-
- QLabel *localitylabel = w.findChild<QLabel *>(QStringLiteral("localitylabel"));
- QVERIFY(localitylabel);
- KLineEdit *localitylineedit = w.findChild<KLineEdit *>(QStringLiteral("localitylineedit"));
- QVERIFY(localitylineedit);
-
- QLabel *regionlabel = w.findChild<QLabel *>(QStringLiteral("regionlabel"));
- QVERIFY(regionlabel);
- KLineEdit *regionlineedit = w.findChild<KLineEdit *>(QStringLiteral("regionlineedit"));
- QVERIFY(regionlineedit);
-
- QLabel *postalcodelabel = w.findChild<QLabel *>(QStringLiteral("postalcodelabel"));
- QVERIFY(postalcodelabel);
- KLineEdit *postalcodelineedit = w.findChild<KLineEdit *>(QStringLiteral("postalcodelineedit"));
- QVERIFY(postalcodelineedit);
-
- QLabel *countrylabel = w.findChild<QLabel *>(QStringLiteral("countrylabel"));
- QVERIFY(countrylabel);
- KComboBox *countrycombobox = w.findChild<KComboBox *>(QStringLiteral("countrycombobox"));
- QVERIFY(countrycombobox);
-
- QCheckBox *preferredcheckbox = w.findChild<QCheckBox *>(QStringLiteral("preferredcheckbox"));
- QVERIFY(preferredcheckbox);
-
- QPushButton *addbuttonaddress = w.findChild<QPushButton *>(QStringLiteral("addbuttonaddress"));
- QVERIFY(addbuttonaddress);
-
- QPushButton *modifybuttonaddress = w.findChild<QPushButton *>(QStringLiteral("modifybuttonaddress"));
- QVERIFY(modifybuttonaddress);
-
- QPushButton *cancelbuttonaddress = w.findChild<QPushButton *>(QStringLiteral("cancelbuttonaddress"));
- QVERIFY(cancelbuttonaddress);
-}
-
-void AddressLocationWidgetTest::shouldChangeReadOnlyStatus()
-{
- AddressLocationWidget w;
-
- w.setReadOnly(true);
- SelectAddressTypeComboBox *typeAddress = w.findChild<SelectAddressTypeComboBox *>(QStringLiteral("typeaddress"));
- QCOMPARE(typeAddress->isEnabled(), false);
- KLineEdit *mStreetEdit = w.findChild<KLineEdit *>(QStringLiteral("streetlineedit"));
- QCOMPARE(mStreetEdit->isReadOnly(), true);
- KLineEdit *postofficeboxlineedit = w.findChild<KLineEdit *>(QStringLiteral("postofficeboxlineedit"));
- QCOMPARE(postofficeboxlineedit->isReadOnly(), true);
- KLineEdit *localitylineedit = w.findChild<KLineEdit *>(QStringLiteral("localitylineedit"));
- QCOMPARE(localitylineedit->isReadOnly(), true);
- KLineEdit *regionlineedit = w.findChild<KLineEdit *>(QStringLiteral("regionlineedit"));
- QCOMPARE(regionlineedit->isReadOnly(), true);
- KLineEdit *postalcodelineedit = w.findChild<KLineEdit *>(QStringLiteral("postalcodelineedit"));
- QCOMPARE(postalcodelineedit->isReadOnly(), true);
- KComboBox *countrycombobox = w.findChild<KComboBox *>(QStringLiteral("countrycombobox"));
- QCOMPARE(countrycombobox->isEnabled(), false);
- QCheckBox *preferredcheckbox = w.findChild<QCheckBox *>(QStringLiteral("preferredcheckbox"));
- QCOMPARE(preferredcheckbox->isEnabled(), false);
- QPushButton *addbuttonaddress = w.findChild<QPushButton *>(QStringLiteral("addbuttonaddress"));
- QCOMPARE(addbuttonaddress->isEnabled(), false);
- QPushButton *modifybuttonaddress = w.findChild<QPushButton *>(QStringLiteral("modifybuttonaddress"));
- QCOMPARE(modifybuttonaddress->isEnabled(), false);
- QPushButton *cancelbuttonaddress = w.findChild<QPushButton *>(QStringLiteral("cancelbuttonaddress"));
- QCOMPARE(cancelbuttonaddress->isEnabled(), false);
-}
-
-QTEST_MAIN(AddressLocationWidgetTest)
diff --git a/src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.h b/src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.h
deleted file mode 100644
index 2f7d2a9..0000000
--- a/src/contact-editor/editor/addresseditor/autotests/addresslocationwidgettest.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 ADDRESSLOCATIONWIDGETTEST_H
-#define ADDRESSLOCATIONWIDGETTEST_H
-
-#include <QObject>
-
-class AddressLocationWidgetTest : public QObject
-{
- Q_OBJECT
-public:
- explicit AddressLocationWidgetTest(QObject *parent = nullptr);
- ~AddressLocationWidgetTest();
-
-private Q_SLOTS:
- void shouldHaveDefaultValue();
- void shouldChangeReadOnlyStatus();
-};
-
-#endif // ADDRESSLOCATIONWIDGETTEST_H
diff --git a/src/contact-editor/editor/addresseditor/html/CMakeLists.txt b/src/contact-editor/editor/addresseditor/html/CMakeLists.txt
deleted file mode 100644
index b6d28f7..0000000
--- a/src/contact-editor/editor/addresseditor/html/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-install(DIRECTORY default DESTINATION ${KDE_INSTALL_DATADIR}/contacteditor/grantleetheme )
diff --git a/src/contact-editor/editor/addresseditor/html/default/addresseslocation.css b/src/contact-editor/editor/addresseditor/html/default/addresseslocation.css
deleted file mode 100644
index 02d83b3..0000000
--- a/src/contact-editor/editor/addresseditor/html/default/addresseslocation.css
+++ /dev/null
@@ -1,16 +0,0 @@
-#headeraddress {
-}
-
-#addresstype {
- float: left;
- color: #0000FF;
-}
-
-#actiontype {
- float: right;
- text-align: right;
-}
-
-#address {
- float: left;
-}
diff --git a/src/contact-editor/editor/addresseditor/html/default/addresseslocation.html b/src/contact-editor/editor/addresseditor/html/default/addresseslocation.html
deleted file mode 100644
index 345015b..0000000
--- a/src/contact-editor/editor/addresseditor/html/default/addresseslocation.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
-<html>
-<head>
-<title>.</title>
-<link href="{{ absoluteThemePath }}/addresseslocation.css" rel="stylesheet" type="text/css" />
-</head>
-<body>
-{% if addresses %}
-{% for address in addresses %}
- <div id="headeraddress">
- <div id="addresstype">{{ address.addressType }}</div>
- <div id="actiontype">
- {% if readOnly %}
- {% else %}
- {{ address.modifyAddressAction|safe}} {{ address.removeAddressAction|safe}}
- {% endif %}
- </div>
-
- <br>
- <div id="address" > {{ address.formattedAddress }} </div>
-
- <br style="clear: both;"/>
- <br/>
- </div>
-{% endfor %}
-{% endif %}
-
-</body>
-
diff --git a/src/contact-editor/editor/addresseditor/iconnamecache.cpp b/src/contact-editor/editor/addresseditor/iconnamecache.cpp
deleted file mode 100644
index a757014..0000000
--- a/src/contact-editor/editor/addresseditor/iconnamecache.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright 2009 Thomas McGuire <[email protected]>
-
- 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 ) version 3 or, at the discretion of KDE e.V.
- ( which shall act as a proxy as in section 14 of the GPLv3 ), 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 "iconnamecache_p.h"
-
-#include <KIconLoader>
-using namespace ContactEditor;
-Q_GLOBAL_STATIC(IconNameCache, s_iconNameCache)
-
-IconNameCache *IconNameCache::instance()
-{
- return s_iconNameCache;
-}
-
-bool IconNameCache::Entry::operator <(const Entry &other) const
-{
- const int fileNameCompare = fileName.compare(other.fileName);
- if (fileNameCompare != 0) {
- return fileNameCompare < 0;
- } else {
- return size < other.size;
- }
-}
-
-QString IconNameCache::iconPath(const QString &name, int size) const
-{
- Entry entry;
- entry.fileName = name;
- entry.size = size;
-
- const QString path = mCachedEntries.value(entry);
- if (!path.isEmpty()) {
- return path;
- }
-
- const QString fileName = KIconLoader::global()->iconPath(name, size);
- mCachedEntries.insert(entry, fileName);
- return fileName;
-}
diff --git a/src/contact-editor/editor/addresseditor/iconnamecache_p.h b/src/contact-editor/editor/addresseditor/iconnamecache_p.h
deleted file mode 100644
index 572087d..0000000
--- a/src/contact-editor/editor/addresseditor/iconnamecache_p.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright 2009 Thomas McGuire <[email protected]>
-
- 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 ) version 3 or, at the discretion of KDE e.V.
- ( which shall act as a proxy as in section 14 of the GPLv3 ), 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 ICONNAMECACHE_H
-#define ICONNAMECACHE_H
-
-#include <QMap>
-#include <QString>
-/**
- * This class is a replacement for KIconLoader::iconPath(), because the iconPath()
- * function can be slow for non-existing icons or icons that fall back to a generic icon.
- * Reason is that KIconLoader does slow system calls for finding the icons.
- *
- * The IconNameCache caches the result of iconPath() in a map and solves the slowness.
- */
-namespace ContactEditor {
-class IconNameCache
-{
-public:
-
- static IconNameCache *instance();
- QString iconPath(const QString &name, int size) const;
-
-private:
-
- class Entry
- {
- public:
- QString fileName;
- int size;
-
- bool operator <(const Entry &other) const;
- };
-
- mutable QMap<Entry, QString> mCachedEntries;
-};
-}
-#endif
diff --git a/src/contact-editor/editor/addresseditor/selectaddresstypecombobox.cpp b/src/contact-editor/editor/addresseditor/selectaddresstypecombobox.cpp
deleted file mode 100644
index 4ca11f7..0000000
--- a/src/contact-editor/editor/addresseditor/selectaddresstypecombobox.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "selectaddresstypecombobox.h"
-#include "addresstypedialog.h"
-#include "autoqpointer_p.h"
-
-#include <KLocalizedString>
-
-using namespace ContactEditor;
-SelectAddressTypeComboBox::SelectAddressTypeComboBox(QWidget *parent)
- : KComboBox(parent)
- , mType(KContacts::Address::Home)
- , mLastSelected(0)
-{
- const int count = KContacts::Address::typeList().count();
- mTypeList.reserve(count + 2);
- mTypeList.append(-2); // Add initial message
- for (int i = 0; i < count; ++i) {
- mTypeList.append(KContacts::Address::typeList().at(i));
- }
- mTypeList.append(-1); // Others...
-
- update();
-
- connect(this, QOverload<int>::of(&KComboBox::activated), this, &SelectAddressTypeComboBox::selected);
-}
-
-SelectAddressTypeComboBox::~SelectAddressTypeComboBox()
-{
-}
-
-void SelectAddressTypeComboBox::setType(KContacts::Address::Type type)
-{
- if (!mTypeList.contains(static_cast<int>(type))) {
- // insert at the end, but before the 'Others...' entry
- mTypeList.insert(mTypeList.at(mTypeList.count() - 1), static_cast<int>(type));
- }
-
- mType = type;
- update();
-}
-
-KContacts::Address::Type SelectAddressTypeComboBox::type() const
-{
- return mType;
-}
-
-void SelectAddressTypeComboBox::update()
-{
- bool blocked = signalsBlocked();
- blockSignals(true);
-
- clear();
- const int numberOfType(mTypeList.count());
- for (int i = 0; i < numberOfType; ++i) {
- if (mTypeList.at(i) == -1) { // "Other..." entry
- addItem(i18nc("@item:inlistbox Category of contact info field", "Other..."));
- } else if (mTypeList.at(i) == -2) {
- addItem(i18nc("@item:inlistbox Category of contact info field", "New Address Type"));
- } else {
- addItem(KContacts::Address::typeLabel(KContacts::Address::Type(mTypeList.at(i))));
- }
- }
-
- setCurrentIndex(mLastSelected = mTypeList.indexOf(mType));
-
- blockSignals(blocked);
-}
-
-void SelectAddressTypeComboBox::selected(int pos)
-{
- if (mTypeList.at(pos) == -1) {
- otherSelected();
- } else if (mTypeList.at(pos) == -2) {
- return;
- } else {
- mType = KContacts::Address::Type(mTypeList.at(pos));
- mLastSelected = pos;
- }
-}
-
-void SelectAddressTypeComboBox::otherSelected()
-{
- AutoQPointer<AddressTypeDialog> dlg = new AddressTypeDialog(mType, this);
- if (dlg->exec()) {
- mType = dlg->type();
- if (!mTypeList.contains(mType)) {
- mTypeList.insert(mTypeList.at(mTypeList.count() - 1), mType);
- }
- } else {
- setType(KContacts::Address::Type(mTypeList.at(mLastSelected)));
- }
- update();
-}
diff --git a/src/contact-editor/editor/addresseditor/selectaddresstypecombobox.h b/src/contact-editor/editor/addresseditor/selectaddresstypecombobox.h
deleted file mode 100644
index 8987392..0000000
--- a/src/contact-editor/editor/addresseditor/selectaddresstypecombobox.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 SELECTADDRESSTYPECOMBOBOX_H
-#define SELECTADDRESSTYPECOMBOBOX_H
-
-#include <KComboBox>
-#include <KContacts/Address>
-
-/**
- * @short A widget for selecting the type of an address.
- */
-namespace ContactEditor {
-class SelectAddressTypeComboBox : public KComboBox
-{
- Q_OBJECT
-
-public:
- /**
- * Creates a new address type combo.
- *
- * @param parent The parent widget.
- */
- explicit SelectAddressTypeComboBox(QWidget *parent = nullptr);
-
- /**
- * Destroys the address type combo.
- */
- ~SelectAddressTypeComboBox();
-
- /**
- * Sets the type that shall be selected in the combobox.
- * @param type KABC address type to set.
- */
- void setType(KContacts::Address::Type type);
-
- /**
- * Returns the type that is currently selected.
- */
- KContacts::Address::Type type() const;
-
-private Q_SLOTS:
- void selected(int);
- void otherSelected();
-
-private:
- void update();
-
- KContacts::Address::Type mType;
- int mLastSelected;
- QList<int> mTypeList;
-};
-}
-#endif
diff --git a/src/contact-editor/editor/addresseditor/tests/CMakeLists.txt b/src/contact-editor/editor/addresseditor/tests/CMakeLists.txt
deleted file mode 100644
index 3198e47..0000000
--- a/src/contact-editor/editor/addresseditor/tests/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-set(akonadicontact_addresslocation_web_editor_SRCS
- ../webengine/addresseslocationengineviewer.cpp
- ../webengine/addresseslocationenginepage.cpp
- )
-set(akonadicontact_webengine_LIB Qt5::WebEngine Qt5::WebEngineWidgets)
-
-ecm_qt_declare_logging_category(akonadicontact_addresslocation_web_editor_SRCS HEADER contacteditor_debug.h IDENTIFIER CONTACTEDITOR_LOG CATEGORY_NAME org.kde.pim.akonadi_contact)
-
-set(addresseditor_SRCS
- ${akonadicontact_addresslocation_web_editor_SRCS}
- main.cpp
- ../addresseslocationwidget.cpp
- ../addresseslocationgrantleeformater.cpp
- ../addressgrantleeobject.cpp
- ../iconnamecache.cpp
- ../addresslocationwidget.cpp
- ../selectaddresstypecombobox.cpp
- ../addresstypedialog.cpp
- )
-
-add_executable(addresseditortest ${addresseditor_SRCS})
-
-target_link_libraries(addresseditortest
- Qt5::Widgets
- KF5::AkonadiContact
- KF5::Contacts
- KF5::I18n
- KF5::Completion
- Grantlee5::Templates
- KF5::IconThemes
- KF5::WidgetsAddons
- ${akonadicontact_webengine_LIB}
- )
-
diff --git a/src/contact-editor/editor/addresseditor/tests/main.cpp b/src/contact-editor/editor/addresseditor/tests/main.cpp
deleted file mode 100644
index 405eb34..0000000
--- a/src/contact-editor/editor/addresseditor/tests/main.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, [email protected]
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 <QApplication>
-
-#include "../addresseslocationwidget.h"
-using namespace ContactEditor;
-int main(int argc, char *argv[])
-{
- QApplication app(argc, argv);
-
- AddressesLocationWidget *addresseslocationwidget = new AddressesLocationWidget;
- addresseslocationwidget->show();
-
- return app.exec();
-}
diff --git a/src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.cpp b/src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.cpp
deleted file mode 100644
index d02de72..0000000
--- a/src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "addresseslocationenginepage.h"
-#include <QWebEngineSettings>
-#include <QWebEngineProfile>
-
-using namespace ContactEditor;
-
-AddressesLocationEnginePage::AddressesLocationEnginePage(QObject *parent)
- : QWebEnginePage(parent)
-{
- settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, false);
- settings()->setAttribute(QWebEngineSettings::PluginsEnabled, false);
- settings()->setAttribute(QWebEngineSettings::AutoLoadImages, true);
- settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, false);
- settings()->setAttribute(QWebEngineSettings::JavascriptCanAccessClipboard, false);
- settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, false);
- settings()->setAttribute(QWebEngineSettings::XSSAuditingEnabled, false);
- settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
- settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, false);
- settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, false);
- settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, false);
- settings()->setAttribute(QWebEngineSettings::WebGLEnabled, false);
- settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
- settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, false);
- settings()->setAttribute(QWebEngineSettings::WebGLEnabled, false);
-
- settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
- settings()->setAttribute(QWebEngineSettings::AllowRunningInsecureContent, false);
- profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
-}
-
-AddressesLocationEnginePage::~AddressesLocationEnginePage()
-{
-}
-
-bool AddressesLocationEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame)
-{
- Q_UNUSED(type);
- Q_UNUSED(isMainFrame);
- Q_EMIT urlClicked(url);
- return false;
-}
diff --git a/src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.h b/src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.h
deleted file mode 100644
index 8b5abde..0000000
--- a/src/contact-editor/editor/addresseditor/webengine/addresseslocationenginepage.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 ADDRESSESLOCATIONENGINEPAGE_H
-#define ADDRESSESLOCATIONENGINEPAGE_H
-
-#include <QWebEnginePage>
-
-namespace ContactEditor {
-class AddressesLocationEnginePage : public QWebEnginePage
-{
- Q_OBJECT
-public:
- explicit AddressesLocationEnginePage(QObject *parent = nullptr);
- ~AddressesLocationEnginePage();
-
-Q_SIGNALS:
- void urlClicked(const QUrl &url);
-
-protected:
- bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override;
-};
-}
-
-#endif // ADDRESSESLOCATIONENGINEPAGE_H
diff --git a/src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.cpp b/src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.cpp
deleted file mode 100644
index 6f4fced..0000000
--- a/src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 "addresseslocationengineviewer.h"
-#include "addresseslocationenginepage.h"
-#include "contacteditor_debug.h"
-#include "../addresseslocationgrantleeformater.h"
-#include <KMessageBox>
-#include <KLocalizedString>
-#include <QUrlQuery>
-
-using namespace ContactEditor;
-
-AddressesLocationEngineViewer::AddressesLocationEngineViewer(QWidget *parent)
- : QWebEngineView(parent)
- , mAddressesLocationGrantleeFormatter(new AddressesLocationGrantleeFormater(this))
- , mEditMode(false)
-{
- AddressesLocationEnginePage *pageEngine = new AddressesLocationEnginePage(this);
- setPage(pageEngine);
-
- setFocusPolicy(Qt::WheelFocus);
- connect(pageEngine, &AddressesLocationEnginePage::urlClicked, this, &AddressesLocationEngineViewer::slotLinkClicked);
-
- setContextMenuPolicy(Qt::CustomContextMenu);
-}
-
-AddressesLocationEngineViewer::~AddressesLocationEngineViewer()
-{
-}
-
-void AddressesLocationEngineViewer::setReadOnly(bool readOnly)
-{
- mAddressesLocationGrantleeFormatter->setReadOnly(readOnly);
- updateView();
-}
-
-void AddressesLocationEngineViewer::slotLinkClicked(const QUrl &url)
-{
- if (url.scheme() == QLatin1String("addresslocationaction")) {
- const QString urlPath(url.path());
- if (url.hasQuery()) {
- const QUrlQuery urlQuery(url);
- const int addressId = urlQuery.queryItemValue(QStringLiteral("id")).toInt();
- if (urlPath == QStringLiteral("removeaddress")) {
- if (!mEditMode) {
- removeAddress(addressId);
- }
- } else if (urlPath == QStringLiteral("editaddress")) {
- if (!mEditMode) {
- editAddress(addressId);
- }
- } else {
- qCDebug(CONTACTEDITOR_LOG) << "Unknown url" << url;
- }
- }
- }
-}
-
-void AddressesLocationEngineViewer::removeAddress(int index)
-{
- if (index < 0) {
- return;
- } else if (index < mAddresses.count()) {
- const int result = KMessageBox::questionYesNo(this, i18n("Do you really want to delete this address?"));
-
- if (result != KMessageBox::Yes) {
- return;
- }
- mAddresses.remove(index);
- updateView();
- }
-}
-
-void AddressesLocationEngineViewer::editAddress(int index)
-{
- if (index < 0) {
- return;
- } else if (index < mAddresses.count()) {
- mEditMode = true;
- Q_EMIT modifyAddress(mAddresses.at(index), index);
- }
-}
-
-void AddressesLocationEngineViewer::replaceAddress(const KContacts::Address &address, int index)
-{
- if (index < 0) {
- return;
- } else if (index < mAddresses.count()) {
- mAddresses[index] = address;
- updateView();
- }
- mEditMode = false;
-}
-
-void AddressesLocationEngineViewer::updateAddressCanceled()
-{
- mEditMode = false;
-}
-
-void AddressesLocationEngineViewer::updateView()
-{
- const QString html = mAddressesLocationGrantleeFormatter->formatAddresses(mAddresses);
- setHtml(html, QUrl(QStringLiteral("file://")));
-}
-
-void AddressesLocationEngineViewer::addAddress(const KContacts::Address &address)
-{
- if (!address.isEmpty()) {
- mAddresses.append(address);
- updateView();
- }
-}
-
-KContacts::Address::List AddressesLocationEngineViewer::addresses() const
-{
- return mAddresses;
-}
-
-void AddressesLocationEngineViewer::setAddresses(const KContacts::Address::List &addresses)
-{
- mAddresses = addresses;
- updateView();
-}
diff --git a/src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.h b/src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.h
deleted file mode 100644
index 6913aad..0000000
--- a/src/contact-editor/editor/addresseditor/webengine/addresseslocationengineviewer.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- This file is part of Contact Editor.
-
- Copyright (C) 2016-2017 Laurent Montel <[email protected]>
-
- 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 AddressesLocationEngineViewer_H
-#define AddressesLocationEngineViewer_H
-
-#include <QWebEngineView>
-#include <KContacts/Address>
-namespace ContactEditor {
-class AddressesLocationGrantleeFormater;
-class AddressesLocationEngineViewer : public QWebEngineView
-{
- Q_OBJECT
-public:
- explicit AddressesLocationEngineViewer(QWidget *parent = nullptr);
- ~AddressesLocationEngineViewer();
-
- KContacts::Address::List addresses() const;
- void setAddresses(const KContacts::Address::List &addresses);
- void setReadOnly(bool readOnly);
-
-public Q_SLOTS:
- void addAddress(const KContacts::Address &address);
- void replaceAddress(const KContacts::Address &address, int index);
- void updateAddressCanceled();
-
-private Q_SLOTS:
- void slotLinkClicked(const QUrl &url);
-
-Q_SIGNALS:
- void modifyAddress(const KContacts::Address &address, int currentIndex);
-
-private:
- void updateView();
- void editAddress(int index);
- void removeAddress(int index);
- KContacts::Address::List mAddresses;
- AddressesLocationGrantleeFormater *mAddressesLocationGrantleeFormatter = nullptr;
- bool mEditMode;
-};
-}
-#endif
diff --git a/src/contact-editor/editor/generalinfoeditor/autotests/CMakeLists.txt b/src/contact-editor/editor/generalinfoeditor/autotests/CMakeLists.txt
index 98e69c2..ff6a22d 100644
--- a/src/contact-editor/editor/generalinfoeditor/autotests/CMakeLists.txt
+++ b/src/contact-editor/editor/generalinfoeditor/autotests/CMakeLists.txt
@@ -1,3 +1,7 @@
+include(ECMMarkAsTest)
+
+find_package(Qt5Test CONFIG REQUIRED)
+
set(phonewidgettest_SRCS phonewidgettest.cpp)
add_executable(phonewidgettest ${phonewidgettest_SRCS})
add_test(NAME phonewidgettest COMMAND phonewidgettest)