Hello community, here is the log from the commit of package baloo for openSUSE:Factory checked in at 2014-06-19 13:14:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/baloo (Old) and /work/SRC/openSUSE:Factory/.baloo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "baloo" Changes: -------- --- /work/SRC/openSUSE:Factory/baloo/baloo.changes 2014-05-26 14:40:27.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.baloo.new/baloo.changes 2014-06-19 13:15:03.000000000 +0200 @@ -1,0 +2,7 @@ +Sun Jun 8 18:27:41 UTC 2014 - [email protected] + +- Update to 4.13.2 + * KDE 4.13 release + * See http://www.kde.org/announcements/announce-4.13.2.php + +------------------------------------------------------------------- Old: ---- baloo-4.13.1.tar.xz New: ---- baloo-4.13.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ baloo.spec ++++++ --- /var/tmp/diff_new_pack.Hkt1FM/_old 2014-06-19 13:15:04.000000000 +0200 +++ /var/tmp/diff_new_pack.Hkt1FM/_new 2014-06-19 13:15:04.000000000 +0200 @@ -17,7 +17,7 @@ Name: baloo -Version: 4.13.1 +Version: 4.13.2 Release: 0 Summary: Framework for searching and managing metadata License: GPL-2.0+ and LGPL-2.1+ @@ -199,6 +199,8 @@ %{_kde4_modulesdir}/baloo_emailsearchstore.so %{_kde4_servicesdir}/baloo_notesearchstore.desktop %{_kde4_modulesdir}/baloo_notesearchstore.so +%{_kde4_modulesdir}/baloo_calendarsearchstore.so +%{_kde4_servicesdir}/baloo_calendarsearchstore.desktop %{_kde4_modulesdir}/akonadi/ %files tools ++++++ baloo-4.13.1.tar.xz -> baloo-4.13.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/CMakeLists.txt new/baloo-4.13.2/CMakeLists.txt --- old/baloo-4.13.1/CMakeLists.txt 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/CMakeLists.txt 2014-06-04 09:50:08.000000000 +0200 @@ -2,7 +2,7 @@ set(BALOO_VERSION_MAJOR 4) set(BALOO_VERSION_MINOR 13) -set(BALOO_VERSION_RELEASE 1) +set(BALOO_VERSION_RELEASE 2) set(BALOO_VERSION "${BALOO_VERSION_MAJOR}.${BALOO_VERSION_MINOR}.${BALOO_VERSION_RELEASE}") @@ -39,7 +39,7 @@ TYPE REQUIRED ) -find_package(Akonadi 1.11.42 CONFIG) +find_package(Akonadi 1.12.1 CONFIG) set_package_properties(Akonadi PROPERTIES URL "http://akonadi-project.org" TYPE REQUIRED diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/file/baloo_file.desktop new/baloo-4.13.2/src/file/baloo_file.desktop --- old/baloo-4.13.1/src/file/baloo_file.desktop 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/file/baloo_file.desktop 2014-06-04 09:50:08.000000000 +0200 @@ -16,6 +16,7 @@ Name[de]=Baloo-Dateidienst Name[el]=Δαίμονας αρχείων Baloo Name[es]=Demonio del archivo Baloo +Name[et]=Baloo failideemon Name[fi]=Baloo-tiedostopalvelu Name[fr]=Démon de fichier Baloo Name[hu]=Baloo fájl démon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/file/inotify/org.kde.baloo.filewatch.actions new/baloo-4.13.2/src/file/inotify/org.kde.baloo.filewatch.actions --- old/baloo-4.13.1/src/file/inotify/org.kde.baloo.filewatch.actions 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/file/inotify/org.kde.baloo.filewatch.actions 2014-06-04 09:50:08.000000000 +0200 @@ -8,6 +8,7 @@ Name[de]=Begrenzung für Ordnerüberwachung Name[el]=Όριο παρακολούθησης φακέλων Name[es]=Límite de vigilancia de carpetas +Name[et]=Kataloogi jälgimise limiit Name[fi]=Kansioiden valvontaraja Name[fr]=Limite de surveillance des dossiers Name[hu]=Mappafigyelési korlát @@ -43,6 +44,7 @@ Description[de]=Damit Sie keine Dateiänderungen verpassen, setzen Sie die Begrenzung für Ordnerüberwachung durch inotify nach oben Description[el]=Για να αποφύγετε την παράβλεψη αλλαγών των αρχείων, αυξήστε το όριο παρακολούθησης φακέλων inotify Description[es]=Para evitar pérdidas en cambios de archivos, eleve el límite de vigilancia de carpetas inotify +Description[et]=Puuduvate failimuutuste vältimiseks tõsta inotify kataloogi jälgimise limiiti Description[fi]=Nosta inotifyn kansioiden valvontarajaa välttääksesi sitä, että joitain tiedostomuutoksia ei huomata Description[fr]=Pour éviter des changements de fichiers manquant, augmentez la limite de surveillance des dossiers Description[hu]=A fájlváltoztatások hiányzásának elkerülése érdekében növelje a értesítő mappafigyelési korlátot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/file/kcm/kcm_baloofile.desktop new/baloo-4.13.2/src/file/kcm/kcm_baloofile.desktop --- old/baloo-4.13.1/src/file/kcm/kcm_baloofile.desktop 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/file/kcm/kcm_baloofile.desktop 2014-06-04 09:50:08.000000000 +0200 @@ -18,6 +18,7 @@ Name[de]=Desktop-Suche Name[el]=Αναζήτηση στην επιφάνεια εργασίας Name[es]=Búsqueda de escritorio +Name[et]=Töölauaotsing Name[fi]=Työpöytähaku Name[fr]=Recherche sur le bureau Name[hu]=Asztali keresés @@ -53,6 +54,7 @@ Comment[de]=Desktop-Suche einrichten Comment[el]=Διαμόρφωση αναζήτησης επιφάνειας εργασίας Comment[es]=Configurar la búsqueda de escritorio +Comment[et]=Töölauaotsingu seadistamine Comment[fi]=Työpöytähaun asetukset Comment[fr]=Configurer la recherche sur le bureau Comment[hu]=Asztali keresés beállítása @@ -87,6 +89,7 @@ X-KDE-Keywords[de]=Suchen, Datei, Baloo X-KDE-Keywords[el]=Αναζήτηση, Αρχείο, Baloo X-KDE-Keywords[es]=Buscar, archivo, Baloo +X-KDE-Keywords[et]=Otsing, Fail, Baloo X-KDE-Keywords[fi]=Search, File, haku, tiedosto, Baloo X-KDE-Keywords[fr]=Recherche, fichier, Baloo X-KDE-Keywords[hu]=Keresés, Fájl, Baloo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/file/lib/baloo_xattr_p.h new/baloo-4.13.2/src/file/lib/baloo_xattr_p.h --- old/baloo-4.13.1/src/file/lib/baloo_xattr_p.h 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/file/lib/baloo_xattr_p.h 2014-06-04 09:50:08.000000000 +0200 @@ -25,7 +25,7 @@ #include <QFile> #include <QString> -#if defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) || defined(__GLIBC__) #include <sys/types.h> #include <sys/xattr.h> #elif defined(Q_OS_MAC) @@ -45,13 +45,13 @@ const char* attributeName = n.constData(); // First get the size of the data we are going to get to reserve the right amount of space. -#if defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) || defined(__GLIBC__) const ssize_t size = getxattr(encodedPath, attributeName, NULL, 0); #elif defined(Q_OS_MAC) const ssize_t size = getxattr(encodedPath, attributeName, NULL, 0, 0, 0); #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) const ssize_t size = extattr_get_file(encodedPath, EXTATTR_NAMESPACE_USER, attributeName, NULL, 0); -#elif defined(Q_OS_WIN) +#else const ssize_t size = 0; #endif @@ -64,13 +64,13 @@ QByteArray data(size, Qt::Uninitialized); -#if defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) || defined(__GLIBC__) const ssize_t r = getxattr(encodedPath, attributeName, data.data(), size); #elif defined(Q_OS_MAC) const ssize_t r = getxattr(encodedPath, attributeName, data.data(), size, 0, 0); #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) const ssize_t r = extattr_get_file(encodedPath, EXTATTR_NAMESPACE_USER, attributeName, data.data(), size); -#elif defined(Q_OS_WIN) +#else const ssize_t r = 0; #endif @@ -91,14 +91,14 @@ const size_t valueSize = v.size(); -#if defined(Q_OS_LINUX) +#if defined(Q_OS_LINUX) || defined(__GLIBC__) return setxattr(encodedPath, attributeName, attributeValue, valueSize, 0); #elif defined(Q_OS_MAC) return setxattr(encodedPath, attributeName, attributeValue, valueSize, 0, 0); #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) const ssize_t count = extattr_set_file(encodedPath, EXTATTR_NAMESPACE_USER, attributeName, attributeValue, valueSize); return count == -1 ? -1 : 0; -#elif defined(Q_OS_WIN) +#else return -1; #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/agent/CMakeLists.txt new/baloo-4.13.2/src/pim/agent/CMakeLists.txt --- old/baloo-4.13.1/src/pim/agent/CMakeLists.txt 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/agent/CMakeLists.txt 2014-06-04 09:50:08.000000000 +0200 @@ -12,6 +12,7 @@ emailindexer.cpp contactindexer.cpp akonotesindexer.cpp + calendarindexer.cpp ../../file/priority.cpp ) @@ -28,6 +29,7 @@ ${KDEPIMLIBS_KABC_LIBS} ${XAPIAN_LIBRARIES} ${KDEPIMLIBS_KPIMUTILS_LIBS} + ${KDEPIMLIBS_KCALCORE_LIBS} balooxapian ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/agent/agent.cpp new/baloo-4.13.2/src/pim/agent/agent.cpp --- old/baloo-4.13.1/src/pim/agent/agent.cpp 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/agent/agent.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -25,6 +25,7 @@ #include "contactindexer.h" #include "emailindexer.h" #include "akonotesindexer.h" +#include "calendarindexer.h" #include "balooindexeradaptor.h" #include "src/file/priority.h" @@ -63,6 +64,9 @@ QString akonotesIndexingPath() { return dbPath("notes"); } + QString calendarIndexingPath() { + return dbPath("calendars"); + } } #define INDEXING_AGENT_VERSION 4 @@ -196,6 +200,16 @@ addIndexer(indexer); } catch (const Xapian::DatabaseError &e) { + delete indexer; + kError() << "Failed to create akonotes indexer:" << QString::fromStdString(e.get_msg()); + } + + try { + QDir().mkpath(calendarIndexingPath()); + indexer = new CalendarIndexer(calendarIndexingPath()); + addIndexer(indexer); + } + catch (const Xapian::DatabaseError &e) { delete indexer; kError() << "Failed to create akonotes indexer:" << QString::fromStdString(e.get_msg()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/agent/akonadibalooindexingagent.desktop new/baloo-4.13.2/src/pim/agent/akonadibalooindexingagent.desktop --- old/baloo-4.13.1/src/pim/agent/akonadibalooindexingagent.desktop 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/agent/akonadibalooindexingagent.desktop 2014-06-04 09:50:08.000000000 +0200 @@ -7,6 +7,7 @@ Name[de]=Akonadi-Indizierungsagent für Baloo Name[el]=Πράκτορας δεικτοδότησης Baloo Akonadi Name[es]=Agente de indexación Baloo de Akonadi +Name[et]=Akonadi Baloo indekseerimise agent Name[fi]=Akonadin Baloo-indeksointiagentti Name[fr]=Agent d'indexation Baloo de Akonadi Name[hu]=Akonadi Baloo indexelő ügynök diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/agent/calendarindexer.cpp new/baloo-4.13.2/src/pim/agent/calendarindexer.cpp --- old/baloo-4.13.1/src/pim/agent/calendarindexer.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/baloo-4.13.2/src/pim/agent/calendarindexer.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -0,0 +1,133 @@ +/* + * This file is part of the KDE Baloo Project + * Copyright (C) 2014 Laurent Montel <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include "calendarindexer.h" + +#include <QTextDocument> + + +CalendarIndexer::CalendarIndexer(const QString& path) + : AbstractIndexer(), m_termGen( 0 ) +{ + m_db = new Xapian::WritableDatabase(path.toUtf8().constData(), Xapian::DB_CREATE_OR_OPEN); +} + +CalendarIndexer::~CalendarIndexer() +{ + m_db->commit(); + delete m_db; +} + +QStringList CalendarIndexer::mimeTypes() const +{ + return QStringList() << QString::fromLatin1("application/x-vnd.akonadi.calendar.event") + << QString::fromLatin1("application/x-vnd.akonadi.calendar.todo") + << QString::fromLatin1("application/x-vnd.akonadi.calendar.journal") + << QString::fromLatin1("application/x-vnd.akonadi.calendar.freebusy"); +} + +void CalendarIndexer::index(const Akonadi::Item &item) +{ + if ( item.hasPayload<KCalCore::Event::Ptr>() ) { + indexEventItem( item, item.payload<KCalCore::Event::Ptr>() ); + } else if ( item.hasPayload<KCalCore::Journal::Ptr>() ) { + indexJournalItem( item, item.payload<KCalCore::Journal::Ptr>() ); + } else if ( item.hasPayload<KCalCore::Todo::Ptr>() ) { + indexTodoItem( item, item.payload<KCalCore::Todo::Ptr>() ); + } else { + return; + } +} + +void CalendarIndexer::commit() +{ + m_db->commit(); +} + +void CalendarIndexer::remove(const Akonadi::Item &item) +{ + try { + m_db->delete_document(item.id()); + } + catch (const Xapian::DocNotFoundError&) { + return; + } +} + +void CalendarIndexer::remove(const Akonadi::Collection& collection) +{ + try { + Xapian::Query query('C'+ QString::number(collection.id()).toStdString()); + Xapian::Enquire enquire(*m_db); + enquire.set_query(query); + + Xapian::MSet mset = enquire.get_mset(0, m_db->get_doccount()); + Xapian::MSetIterator end(mset.end()); + for (Xapian::MSetIterator it = mset.begin(); it != end; ++it) { + const qint64 id = *it; + remove(Akonadi::Item(id)); + } + } + catch (const Xapian::DocNotFoundError&) { + return; + } +} + +void CalendarIndexer::move(const Akonadi::Item::Id& itemId, + const Akonadi::Entity::Id& from, + const Akonadi::Entity::Id& to) +{ + Xapian::Document doc; + try { + doc = m_db->get_document(itemId); + } + catch (const Xapian::DocNotFoundError&) { + return; + } + + const QByteArray ft = 'C' + QByteArray::number(from); + const QByteArray tt = 'C' + QByteArray::number(to); + + doc.remove_term(ft.data()); + doc.add_boolean_term(tt.data()); + m_db->replace_document(doc.get_docid(), doc); +} + +void CalendarIndexer::indexEventItem(const Akonadi::Item &item, const KCalCore::Event::Ptr &event) +{ + //TODO +} + +void CalendarIndexer::indexJournalItem(const Akonadi::Item &item, const KCalCore::Journal::Ptr &journal) +{ + //TODO +} + +void CalendarIndexer::indexTodoItem(const Akonadi::Item &item, const KCalCore::Todo::Ptr &todo) +{ + //TODO +} + +void CalendarIndexer::updateIncidenceItem( const KCalCore::Incidence::Ptr &calInc ) +{ + //TODO +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/agent/calendarindexer.h new/baloo-4.13.2/src/pim/agent/calendarindexer.h --- old/baloo-4.13.1/src/pim/agent/calendarindexer.h 1970-01-01 01:00:00.000000000 +0100 +++ new/baloo-4.13.2/src/pim/agent/calendarindexer.h 2014-06-04 09:50:08.000000000 +0200 @@ -0,0 +1,65 @@ +/* + * This file is part of the KDE Baloo Project + * Copyright (C) 2014 Laurent Montel <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#ifndef CALENDARINDEXER_H +#define CALENDARINDEXER_H + +#include "abstractindexer.h" + +#include <Akonadi/Collection> +#include <Akonadi/Item> +#include <KCalCore/Journal> +#include <KCalCore/Event> +#include <KCalCore/Todo> + +#include <xapian.h> + +class CalendarIndexer : public AbstractIndexer +{ +public: + /** + * You must provide the path where the indexed information + * should be stored + */ + CalendarIndexer(const QString& path); + ~CalendarIndexer(); + + QStringList mimeTypes() const; + + void index(const Akonadi::Item &item); + void commit(); + + void remove(const Akonadi::Item &item); + void remove(const Akonadi::Collection &collection); + void move(const Akonadi::Item::Id &itemId, const Akonadi::Entity::Id &from, const Akonadi::Entity::Id &to); +private: + void indexEventItem(const Akonadi::Item &item, const KCalCore::Event::Ptr &event); + void indexJournalItem(const Akonadi::Item &item, const KCalCore::Journal::Ptr &journal); + void indexTodoItem(const Akonadi::Item &item, const KCalCore::Todo::Ptr &todo); + void updateIncidenceItem(const KCalCore::Incidence::Ptr &calInc); + + Xapian::WritableDatabase *m_db; + Xapian::Document *m_doc; + Xapian::TermGenerator *m_termGen; +}; + +#endif // CALENDARINDEXER_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/agent/contactindexer.cpp new/baloo-4.13.2/src/pim/agent/contactindexer.cpp --- old/baloo-4.13.1/src/pim/agent/contactindexer.cpp 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/agent/contactindexer.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -41,7 +41,7 @@ QStringList ContactIndexer::mimeTypes() const { - return QStringList() << KABC::Addressee::mimeType(); + return QStringList() << KABC::Addressee::mimeType() << KABC::ContactGroup::mimeType(); } bool ContactIndexer::indexContact(const Akonadi::Item& item) @@ -87,6 +87,12 @@ const Akonadi::Entity::Id colId = item.parentCollection().id(); doc.addBoolTerm(colId, "C"); + if (addresse.birthday().isValid()) { + const QString julianDay = QString::number(addresse.birthday().date().toJulianDay()); + doc.addValue(0, julianDay); + } + //TODO index anniversary ? + m_db->replaceDocument(item.id(), doc); return true; } @@ -106,13 +112,13 @@ doc.indexText(name); doc.indexText(name, "NA"); + // Parent collection Q_ASSERT_X(item.parentCollection().isValid(), "Baloo::ContactIndexer::index", "Item does not have a valid parent collection"); const Akonadi::Entity::Id colId = item.parentCollection().id(); doc.addBoolTerm(colId, "C"); - m_db->replaceDocument(item.id(), doc); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/akonadiplugin/akonadibaloosearchplugin.desktop new/baloo-4.13.2/src/pim/akonadiplugin/akonadibaloosearchplugin.desktop --- old/baloo-4.13.1/src/pim/akonadiplugin/akonadibaloosearchplugin.desktop 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/akonadiplugin/akonadibaloosearchplugin.desktop 2014-06-04 09:50:08.000000000 +0200 @@ -7,6 +7,7 @@ Name[de]=Akonadi-Suchmodul für Baloo Name[el]=Πράκτορας αναζήτησης Baloo Akonadi Name[es]=Agente de búsqueda Baloo de Akonadi +Name[et]=Akonadi Baloo otsingu plugin Name[fi]=Akonadin Baloo-hakuliitännäinen Name[fr]=Module de recherche Baloo pour Akonadi Name[hu]=Akonadi Baloo keresés bővítmény diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/akonadiplugin/autotests/searchplugintest.cpp new/baloo-4.13.2/src/pim/akonadiplugin/autotests/searchplugintest.cpp --- old/baloo-4.13.1/src/pim/akonadiplugin/autotests/searchplugintest.cpp 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/akonadiplugin/autotests/searchplugintest.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -318,6 +318,15 @@ item.setParentCollection(Akonadi::Collection(3)); contactIndexer.index(item); } + { + KABC::ContactGroup group; + group.setName("group3"); + Akonadi::Item item(KABC::ContactGroup::mimeType()); + item.setId(104); + item.setPayload(group); + item.setParentCollection(Akonadi::Collection(4)); + contactIndexer.index(item); + } //Note item @@ -523,14 +532,36 @@ } #endif { -#if 0 Akonadi::SearchQuery query; query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Name, "group1", Akonadi::SearchTerm::CondContains)); QList<qint64> collections; QSet<qint64> result = QSet<qint64>() << 103; QTest::newRow("contact group by name (group1)") << QString::fromLatin1(query.toJSON()) << collections << contactGroupMimeTypes << result; -#endif + } + { + Akonadi::SearchQuery query; + query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Name, "group2", Akonadi::SearchTerm::CondContains)); + + QList<qint64> collections; + QSet<qint64> result; + QTest::newRow("contact group by name (group2)") << QString::fromLatin1(query.toJSON()) << collections << contactGroupMimeTypes << result; + } + { + Akonadi::SearchQuery query; + query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Name, "group3", Akonadi::SearchTerm::CondContains)); + + QList<qint64> collections = QList<qint64>() << 4; + QSet<qint64> result = QSet<qint64>() << 104; + QTest::newRow("contact group by name (group3 in collection 4)") << QString::fromLatin1(query.toJSON()) << collections << contactGroupMimeTypes << result; + } + { + Akonadi::SearchQuery query; + query.addTerm(Akonadi::ContactSearchTerm(Akonadi::ContactSearchTerm::Name, "group3", Akonadi::SearchTerm::CondContains)); + + QList<qint64> collections = QList<qint64>() << 3; + QSet<qint64> result; + QTest::newRow("contact group by name (group3 in collection 3)") << QString::fromLatin1(query.toJSON()) << collections << contactGroupMimeTypes << result; } #if 0 //Doesn't work for the moment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/akonadiplugin/searchplugin.cpp new/baloo-4.13.2/src/pim/akonadiplugin/searchplugin.cpp --- old/baloo-4.13.1/src/pim/akonadiplugin/searchplugin.cpp 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/akonadiplugin/searchplugin.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -190,6 +190,34 @@ return Baloo::Term(); } +Baloo::Term recursiveCalendarTermMapping(const Akonadi::SearchTerm &term) +{ + if (!term.subTerms().isEmpty()) { + Baloo::Term t(mapRelation(term.relation())); + Q_FOREACH (const Akonadi::SearchTerm &subterm, term.subTerms()) { + const Baloo::Term newTerm = recursiveCalendarTermMapping(subterm); + if (newTerm.isValid()) { + t.addSubTerm(newTerm); + } + } + return t; + } else { + kDebug() << term.key() << term.value(); +#if 0 + const Akonadi::EmailSearchTerm::EmailSearchField field = Akonadi::EmailSearchTerm::fromKey(term.key()); + switch (field) { + case Akonadi::EmailSearchTerm::Subject: + return getTerm(term, "subject"); + case Akonadi::EmailSearchTerm::Body: + return getTerm(term, "body"); + default: + kWarning() << "unknown term " << term.key(); + } +#endif + } + return Baloo::Term(); +} + Baloo::Term recursiveNoteTermMapping(const Akonadi::SearchTerm &term) { if (!term.subTerms().isEmpty()) { @@ -268,16 +296,20 @@ kDebug() << "mail query"; query.setType("Email"); t = recursiveEmailTermMapping(term); - } else if (mimeTypes.contains(KABC::Addressee::mimeType())) { + } else if (mimeTypes.contains(KABC::Addressee::mimeType()) || mimeTypes.contains(KABC::ContactGroup::mimeType())) { query.setType("Contact"); t = recursiveContactTermMapping(term); } else if (mimeTypes.contains(QLatin1String("text/x-vnd.akonadi.note"))) { query.setType("Note"); t = recursiveNoteTermMapping(term); - } else if (mimeTypes.contains(KABC::ContactGroup::mimeType())) { - query.setType("ContactGroups"); - t = recursiveContactTermMapping(term); + } else if (mimeTypes.contains(QLatin1String("application/x-vnd.akonadi.calendar.event")) || + mimeTypes.contains(QLatin1String("application/x-vnd.akonadi.calendar.todo")) || + mimeTypes.contains(QLatin1String("application/x-vnd.akonadi.calendar.journal")) || + mimeTypes.contains(QLatin1String("application/x-vnd.akonadi.calendar.freebusy"))) { + query.setType("Calendar"); + t = recursiveCalendarTermMapping(term); } + if (t.subTerms().isEmpty()) { kWarning() << "no terms added"; return QSet<qint64>(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/search/CMakeLists.txt new/baloo-4.13.2/src/pim/search/CMakeLists.txt --- old/baloo-4.13.1/src/pim/search/CMakeLists.txt 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/search/CMakeLists.txt 2014-06-04 09:50:08.000000000 +0200 @@ -1,3 +1,4 @@ add_subdirectory(email) add_subdirectory(contact) add_subdirectory(note) +add_subdirectory(calendar) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/search/calendar/CMakeLists.txt new/baloo-4.13.2/src/pim/search/calendar/CMakeLists.txt --- old/baloo-4.13.1/src/pim/search/calendar/CMakeLists.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/baloo-4.13.2/src/pim/search/calendar/CMakeLists.txt 2014-06-04 09:50:08.000000000 +0200 @@ -0,0 +1,13 @@ +kde4_add_plugin(baloo_calendarsearchstore calendarsearchstore.cpp ../pimsearchstore.cpp) + +target_link_libraries(baloo_calendarsearchstore + ${QT_QTCORE_LIBRARY} + ${KDE4_KDECORE_LIBRARY} + ${KDEPIMLIBS_AKONADI_LIBS} + ${XAPIAN_LIBRARIES} + baloocore + balooxapian +) + +install(FILES baloo_calendarsearchstore.desktop DESTINATION ${SERVICES_INSTALL_DIR}) +install(TARGETS baloo_calendarsearchstore DESTINATION ${PLUGIN_INSTALL_DIR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/search/calendar/baloo_calendarsearchstore.desktop new/baloo-4.13.2/src/pim/search/calendar/baloo_calendarsearchstore.desktop --- old/baloo-4.13.1/src/pim/search/calendar/baloo_calendarsearchstore.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/baloo-4.13.2/src/pim/search/calendar/baloo_calendarsearchstore.desktop 2014-06-04 09:50:08.000000000 +0200 @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Service +X-KDE-ServiceTypes=BalooSearchStore +X-KDE-Library=baloo_calendarsearchstore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/search/calendar/calendarsearchstore.cpp new/baloo-4.13.2/src/pim/search/calendar/calendarsearchstore.cpp --- old/baloo-4.13.1/src/pim/search/calendar/calendarsearchstore.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/baloo-4.13.2/src/pim/search/calendar/calendarsearchstore.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -0,0 +1,43 @@ +/* + * This file is part of the KDE Baloo Project + * Copyright (C) 2014 Laurent Montel <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include "calendarsearchstore.h" + +#include <KStandardDirs> +#include <KDebug> + +using namespace Baloo; + +CalendarSearchStore::CalendarSearchStore(QObject* parent) + : PIMSearchStore(parent) +{ + m_prefix.insert("collection", "C"); + + setDbPath(findDatabase("calendars")); +} + +QStringList CalendarSearchStore::types() +{ + return QStringList() << "Akonadi" << "Calendar"; +} + +BALOO_EXPORT_SEARCHSTORE(Baloo::CalendarSearchStore, "baloo_calendarsearchstore") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/search/calendar/calendarsearchstore.h new/baloo-4.13.2/src/pim/search/calendar/calendarsearchstore.h --- old/baloo-4.13.1/src/pim/search/calendar/calendarsearchstore.h 1970-01-01 01:00:00.000000000 +0100 +++ new/baloo-4.13.2/src/pim/search/calendar/calendarsearchstore.h 2014-06-04 09:50:08.000000000 +0200 @@ -0,0 +1,41 @@ +/* + * This file is part of the KDE Baloo Project + * Copyright (C) 2014 Laurent Montel <[email protected]> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#ifndef BALOO_PIM_CALENDAR_SEARCHSTORE_H +#define BALOO_PIM_CALENDAR_SEARCHSTORE_H + +#include "../pimsearchstore.h" + +namespace Baloo { + +class CalendarSearchStore : public PIMSearchStore +{ + Q_OBJECT + Q_INTERFACES(Baloo::SearchStore) +public: + CalendarSearchStore(QObject* parent = 0); + + virtual QStringList types(); +}; + +} +#endif // BALOO_PIM_CALENDAR_SEARCHSTORE_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/pim/search/contact/contactsearchstore.cpp new/baloo-4.13.2/src/pim/search/contact/contactsearchstore.cpp --- old/baloo-4.13.1/src/pim/search/contact/contactsearchstore.cpp 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/pim/search/contact/contactsearchstore.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -35,6 +35,10 @@ m_prefix.insert("email", ""); // Email currently doesn't map to anything m_prefix.insert("collection", "C"); + + m_valueProperties.insert("birthday", 0); + m_valueProperties.insert("anniversary", 1); + setDbPath(findDatabase("contacts")); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/runner/plasma-runner-baloosearch.desktop new/baloo-4.13.2/src/runner/plasma-runner-baloosearch.desktop --- old/baloo-4.13.1/src/runner/plasma-runner-baloosearch.desktop 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/runner/plasma-runner-baloosearch.desktop 2014-06-04 09:50:08.000000000 +0200 @@ -8,6 +8,7 @@ Name[de]=Desktop-Suche Name[el]=Αναζήτηση στην επιφάνεια εργασίας Name[es]=Búsqueda de escritorio +Name[et]=Töölauaotsing Name[fi]=Työpöytähaku Name[fr]=Recherche sur le bureau Name[hu]=Asztali keresés @@ -43,6 +44,7 @@ Comment[de]=Runner, der Dateien, E-Mails und Kontakte durchsucht Comment[el]=Αναζήτηση για αρχεία, μηνύματα ηλ. ταχυδρομείου και επαφές Comment[es]=Lanzador con búsquedas en archivos, correo electrónico y contactos +Comment[et]=Käivitaja, mis otsib failides, e-kirjades ja kontaktides Comment[fi]=Suoritusohjelma, joka etsii tiedostoista, sähköposteista ja yhteystiedoista Comment[fr]=Lanceur de recherche dans les fichiers, courriels et contacts Comment[hu]=Futtató, amely fájlokban, e-mailekben és névjegyekben keres diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/tools/balooshow/main.cpp new/baloo-4.13.2/src/tools/balooshow/main.cpp --- old/baloo-4.13.1/src/tools/balooshow/main.cpp 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/tools/balooshow/main.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -71,8 +71,6 @@ if (args->count() == 0) KCmdLineArgs::usage(); - QTextStream err(stdout); - // // The Resource Uri // diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/baloo-4.13.1/src/xapian/xapiandatabase.cpp new/baloo-4.13.2/src/xapian/xapiandatabase.cpp --- old/baloo-4.13.1/src/xapian/xapiandatabase.cpp 2014-05-08 18:47:41.000000000 +0200 +++ new/baloo-4.13.2/src/xapian/xapiandatabase.cpp 2014-06-04 09:50:08.000000000 +0200 @@ -24,8 +24,10 @@ #include <QTimer> #include <QDir> +#ifdef __GNUC__ #include <malloc.h> #include <unistd.h> +#endif using namespace Baloo; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
