Commit ec28ac89 authored by Laurent Montel's avatar Laurent Montel 😁

Fix namespace. Rename etc.

parent ad454cba
......@@ -126,22 +126,15 @@ target_link_libraries(KF5AkonadiContact
KF5::AkonadiWidgets
Qt5::Widgets
PRIVATE
KF5::Completion
KF5::ConfigCore
KF5::ConfigWidgets
KF5::IconThemes
KF5::KIOWidgets
KF5::Mime
KF5::Codecs
KF5::DBusAddons
KF5::I18n
KF5::Service
KF5::TextWidgets
KF5::WidgetsAddons
KF5::XmlGui
Grantlee5::Templates
Qt5::WebEngine
Qt5::WebEngineWidgets
KF5::ContactEditor
)
......@@ -161,9 +154,6 @@ install(TARGETS
EXPORT KF5AkonadiContactTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
)
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)
ecm_generate_pri_file(BASE_NAME AkonadiContact
LIB_NAME KF5AkonadiContact
DEPS "AkonadiCore Contacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Akonadi/Contact
......@@ -224,7 +214,6 @@ install( FILES
${AkonadiContact_HEADERS}
${AkonadiContactJob_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_export.h
editor/im/improtocols.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/akonadi/contact COMPONENT Devel
)
......
......@@ -2,6 +2,7 @@
include(CMakeFindDependencyMacro)
find_dependency(KF5Akonadi "@AKONADI_VERSION@")
find_dependency(KF5Contacts "@KCONTACTS_VERSION@")
find_dependency(KF5ContactEditor "@PIM_VERSION@")
include("${CMAKE_CURRENT_LIST_DIR}/KF5AkonadiContactTargets.cmake")
......@@ -44,10 +44,10 @@
using namespace Akonadi;
class Q_DECL_HIDDEN ContactEditor::Private
class Q_DECL_HIDDEN Akonadi::AkonadiContactEditor::Private
{
public:
Private(ContactEditor::Mode mode, ContactEditor::DisplayMode displayMode, AbstractContactEditorWidget *editorWidget, ContactEditor *parent)
Private(AkonadiContactEditor::Mode mode, AkonadiContactEditor::DisplayMode displayMode, ContactEditor::AbstractContactEditorWidget *editorWidget, AkonadiContactEditor *parent)
: mParent(parent)
, mMode(mode)
, mMonitor(nullptr)
......@@ -79,17 +79,17 @@ public:
void storeContact(KContacts::Addressee &addr, ContactMetaDataAkonadi &metaData);
void setupMonitor();
ContactEditor *mParent;
ContactEditor::Mode mMode;
AkonadiContactEditor *mParent;
AkonadiContactEditor::Mode mMode;
Akonadi::Item mItem;
Akonadi::ContactMetaDataAkonadi mContactMetaData;
Akonadi::Monitor *mMonitor;
Akonadi::Collection mDefaultCollection;
AbstractContactEditorWidget *mEditorWidget;
ContactEditor::AbstractContactEditorWidget *mEditorWidget;
bool mReadOnly;
};
void ContactEditor::Private::itemFetchDone(KJob *job)
void Akonadi::AkonadiContactEditor::Private::itemFetchDone(KJob *job)
{
if (job->error() != KJob::NoError) {
return;
......@@ -107,7 +107,7 @@ void ContactEditor::Private::itemFetchDone(KJob *job)
mItem = fetchJob->items().at(0);
mReadOnly = false;
if (mMode == ContactEditor::EditMode) {
if (mMode == AkonadiContactEditor::EditMode) {
// if in edit mode we have to fetch the parent collection to find out
// about the modify rights of the item
......@@ -123,7 +123,7 @@ void ContactEditor::Private::itemFetchDone(KJob *job)
}
}
void ContactEditor::Private::parentCollectionFetchDone(KJob *job)
void Akonadi::AkonadiContactEditor::Private::parentCollectionFetchDone(KJob *job)
{
if (job->error()) {
return;
......@@ -146,7 +146,7 @@ void ContactEditor::Private::parentCollectionFetchDone(KJob *job)
loadContact(addr, mContactMetaData);
}
void ContactEditor::Private::storeDone(KJob *job)
void Akonadi::AkonadiContactEditor::Private::storeDone(KJob *job)
{
if (job->error() != KJob::NoError) {
Q_EMIT mParent->error(job->errorString());
......@@ -162,7 +162,7 @@ void ContactEditor::Private::storeDone(KJob *job)
Q_EMIT mParent->finished();
}
void ContactEditor::Private::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &)
void Akonadi::AkonadiContactEditor::Private::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &)
{
Q_UNUSED(item);
QPointer<QMessageBox> dlg = new QMessageBox(mParent); //krazy:exclude=qclasses
......@@ -183,17 +183,17 @@ void ContactEditor::Private::itemChanged(const Akonadi::Item &item, const QSet<Q
delete dlg;
}
void ContactEditor::Private::loadContact(const KContacts::Addressee &addr, const ContactMetaDataAkonadi &metaData)
void Akonadi::AkonadiContactEditor::Private::loadContact(const KContacts::Addressee &addr, const ContactMetaDataAkonadi &metaData)
{
mEditorWidget->loadContact(addr, metaData);
}
void ContactEditor::Private::storeContact(KContacts::Addressee &addr, ContactMetaDataAkonadi &metaData)
void Akonadi::AkonadiContactEditor::Private::storeContact(KContacts::Addressee &addr, ContactMetaDataAkonadi &metaData)
{
mEditorWidget->storeContact(addr, metaData);
}
void ContactEditor::Private::setupMonitor()
void Akonadi::AkonadiContactEditor::Private::setupMonitor()
{
delete mMonitor;
mMonitor = new Akonadi::Monitor;
......@@ -202,30 +202,30 @@ void ContactEditor::Private::setupMonitor()
connect(mMonitor, SIGNAL(itemChanged(Akonadi::Item,QSet<QByteArray>)), mParent, SLOT(itemChanged(Akonadi::Item,QSet<QByteArray>)));
}
ContactEditor::ContactEditor(Mode mode, QWidget *parent)
Akonadi::AkonadiContactEditor::AkonadiContactEditor(Mode mode, QWidget *parent)
: QWidget(parent)
, d(new Private(mode, FullMode, nullptr, this))
{
}
ContactEditor::ContactEditor(Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent)
Akonadi::AkonadiContactEditor::AkonadiContactEditor(Mode mode, ContactEditor::AbstractContactEditorWidget *editorWidget, QWidget *parent)
: QWidget(parent)
, d(new Private(mode, FullMode, editorWidget, this))
{
}
ContactEditor::ContactEditor(Mode mode, DisplayMode displayMode, QWidget *parent)
Akonadi::AkonadiContactEditor::AkonadiContactEditor(Mode mode, DisplayMode displayMode, QWidget *parent)
: QWidget(parent)
, d(new Private(mode, displayMode, nullptr, this))
{
}
ContactEditor::~ContactEditor()
Akonadi::AkonadiContactEditor::~AkonadiContactEditor()
{
delete d;
}
void ContactEditor::loadContact(const Akonadi::Item &item)
void Akonadi::AkonadiContactEditor::loadContact(const Akonadi::Item &item)
{
if (d->mMode == CreateMode) {
Q_ASSERT_X(false, "ContactEditor::loadContact", "You are calling loadContact in CreateMode!");
......@@ -242,14 +242,14 @@ void ContactEditor::loadContact(const Akonadi::Item &item)
d->mMonitor->setItemMonitored(item);
}
KContacts::Addressee ContactEditor::contact()
KContacts::Addressee Akonadi::AkonadiContactEditor::contact()
{
KContacts::Addressee addr;
d->storeContact(addr, d->mContactMetaData);
return addr;
}
void ContactEditor::saveContactInAddressBook()
void Akonadi::AkonadiContactEditor::saveContactInAddressBook()
{
if (d->mMode == EditMode) {
if (!d->mItem.isValid() || d->mReadOnly) {
......@@ -297,12 +297,12 @@ void ContactEditor::saveContactInAddressBook()
}
}
void ContactEditor::setContactTemplate(const KContacts::Addressee &contact)
void Akonadi::AkonadiContactEditor::setContactTemplate(const KContacts::Addressee &contact)
{
d->loadContact(contact, d->mContactMetaData);
}
void ContactEditor::setDefaultAddressBook(const Akonadi::Collection &collection)
void Akonadi::AkonadiContactEditor::setDefaultAddressBook(const Akonadi::Collection &collection)
{
d->mDefaultCollection = collection;
}
......
......@@ -30,11 +30,13 @@ namespace KContacts
{
class Addressee;
}
namespace ContactEditor
{
class AbstractContactEditorWidget;
}
namespace Akonadi
{
class AbstractContactEditorWidget;
class Collection;
class Item;
......@@ -79,7 +81,7 @@ class Item;
* @author Tobias Koenig <tokoe@kde.org>
* @since 4.4
*/
class AKONADI_CONTACT_EXPORT ContactEditor : public QWidget
class AKONADI_CONTACT_EXPORT AkonadiContactEditor : public QWidget
{
Q_OBJECT
......@@ -103,7 +105,7 @@ public:
* @param mode The mode of the editor.
* @param parent The parent widget of the editor.
*/
explicit ContactEditor(Mode mode, QWidget *parent = nullptr);
explicit AkonadiContactEditor(Mode mode, QWidget *parent = nullptr);
/**
* Creates a new contact editor with a custom editor widget.
......@@ -112,7 +114,7 @@ public:
* @param editorWidget The contact editor widget that shall be used for editing.
* @param parent The parent widget of the editor.
*/
ContactEditor(Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent = nullptr);
AkonadiContactEditor(Mode mode, ContactEditor::AbstractContactEditorWidget *editorWidget, QWidget *parent = nullptr);
/**
* Creates a new contact editor dialog with a custom editor widget.
......@@ -122,12 +124,12 @@ public:
* @param parent The parent widget of the dialog.
* @since 4.10
*/
ContactEditor(Mode mode, DisplayMode displayMode, QWidget *parent = nullptr);
AkonadiContactEditor(Mode mode, DisplayMode displayMode, QWidget *parent = nullptr);
/**
* Destroys the contact editor.
*/
virtual ~ContactEditor();
virtual ~AkonadiContactEditor();
/**
* Sets a @p contact that is used as template in create mode.
......
......@@ -43,7 +43,7 @@ using namespace Akonadi;
class Q_DECL_HIDDEN ContactEditorDialog::Private
{
public:
Private(ContactEditorDialog::Mode mode, ContactEditorDialog::DisplayMode displaymode, AbstractContactEditorWidget *editorWidget,
Private(ContactEditorDialog::Mode mode, ContactEditorDialog::DisplayMode displaymode, ContactEditor::AbstractContactEditorWidget *editorWidget,
ContactEditorDialog *parent)
: q(parent)
, mAddressBookBox(nullptr)
......@@ -63,9 +63,9 @@ public:
layout->setMargin(0);
if (editorWidget) {
mEditor = new ContactEditor(mode == ContactEditorDialog::CreateMode ? ContactEditor::CreateMode : ContactEditor::EditMode, editorWidget, q);
mEditor = new AkonadiContactEditor(mode == ContactEditorDialog::CreateMode ? AkonadiContactEditor::CreateMode : AkonadiContactEditor::EditMode, editorWidget, q);
} else {
mEditor = new ContactEditor(mode == ContactEditorDialog::CreateMode ? ContactEditor::CreateMode : ContactEditor::EditMode, displaymode == ContactEditorDialog::FullMode ? ContactEditor::FullMode : ContactEditor::VCardMode, q);
mEditor = new AkonadiContactEditor(mode == ContactEditorDialog::CreateMode ? AkonadiContactEditor::CreateMode : AkonadiContactEditor::EditMode, displaymode == ContactEditorDialog::FullMode ? AkonadiContactEditor::FullMode : AkonadiContactEditor::VCardMode, q);
}
if (mode == ContactEditorDialog::CreateMode) {
......@@ -82,10 +82,10 @@ public:
layout->addWidget(mEditor, 1, 0, 1, 2);
layout->setColumnStretch(1, 1);
connect(mEditor, &ContactEditor::contactStored,
connect(mEditor, &AkonadiContactEditor::contactStored,
q, &ContactEditorDialog::contactStored);
connect(mEditor, &ContactEditor::error,
connect(mEditor, &AkonadiContactEditor::error,
q, &ContactEditorDialog::error);
connect(mEditor, SIGNAL(finished()), q, SLOT(slotFinish()));
......@@ -132,7 +132,7 @@ public:
ContactEditorDialog *q;
CollectionComboBox *mAddressBookBox;
ContactEditorDialog::Mode mMode;
ContactEditor *mEditor;
AkonadiContactEditor *mEditor;
};
ContactEditorDialog::ContactEditorDialog(Mode mode, QWidget *parent)
......@@ -141,7 +141,7 @@ ContactEditorDialog::ContactEditorDialog(Mode mode, QWidget *parent)
{
}
ContactEditorDialog::ContactEditorDialog(Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent)
ContactEditorDialog::ContactEditorDialog(Mode mode, ContactEditor::AbstractContactEditorWidget *editorWidget, QWidget *parent)
: QDialog(parent)
, d(new Private(mode, FullMode, editorWidget, this))
{
......@@ -173,7 +173,7 @@ void ContactEditorDialog::setDefaultAddressBook(const Akonadi::Collection &addre
d->mAddressBookBox->setDefaultCollection(addressbook);
}
ContactEditor *ContactEditorDialog::editor() const
AkonadiContactEditor *ContactEditorDialog::editor() const
{
return d->mEditor;
}
......
......@@ -26,11 +26,14 @@
#include <QDialog>
namespace ContactEditor
{
class AbstractContactEditorWidget;
}
namespace Akonadi
{
class AbstractContactEditorWidget;
class ContactEditor;
class AkonadiContactEditor;
class Collection;
class Item;
......@@ -106,7 +109,7 @@ public:
* @param editorWidget The contact editor widget that shall be used for editing.
* @param parent The parent widget of the dialog.
*/
ContactEditorDialog(Mode mode, AbstractContactEditorWidget *editorWidget, QWidget *parent = nullptr);
ContactEditorDialog(Mode mode, ContactEditor::AbstractContactEditorWidget *editorWidget, QWidget *parent = nullptr);
/**
* Creates a new contact editor dialog with a custom editor widget.
......@@ -139,7 +142,7 @@ public:
/**
* Returns the ContactEditor that is used by this dialog.
*/
ContactEditor *editor() const;
AkonadiContactEditor *editor() const;
Q_SIGNALS:
/**
......
......@@ -33,7 +33,7 @@ class Item;
/**
* @short A helper class for storing contact specific settings.
*/
class ContactMetaDataAkonadi : public ContactMetaDataBase
class ContactMetaDataAkonadi : public ContactEditor::ContactMetaDataBase
{
public:
/**
......
add_definitions(-DTRANSLATION_DOMAIN=\"akonadicontact5\")
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5ContactEditor")
ecm_setup_version(PROJECT VARIABLE_PREFIX CONTACTEDITOR
ecm_setup_version(PROJECT VARIABLE_PREFIX AKONADICONTACT
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/contact-editor_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5ContactEditorConfigVersion.cmake"
SOVERSION 5
......@@ -84,7 +84,7 @@ set(contacteditor_editor_generalinfo_SRCS
editor/generalinfoeditor/categorieseditwidget.cpp
editor/generalinfoeditor/nameeditdialog.cpp
editor/generalinfoeditor/displaynameeditwidget.cpp
editor/generalinfoeditor/akonadicontactselecttypecombobox.cpp
editor/generalinfoeditor/contactselecttypecombobox.cpp
editor/generalinfoeditor/messageformattingwidget.cpp
${contacteditor_editor_generalinfo_messaging_SRCS}
${contacteditor_editor_generalinfo_phone_SRCS}
......@@ -163,10 +163,10 @@ target_include_directories(KF5ContactEditor PUBLIC "$<BUILD_INTERFACE:${Akonadi-
target_link_libraries(KF5ContactEditor
PUBLIC
KF5::AkonadiCore
KF5::Contacts
KF5::AkonadiWidgets
Qt5::Widgets
KF5::AkonadiCore
KF5::AkonadiWidgets
PRIVATE
KF5::Completion
KF5::ConfigCore
......@@ -204,7 +204,7 @@ install(TARGETS
ecm_generate_pri_file(BASE_NAME ContactEditor
LIB_NAME KF5ContactEditor
DEPS "AkonadiCore Contacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Akonadi/Contact
DEPS "Contacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor
)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
......@@ -240,11 +240,13 @@ if (BUILD_TESTING)
add_subdirectory(editor/addresseditor/tests)
add_subdirectory(editor/generalinfoeditor/autotests/)
add_subdirectory(editor/generalinfoeditor/tests)
#Laurent reactivate it
#add_subdirectory(editor/customfieldeditor/autotests/)
#add_subdirectory(editor/customfieldeditor/tests)
add_subdirectory(editor/customfieldeditor/autotests/)
add_subdirectory(editor/customfieldeditor/tests)
add_subdirectory(editor/widgets/autotests/)
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)
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......@@ -29,7 +29,7 @@ namespace KContacts
class Addressee;
}
namespace Akonadi
namespace ContactEditor
{
class ContactMetaDataBase;
......@@ -57,12 +57,12 @@ public:
/**
* @param contact loads the given contact into the editor widget
*/
virtual void loadContact(const KContacts::Addressee &contact, const Akonadi::ContactMetaDataBase &metaData) = 0;
virtual void loadContact(const KContacts::Addressee &contact, const ContactEditor::ContactMetaDataBase &metaData) = 0;
/**
* @param contact store the given contact into the editor widget
*/
virtual void storeContact(KContacts::Addressee &contact, Akonadi::ContactMetaDataBase &metaData) const = 0;
virtual void storeContact(KContacts::Addressee &contact, ContactEditor::ContactMetaDataBase &metaData) const = 0;
/**
* @param readOnly set read-only mode
......
......@@ -17,18 +17,18 @@
Boston, MA 02110-1301, USA.
*/
#ifndef AKONADI_CONTACTSPRIVATE_EXPORT_H
#define AKONADI_CONTACTSPRIVATE_EXPORT_H
#ifndef CONTACTEDITOR_PRIVATE_EXPORT_H
#define CONTACTEDITOR_PRIVATE_EXPORT_H
#include "akonadi-contact_export.h"
#include "contacteditor_export.h"
/* Classes which are exported only for unit tests */
#ifdef BUILD_TESTING
# ifndef AKONADI_CONTACTS_TESTS_EXPORT
# define AKONADI_CONTACTS_TESTS_EXPORT AKONADI_CONTACT_EXPORT
# ifndef CONTACTEDITOR_TESTS_EXPORT
# define CONTACTEDITOR_TESTS_EXPORT CONTACTEDITOR_EXPORT
# endif
#else /* not compiling tests */
# define AKONADI_CONTACTS_TESTS_EXPORT
# define CONTACTEDITOR_TESTS_EXPORT
#endif
#endif
......
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......@@ -29,7 +29,7 @@ namespace KContacts
class Addressee;
}
namespace Akonadi
namespace ContactEditor
{
/**
......@@ -64,6 +64,6 @@ public:
}
Q_DECLARE_INTERFACE(Akonadi::ContactEditorPagePlugin, "org.freedesktop.Akonadi.ContactEditorPagePlugin/1.0")
Q_DECLARE_INTERFACE(ContactEditor::ContactEditorPagePlugin, "org.freedesktop.Akonadi.ContactEditorPagePlugin/1.0")
#endif
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2017 Laurent Montel <montel@kde.org>
......@@ -21,7 +21,7 @@
#include "contactmetadatabase_p.h"
using namespace Akonadi;
using namespace ContactEditor;
class Q_DECL_HIDDEN ContactMetaDataBase::Private
{
......
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2017 Laurent Montel <montel@kde.org>
......@@ -19,14 +19,14 @@
02110-1301, USA.
*/
#ifndef AKONADI_CONTACTMETADATABASE_P_H
#define AKONADI_CONTACTMETADATABASE_P_H
#ifndef CONTACTEDITOR_CONTACTMETADATABASE_P_H
#define CONTACTEDITOR_CONTACTMETADATABASE_P_H
#include "contacteditor_export.h"
#include <QStringList>
#include <QVariant>
namespace Akonadi
namespace ContactEditor
{
......
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of Akonadi Contact.
This file is part of Contact Editor.
Copyright (C) 2016 eyeOS S.L.U., a Telefonica company, sales@eyeos.com
Copyright (C) 2016-2017 Laurent Montel <laurent.montel@kdab.com>
......@@ -26,7 +26,7 @@