Commit e056fe7d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove unused code

parent 9f2e2d1e
set(kaddressbook_akonadi_SRCS akonadicontactgrouprepository.cpp akonadicontactrepository.cpp)
add_library(kaddressbookdomainakonadi ${kaddressbook_akonadi_SRCS})
generate_export_header(kaddressbookdomainakonadi BASE_NAME kaddressbookdomainakonadi)
target_link_libraries(kaddressbookdomainakonadi
PUBLIC
KF5::Contacts
PRIVATE
Qt5::Core
kaddressbookdomain
)
set_target_properties(kaddressbookdomainakonadi
PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION}
)
install(TARGETS kaddressbookdomainakonadi ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
#add_subdirectory(autotests)
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "akonadicontactgrouprepository.h"
AkonadiContactGroupRepository::AkonadiContactGroupRepository()
: Domain::ContactGroupRepository()
{
}
AkonadiContactGroupRepository::~AkonadiContactGroupRepository()
{
}
KJob *AkonadiContactGroupRepository::createContactGroup(Domain::ContactGroup *contactGroup)
{
Q_UNUSED(contactGroup);
return {};
}
KJob *AkonadiContactGroupRepository::removeContactGroup(Domain::ContactGroup *contactGroup)
{
Q_UNUSED(contactGroup);
return {};
}
KJob *AkonadiContactGroupRepository::updateContactGroup(Domain::ContactGroup *contactGroup)
{
Q_UNUSED(contactGroup);
return {};
}
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef AKONADICONTACTGROUPREPOSITORY_H
#define AKONADICONTACTGROUPREPOSITORY_H
#include "contactgrouprepository.h"
#include <QObject>
namespace Domain {
class ContactGroup;
}
class KJob;
class AkonadiContactGroupRepository : public QObject, public Domain::ContactGroupRepository
{
Q_OBJECT
public:
AkonadiContactGroupRepository();
~AkonadiContactGroupRepository();
KJob *createContactGroup(Domain::ContactGroup *contactGroup) override;
KJob *removeContactGroup(Domain::ContactGroup *contactGroup) override;
KJob *updateContactGroup(Domain::ContactGroup *contactGroup) override;
};
#endif // AKONADICONTACTGROUPREPOSITORY_H
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "akonadicontactrepository.h"
AkonadiContactRepository::AkonadiContactRepository()
{
}
AkonadiContactRepository::~AkonadiContactRepository()
{
}
KJob *AkonadiContactRepository::createContact(Domain::Contact *contact)
{
Q_UNUSED(contact);
return {};
}
KJob *AkonadiContactRepository::removeContact(Domain::Contact *contact)
{
Q_UNUSED(contact);
return {};
}
KJob *AkonadiContactRepository::updateContact(Domain::Contact *contact)
{
Q_UNUSED(contact);
return {};
}
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef AKONADICONTACTREPOSITORY_H
#define AKONADICONTACTREPOSITORY_H
#include "contactrepository.h"
#include <QObject>
class AkonadiContactRepository : public QObject, public Domain::ContactRepository
{
Q_OBJECT
public:
AkonadiContactRepository();
~AkonadiContactRepository() override;
KJob *createContact(Domain::Contact *contact) override;
KJob *removeContact(Domain::Contact *contact) override;
KJob *updateContact(Domain::Contact *contact) override;
};
#endif // AKONADICONTACTREPOSITORY_H
set(kaddressbook_domain_SRCS contactgroup.cpp contact.cpp contactrepository.cpp contactgrouprepository.cpp)
add_library(kaddressbookdomain ${kaddressbook_domain_SRCS})
generate_export_header(kaddressbookdomain BASE_NAME kaddressbookdomain)
target_link_libraries(kaddressbookdomain
PUBLIC
KF5::Contacts
PRIVATE
Qt5::Core
)
set_target_properties(kaddressbookdomain
PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION}
)
install(TARGETS kaddressbookdomain ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()
set( kaddressbook_domain_contactgroup_SRCS contactgrouptest.cpp )
add_executable( kaddressbookdomaincontactgrouptest ${kaddressbook_domain_contactgroup_SRCS} )
add_test( NAME kaddressbookdomaincontactgrouptest COMMAND kaddressbookdomaincontactgrouptest )
ecm_mark_as_test(kaddressbookdomaincontactgrouptest)
target_link_libraries( kaddressbookdomaincontactgrouptest Qt5::Test kaddressbookdomain)
set( kaddressbook_domain_contact_SRCS contacttest.cpp )
add_executable( kaddressbookdomaincontacttest ${kaddressbook_domain_contact_SRCS} )
add_test( NAME kaddressbookdomaincontacttest COMMAND kaddressbookdomaincontacttest )
ecm_mark_as_test(kaddressbookdomaincontacttest)
target_link_libraries( kaddressbookdomaincontacttest Qt5::Test kaddressbookdomain)
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "contactgrouptest.h"
#include "../contactgroup.h"
#include <QTest>
ContactGroupTest::ContactGroupTest(QObject *parent)
: QObject(parent)
{
}
ContactGroupTest::~ContactGroupTest()
{
}
void ContactGroupTest::shouldHaveDefaultValue()
{
Domain::ContactGroup grp;
QVERIFY(grp.groupName().isEmpty());
}
void ContactGroupTest::shouldAssignGroupName()
{
Domain::ContactGroup grp;
const QString grpname(QStringLiteral("foo"));
grp.setGroupName(grpname);
QCOMPARE(grp.groupName(), grpname);
}
QTEST_MAIN(ContactGroupTest)
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CONTACTGROUPTEST_H
#define CONTACTGROUPTEST_H
#include <QObject>
class ContactGroupTest : public QObject
{
Q_OBJECT
public:
explicit ContactGroupTest(QObject *parent = nullptr);
~ContactGroupTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldAssignGroupName();
};
#endif // CONTACTGROUPTEST_H
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "contacttest.h"
#include "../contact.h"
#include <QTest>
ContactTest::ContactTest(QObject *parent)
: QObject(parent)
{
}
ContactTest::~ContactTest()
{
}
void ContactTest::shouldHaveDefaultValue()
{
Domain::Contact contact;
QVERIFY(contact.addressee().isEmpty());
}
void ContactTest::shouldAssignAddresse()
{
Domain::Contact contact;
KContacts::Addressee address;
address.setEmails(QStringList() << QStringLiteral("foo@foo.foo") << QStringLiteral("foo@foo.foo2"));
contact.setAddressee(address);
QCOMPARE(contact.addressee(), address);
}
QTEST_MAIN(ContactTest)
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CONTACTTEST_H
#define CONTACTTEST_H
#include <QObject>
class ContactTest : public QObject
{
Q_OBJECT
public:
explicit ContactTest(QObject *parent = nullptr);
~ContactTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldAssignAddresse();
};
#endif // CONTACTTEST_H
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "contact.h"
using namespace Domain;
Contact::Contact()
{
}
Contact::~Contact()
{
}
KContacts::Addressee Contact::addressee() const
{
return mAddressee;
}
void Contact::setAddressee(const KContacts::Addressee &address)
{
mAddressee = address;
}
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CONTACT_H
#define CONTACT_H
#include <KContacts/Addressee>
#include "kaddressbookdomain_export.h"
namespace Domain {
class KADDRESSBOOKDOMAIN_EXPORT Contact
{
public:
Contact();
~Contact();
KContacts::Addressee addressee() const;
void setAddressee(const KContacts::Addressee &address);
private:
KContacts::Addressee mAddressee;
};
}
#endif // CONTACT_H
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "contactgroup.h"
using namespace Domain;
ContactGroup::ContactGroup()
{
}
ContactGroup::~ContactGroup()
{
}
QString ContactGroup::groupName() const
{
return mGroupName;
}
void ContactGroup::setGroupName(const QString &groupName)
{
mGroupName = groupName;
}
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef DOMAINCONTACTGROUP_H
#define DOMAINCONTACTGROUP_H
#include <QString>
#include "kaddressbookdomain_export.h"
namespace Domain {
class KADDRESSBOOKDOMAIN_EXPORT ContactGroup
{
public:
ContactGroup();
~ContactGroup();
QString groupName() const;
void setGroupName(const QString &groupName);
private:
QString mGroupName;
};
}
#endif // DOMAINCONTACTGROUP_H
/*
This file is part of KAddressBook.
Copyright (C) 2016-2020 Laurent Montel <montel@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "contactgrouprepository.h"
using namespace Domain;
ContactGroupRepository::ContactGroupRepository()
{
}
ContactGroupRepository::~ContactGroupRepository()
{
}
/*
This file is part of KAddressBook.