Commit 6521844b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Move addressline to libkdepimakonadi

parent 6e1af00d
cmake_minimum_required(VERSION 3.0)
set(PIM_VERSION "5.4.42")
set(PIM_VERSION "5.4.43")
project(libkdepim VERSION ${PIM_VERSION})
......@@ -106,9 +106,6 @@ install(FILES
add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(tests)
endif()
install( FILES libkdepim.categories libkdepim.renamecategories DESTINATION ${KDE_INSTALL_CONFDIR} )
......
......@@ -2,12 +2,10 @@
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
if(BUILD_TESTING)
add_subdirectory(addressline/blacklistbaloocompletion/autotests)
add_subdirectory(addressline/autotests/)
endif()
add_subdirectory(pics)
if (BUILD_TESTING)
add_subdirectory(tests)
endif()
########### next target ###############
......@@ -50,30 +48,6 @@ set(kdepim_misc_LIB_SRCS
misc/uistatesaver.cpp
)
set(kdepim_addressline_LIB_SRCS
addressline/completionorder/completionordereditor.cpp
addressline/completionorder/completionorderwidget.cpp
addressline/addresslineedit/addresseelineedit.cpp
addressline/addresslineedit/addresseelineedit_p.cpp
addressline/addresslineedit/addresseelineeditstatic.cpp
addressline/addresslineedit/kmailcompletion.cpp
addressline/addresslineedit/baloocompletionemail.cpp
addressline/completionconfiguredialog/completionconfiguredialog.cpp
addressline/recentaddress/recentaddressdialog.cpp
addressline/recentaddress/recentaddresswidget.cpp
addressline/recentaddress/recentaddresses.cpp
addressline/addresslineedit/addresseelineeditutil.cpp
)
set(kdepim_addressline_blacklist_baloo_LIB_SRCS
addressline/blacklistbaloocompletion/blacklistbalooemailcompletiondialog.cpp
addressline/blacklistbaloocompletion/blacklistbalooemaillist.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailsearchjob.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailutil.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailcompletionwidget.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailwarning.cpp
)
set(kdepim_multiplyingline_LIB_SRCS
multiplyingline/multiplyingline.cpp
multiplyingline/multiplyinglineeditor.cpp
......@@ -81,12 +55,10 @@ set(kdepim_multiplyingline_LIB_SRCS
)
set(kdepim_LIB_SRCS
${kdepim_addressline_blacklist_baloo_LIB_SRCS}
${kdepim_progresswidget_LIB_SRCS}
${kdepim_widgets_LIB_SRCS}
${kdepim_ldap_LIB_SRCS}
${kdepim_misc_LIB_SRCS}
${kdepim_addressline_LIB_SRCS}
${kdepim_multiplyingline_LIB_SRCS}
prefs/kprefsdialog.cpp
)
......@@ -209,46 +181,6 @@ ecm_generate_headers(libkdepim_Camelcasemultiline_HEADERS
)
ecm_generate_headers(libkdepim_Camelcaseaddressline_HEADERS
HEADER_NAMES
AddresseeLineEdit
REQUIRED_HEADERS libkdepim_addressline_HEADERS
PREFIX Libkdepim
RELATIVE addressline/addresslineedit/
)
ecm_generate_headers(libkdepim_Camelcaserecentaddress_HEADERS
HEADER_NAMES
RecentAddresses
REQUIRED_HEADERS libkdepim_recentaddress_HEADERS
PREFIX Libkdepim
RELATIVE addressline/recentaddress/
)
ecm_generate_headers(libkdepim_Camelcasecompletionorder_HEADERS
HEADER_NAMES
CompletionOrderEditor
REQUIRED_HEADERS libkdepim_completionorder_HEADERS
PREFIX Libkdepim
RELATIVE addressline/completionorder
)
ecm_generate_headers(libkdepim_Camelcasecompletionconfiguredialog_HEADERS
HEADER_NAMES
CompletionConfigureDialog
REQUIRED_HEADERS libkdepim_completionconfiguredialog_HEADERS
PREFIX Libkdepim
RELATIVE addressline/completionconfiguredialog/
)
ecm_generate_headers(libkdepim_Camelcaseblacklistbaloocompletion_HEADERS
HEADER_NAMES
BlackListBalooEmailCompletionDialog
REQUIRED_HEADERS libkdepim_blacklistbaloocompletion_HEADERS
PREFIX Libkdepim
RELATIVE addressline/blacklistbaloocompletion/
)
ecm_generate_pri_file(BASE_NAME Libkdepim
LIB_NAME KF5Libkdepim
DEPS "AkonadiCore AkonadiContact" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
......@@ -265,8 +197,6 @@ install(FILES
${libkdepim_Camelcasemisc_HEADERS}
${libkdepim_Camelcasepref_HEADERS}
${libkdepim_Camelcasemultiline_HEADERS}
${libkdepim_Camelcaseaddressline_HEADERS}
${libkdepim_Camelcaserecentaddress_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Libkdepim
COMPONENT Devel
)
......@@ -283,8 +213,6 @@ install(FILES
${libkdepim_widgets_HEADERS}
${libkdepim_pref_HEADERS}
${libkdepim_multiline_HEADERS}
${libkdepim_addressline_HEADERS}
${libkdepim_recentaddress_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libkdepim
COMPONENT Devel
)
......
[Global]
PluginName=KDEPimWidgets
[KPIM::AddresseeLineEdit]
ToolTip=Addressee Line Edit (KDE-PIM)
WhatsThis=A line edit which lets you select addressees from the addressbook
IncludeFile=Libkdepim/AddresseeLineEdit
Group=Input (KDE-PIM)
[KPIM::KCheckComboBox]
ToolTip=Combobox with checkable items (KDE-PIM)
WhatsThis=A combobox that allows the user to check the items in the drop down menu
......
......@@ -6,14 +6,6 @@ add_executable(testldapclient ${testldapclient_SRCS})
target_link_libraries(testldapclient KF5::Libkdepim KF5::I18n KF5::Completion KF5::Ldap)
########### next target ###############
set(testaddresseelineedit_SRCS testaddresseelineedit.cpp)
add_executable(testaddresseelineedit ${testaddresseelineedit_SRCS})
target_link_libraries(testaddresseelineedit KF5::Libkdepim KF5::I18n KF5::Completion)
########### next target ###############
set(testkcheckcomboboxtest_gui_SRCS kcheckcomboboxtest_gui.cpp)
......@@ -22,12 +14,6 @@ add_executable(kcheckcomboboxtest_gui ${testkcheckcomboboxtest_gui_SRCS})
target_link_libraries(kcheckcomboboxtest_gui KF5::Libkdepim KF5::I18n KF5::Completion)
########### next target ###############
set(testcompletionconfiguredialog_SRCS completionconfiguredialog_gui.cpp)
add_executable(completionconfiguredialog_gui ${testcompletionconfiguredialog_SRCS})
target_link_libraries(completionconfiguredialog_gui KF5::Libkdepim KF5::I18n KF5::Completion)
########### next target ###############
set(testldapsearchdialog_SRCS ldapsearchdialog_gui.cpp)
......
......@@ -4,6 +4,40 @@ add_definitions( -DQT_NO_CAST_TO_ASCII )
if(BUILD_TESTING)
add_subdirectory(tests)
add_subdirectory(addressline/blacklistbaloocompletion/autotests)
add_subdirectory(addressline/autotests/)
endif()
add_subdirectory(designer)
set(kdepim_addressline_LIB_SRCS
addressline/completionorder/completionordereditor.cpp
addressline/completionorder/completionorderwidget.cpp
addressline/addresslineedit/addresseelineedit.cpp
addressline/addresslineedit/addresseelineedit_p.cpp
addressline/addresslineedit/addresseelineeditstatic.cpp
addressline/addresslineedit/kmailcompletion.cpp
addressline/addresslineedit/baloocompletionemail.cpp
addressline/completionconfiguredialog/completionconfiguredialog.cpp
addressline/recentaddress/recentaddressdialog.cpp
addressline/recentaddress/recentaddresswidget.cpp
addressline/recentaddress/recentaddresses.cpp
addressline/addresslineedit/addresseelineeditutil.cpp
)
set(kdepim_addressline_blacklist_baloo_LIB_SRCS
addressline/blacklistbaloocompletion/blacklistbalooemailcompletiondialog.cpp
addressline/blacklistbaloocompletion/blacklistbalooemaillist.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailsearchjob.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailutil.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailcompletionwidget.cpp
addressline/blacklistbaloocompletion/blacklistbalooemailwarning.cpp
)
############ next target ###############
#set(kdepim_progresswidget_LIB_SRCS
# progresswidget/progressmanager.cpp
......@@ -34,6 +68,8 @@ set(kdepimakonadi_widgets_LIB_SRCS
set(kdepimakonadi_LIB_SRCS
${kdepim_job_LIB_SRCS}
${kdepimakonadi_widgets_LIB_SRCS}
${kdepim_addressline_LIB_SRCS}
${kdepim_addressline_blacklist_baloo_LIB_SRCS}
)
ecm_qt_declare_logging_category(kdepimakonadi_LIB_SRCS HEADER libkdepimakonadi_debug.h IDENTIFIER LIBKDEPIMAKONADI_LOG CATEGORY_NAME org.kde.pim.libkdepimakonadi)
......@@ -132,45 +168,45 @@ ecm_generate_headers(libkdepim_Camelcasejob_HEADERS
#)
#ecm_generate_headers(libkdepim_Camelcaseaddressline_HEADERS
# HEADER_NAMES
# AddresseeLineEdit
# REQUIRED_HEADERS libkdepim_addressline_HEADERS
# PREFIX Libkdepim
# RELATIVE addressline/addresslineedit/
#)
ecm_generate_headers(libkdepim_Camelcaseaddressline_HEADERS
HEADER_NAMES
AddresseeLineEdit
REQUIRED_HEADERS libkdepim_addressline_HEADERS
PREFIX Libkdepim
RELATIVE addressline/addresslineedit/
)
#ecm_generate_headers(libkdepim_Camelcaserecentaddress_HEADERS
# HEADER_NAMES
# RecentAddresses
# REQUIRED_HEADERS libkdepim_recentaddress_HEADERS
# PREFIX Libkdepim
# RELATIVE addressline/recentaddress/
#)
ecm_generate_headers(libkdepim_Camelcaserecentaddress_HEADERS
HEADER_NAMES
RecentAddresses
REQUIRED_HEADERS libkdepim_recentaddress_HEADERS
PREFIX Libkdepim
RELATIVE addressline/recentaddress/
)
#ecm_generate_headers(libkdepim_Camelcasecompletionorder_HEADERS
# HEADER_NAMES
# CompletionOrderEditor
# REQUIRED_HEADERS libkdepim_completionorder_HEADERS
# PREFIX Libkdepim
# RELATIVE addressline/completionorder
#)
ecm_generate_headers(libkdepim_Camelcasecompletionorder_HEADERS
HEADER_NAMES
CompletionOrderEditor
REQUIRED_HEADERS libkdepim_completionorder_HEADERS
PREFIX Libkdepim
RELATIVE addressline/completionorder
)
#ecm_generate_headers(libkdepim_Camelcasecompletionconfiguredialog_HEADERS
# HEADER_NAMES
# CompletionConfigureDialog
# REQUIRED_HEADERS libkdepim_completionconfiguredialog_HEADERS
# PREFIX Libkdepim
# RELATIVE addressline/completionconfiguredialog/
#)
ecm_generate_headers(libkdepim_Camelcasecompletionconfiguredialog_HEADERS
HEADER_NAMES
CompletionConfigureDialog
REQUIRED_HEADERS libkdepim_completionconfiguredialog_HEADERS
PREFIX Libkdepim
RELATIVE addressline/completionconfiguredialog/
)
#ecm_generate_headers(libkdepim_Camelcaseblacklistbaloocompletion_HEADERS
# HEADER_NAMES
# BlackListBalooEmailCompletionDialog
# REQUIRED_HEADERS libkdepim_blacklistbaloocompletion_HEADERS
# PREFIX Libkdepim
# RELATIVE addressline/blacklistbaloocompletion/
#)
ecm_generate_headers(libkdepim_Camelcaseblacklistbaloocompletion_HEADERS
HEADER_NAMES
BlackListBalooEmailCompletionDialog
REQUIRED_HEADERS libkdepim_blacklistbaloocompletion_HEADERS
PREFIX Libkdepim
RELATIVE addressline/blacklistbaloocompletion/
)
ecm_generate_pri_file(BASE_NAME LibkdepimAkonadi
LIB_NAME KF5LibkdepimAkonadi
......@@ -178,9 +214,9 @@ ecm_generate_pri_file(BASE_NAME LibkdepimAkonadi
)
install(FILES
# ${libkdepim_Camelcaseblacklistbaloocompletion_HEADERS}
# ${libkdepim_Camelcasecompletionconfiguredialog_HEADERS}
# ${libkdepim_Camelcasecompletionorder_HEADERS}
${libkdepim_Camelcaseblacklistbaloocompletion_HEADERS}
${libkdepim_Camelcasecompletionconfiguredialog_HEADERS}
${libkdepim_Camelcasecompletionorder_HEADERS}
# ${libkdepim_CamelcaseCamelCase_HEADERS}
${libkdepimakonadi_Camelcasewidgets_HEADERS}
# ${libkdepim_Camelcaseprogresswidget_HEADERS}
......@@ -188,16 +224,16 @@ install(FILES
${libkdepim_Camelcasejob_HEADERS}
# ${libkdepim_Camelcasepref_HEADERS}
# ${libkdepim_Camelcasemultiline_HEADERS}
# ${libkdepim_Camelcaseaddressline_HEADERS}
# ${libkdepim_Camelcaserecentaddress_HEADERS}
${libkdepim_Camelcaseaddressline_HEADERS}
${libkdepim_Camelcaserecentaddress_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/LibkdepimAkonadi
COMPONENT Devel
)
install(FILES
# ${libkdepim_blacklistbaloocompletion_HEADERS}
# ${libkdepim_completionconfiguredialog_HEADERS}
# ${libkdepim_completionorder_HEADERS}
${libkdepim_blacklistbaloocompletion_HEADERS}
${libkdepim_completionconfiguredialog_HEADERS}
${libkdepim_completionorder_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/kdepimakonadi_export.h
# ${libkdepim_CamelCase_HEADERS}
# ${libkdepim_progresswidget_HEADERS}
......@@ -206,8 +242,8 @@ install(FILES
${libkdepim_job_HEADERS}
# ${libkdepim_pref_HEADERS}
# ${libkdepim_multiline_HEADERS}
# ${libkdepim_addressline_HEADERS}
# ${libkdepim_recentaddress_HEADERS}
${libkdepim_addressline_HEADERS}
${libkdepim_recentaddress_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/libkdepimakonadi
COMPONENT Devel
)
......
......@@ -47,7 +47,7 @@
#include "libkdepim/recentaddresses.h"
#include <KCompletionBox>
#include "libkdepim_debug.h"
#include "libkdepimakonadi_debug.h"
#include <KLocalizedString>
#include <KStandardShortcut>
#include <KCodecs>
......@@ -761,7 +761,7 @@ bool KPIM::AddresseeLineEdit::eventFilter(QObject *object, QEvent *event)
return true;
}
if (keyEvent->key() == Qt::Key_Up) {
//qCDebug(LIBKDEPIM_LOG) <<"EVENTFILTER: Qt::Key_Up currentIndex=" << currentIndex;
//qCDebug(LIBKDEPIMAKONADI_LOG) <<"EVENTFILTER: Qt::Key_Up currentIndex=" << currentIndex;
// figure out if the item we would be moving to is one we want
// to ignore. If so, go one further
const QListWidgetItem *itemAbove = completionBox()->item(currentIndex);
......@@ -769,7 +769,7 @@ bool KPIM::AddresseeLineEdit::eventFilter(QObject *object, QEvent *event)
// there is a header above is, check if there is even further up
// and if so go one up, so it'll be selected
if (currentIndex > 0 && completionBox()->item(currentIndex - 1)) {
//qCDebug(LIBKDEPIM_LOG) <<"EVENTFILTER: Qt::Key_Up -> skipping" << currentIndex - 1;
//qCDebug(LIBKDEPIMAKONADI_LOG) <<"EVENTFILTER: Qt::Key_Up -> skipping" << currentIndex - 1;
completionBox()->setCurrentRow(currentIndex - 1);
completionBox()->item(currentIndex - 1)->setSelected(true);
} else if (currentIndex == 0) {
......@@ -791,11 +791,11 @@ bool KPIM::AddresseeLineEdit::eventFilter(QObject *object, QEvent *event)
}
} else if (keyEvent->key() == Qt::Key_Down) {
// same strategy for downwards
//qCDebug(LIBKDEPIM_LOG) <<"EVENTFILTER: Qt::Key_Down. currentIndex=" << currentIndex;
//qCDebug(LIBKDEPIMAKONADI_LOG) <<"EVENTFILTER: Qt::Key_Down. currentIndex=" << currentIndex;
const QListWidgetItem *itemBelow = completionBox()->item(currentIndex);
if (itemBelow && itemIsHeader(itemBelow)) {
if (completionBox()->item(currentIndex + 1)) {
//qCDebug(LIBKDEPIM_LOG) <<"EVENTFILTER: Qt::Key_Down -> skipping" << currentIndex+1;
//qCDebug(LIBKDEPIMAKONADI_LOG) <<"EVENTFILTER: Qt::Key_Down -> skipping" << currentIndex+1;
completionBox()->setCurrentRow(currentIndex + 1);
completionBox()->item(currentIndex + 1)->setSelected(true);
} else {
......
......@@ -27,7 +27,7 @@
#ifndef KDEPIM_ADDRESSEELINEEDIT_H
#define KDEPIM_ADDRESSEELINEEDIT_H
#include "kdepim_export.h"
#include "kdepimakonadi_export.h"
#include <KLineEdit>
......@@ -58,7 +58,7 @@ namespace KPIM
{
class AddresseeLineEditPrivate;
class KDEPIM_EXPORT AddresseeLineEdit : public KLineEdit
class KDEPIMAKONADI_EXPORT AddresseeLineEdit : public KLineEdit
{
Q_OBJECT
......
......@@ -20,7 +20,7 @@
#include "addresseelineedit_p.h"
#include "addresseelineedit.h"
#include "kmailcompletion.h"
#include "libkdepim_debug.h"
#include "libkdepimakonadi_debug.h"
#include "helper_p.h"
#include <QMap>
#include <QTimer>
......@@ -505,7 +505,7 @@ void AddresseeLineEditPrivate::startSearches()
void AddresseeLineEditPrivate::akonadiPerformSearch()
{
qCDebug(LIBKDEPIM_LOG) << "searching akonadi with:" << m_searchString;
qCDebug(LIBKDEPIMAKONADI_LOG) << "searching akonadi with:" << m_searchString;
// first, kill all job still in flight, they are no longer current
for (const QWeakPointer<Akonadi::Job> &job : qAsConst(s_static->akonadiJobsInFlight)) {
......@@ -541,7 +541,7 @@ void AddresseeLineEditPrivate::akonadiPerformSearch()
void AddresseeLineEditPrivate::akonadiHandlePending()
{
qCDebug(LIBKDEPIM_LOG) << "Pending items: " << s_static->akonadiPendingItems.size();
qCDebug(LIBKDEPIMAKONADI_LOG) << "Pending items: " << s_static->akonadiPendingItems.size();
Akonadi::Item::List::iterator it = s_static->akonadiPendingItems.begin();
while (it != s_static->akonadiPendingItems.end()) {
const Akonadi::Item item = *it;
......@@ -549,7 +549,7 @@ void AddresseeLineEditPrivate::akonadiHandlePending()
const AddresseeLineEditStatic::collectionInfo sourceIndex =
s_static->akonadiCollectionToCompletionSourceMap.value(item.parentCollection().id(), AddresseeLineEditStatic::collectionInfo());
if (sourceIndex.index >= 0) {
qCDebug(LIBKDEPIM_LOG) << "identified collection: " << s_static->completionSources[sourceIndex.index];
qCDebug(LIBKDEPIMAKONADI_LOG) << "identified collection: " << s_static->completionSources[sourceIndex.index];
if (sourceIndex.enabled) {
q->addItem(item, 1, sourceIndex.index);
}
......@@ -799,7 +799,7 @@ void AddresseeLineEditPrivate::slotAkonadiHandleItems(const Akonadi::Item::List
const AddresseeLineEditStatic::collectionInfo sourceIndex =
s_static->akonadiCollectionToCompletionSourceMap.value(item.parentCollection().id(), AddresseeLineEditStatic::collectionInfo());
if (sourceIndex.index == -1) {
qCDebug(LIBKDEPIM_LOG) << "Fetching New collection: " << item.parentCollection().id();
qCDebug(LIBKDEPIMAKONADI_LOG) << "Fetching New collection: " << item.parentCollection().id();
// the collection isn't there, start the fetch job.
Akonadi::CollectionFetchJob *collectionJob =
new Akonadi::CollectionFetchJob(item.parentCollection(),
......@@ -835,10 +835,10 @@ void AddresseeLineEditPrivate::slotAkonadiHandleItems(const Akonadi::Item::List
void AddresseeLineEditPrivate::slotAkonadiSearchResult(KJob *job)
{
if (job->error()) {
qCWarning(LIBKDEPIM_LOG) << "Akonadi search job failed: " << job->errorString();
qCWarning(LIBKDEPIMAKONADI_LOG) << "Akonadi search job failed: " << job->errorString();
} else {
Akonadi::ItemSearchJob *searchJob = static_cast<Akonadi::ItemSearchJob *>(job);
qCDebug(LIBKDEPIM_LOG) << "Found" << searchJob->items().size() << "items";
qCDebug(LIBKDEPIMAKONADI_LOG) << "Found" << searchJob->items().size() << "items";
}
const int index = s_static->akonadiJobsInFlight.indexOf(qobject_cast<Akonadi::Job *>(job));
if (index != -1) {
......@@ -860,7 +860,7 @@ void AddresseeLineEditPrivate::slotAkonadiCollectionsReceived(
AddresseeLineEditStatic::collectionInfo info;
info.index = index;
info.enabled = groupCompletionEnabled.readEntry(QString::number(collection.id()), true);
qCDebug(LIBKDEPIM_LOG) << "\treceived: " << sourceString << "index: " << index;
qCDebug(LIBKDEPIMAKONADI_LOG) << "\treceived: " << sourceString << "index: " << index;
s_static->akonadiCollectionToCompletionSourceMap.insert(collection.id(), info);
}
}
......
......@@ -21,7 +21,7 @@
#include "baloocompletionemail.h"
#include <QMap>
#include <KEmailAddress>
#include "libkdepim_debug.h"
#include "libkdepimakonadi_debug.h"
#include "helper_p.h"
using namespace KPIM;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment