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

Disable akonadi search on window (only use for debugging)

parent 656796db
Pipeline #162539 failed with stage
in 1 minute and 5 seconds
......@@ -76,7 +76,18 @@ find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
if (UNIX)
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
else()
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG)
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://invent.kde.org/pim/akonadi-search"
TYPE OPTIONAL PURPOSE "Provides search capabilities in KAddressbook and Akonadi (only debug)")
endif()
if (NOT KF5AkonadiSearch_FOUND)
add_definitions(-DFORCE_DISABLE_AKONADI_SEARCH)
endif()
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -117,7 +117,6 @@ target_link_libraries(kaddressbookprivate
KF5::JobWidgets
KF5::KIOWidgets
Qt${QT_MAJOR_VERSION}::PrintSupport
KF5::AkonadiSearchDebug
KF5::I18n
KF5::Prison
)
......@@ -125,6 +124,12 @@ if (TARGET KUserFeedbackWidgets)
target_link_libraries(kaddressbookprivate PRIVATE KUserFeedbackWidgets)
endif()
if (KF5AkonadiSearch_FOUND)
target_link_libraries(kaddressbookprivate
PRIVATE
KF5::AkonadiSearchDebug)
endif()
target_include_directories(kaddressbookprivate PUBLIC "$<BUILD_INTERFACE:${kaddressbook_SOURCE_DIR};${kaddressbook_BINARY_DIR}>")
set_target_properties(kaddressbookprivate PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION})
......
......@@ -45,7 +45,9 @@
#include <Akonadi/EntityMimeTypeFilterModel>
#include <Akonadi/EntityTreeView>
#include <Akonadi/MimeTypeChecker>
#ifndef FORCE_DISABLE_AKONADI_SEARCH
#include <Debug/akonadisearchdebugdialog.h>
#endif
#include <KContacts/Addressee>
#include <PimCommon/PimUtil>
#include <PimCommonAkonadi/ManageServerSideSubscriptionJob>
......@@ -693,14 +695,14 @@ void MainWidget::setupActions(KActionCollection *collection)
collection->addAction(QStringLiteral("focus_to_quickseach"), mQuickSearchAction);
connect(mQuickSearchAction, &QAction::triggered, mQuickSearchWidget, &QuickSearchWidget::slotFocusQuickSearch);
collection->setDefaultShortcut(mQuickSearchAction, QKeySequence(Qt::ALT | Qt::Key_Q));
#ifndef FORCE_DISABLE_AKONADI_SEARCH
if (!qEnvironmentVariableIsEmpty("KDEPIM_DEBUGGING")) {
action = collection->addAction(QStringLiteral("debug_akonadi_search"));
// Don't translate it. It's just for debug
action->setText(QStringLiteral("Debug Akonadi Search..."));
connect(action, &QAction::triggered, this, &MainWidget::slotDebugAkonadiSearch);
}
#endif
mServerSideSubscription = new QAction(QIcon::fromTheme(QStringLiteral("folder-bookmarks")), i18n("Serverside Subscription..."), this);
collection->addAction(QStringLiteral("serverside_subscription"), mServerSideSubscription);
connect(mServerSideSubscription, &QAction::triggered, this, &MainWidget::slotServerSideSubscription);
......@@ -1015,6 +1017,7 @@ const Akonadi::Item::List MainWidget::collectSelectedAllContactsItem()
void MainWidget::slotDebugAkonadiSearch()
{
#ifndef FORCE_DISABLE_AKONADI_SEARCH
const Akonadi::Item::List lst = collectSelectedAllContactsItem(mItemView->selectionModel());
if (lst.isEmpty()) {
return;
......@@ -1025,6 +1028,7 @@ void MainWidget::slotDebugAkonadiSearch()
dlg->setSearchType(Akonadi::Search::AkonadiSearchDebugSearchPathComboBox::Contacts);
dlg->doSearch();
dlg->show();
#endif
}
const Akonadi::Item::List MainWidget::collectSelectedAllContactsItem(QItemSelectionModel *model)
......
Supports Markdown
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