diff --git a/akonadi/CMakeLists.txt b/akonadi/CMakeLists.txt index f439a0e25..984194630 100644 --- a/akonadi/CMakeLists.txt +++ b/akonadi/CMakeLists.txt @@ -1,283 +1,281 @@ project(akonadi-kde) add_definitions( -DKDE_DEFAULT_DEBUG_AREA=5250 ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" ) if(CMAKE_COMPILE_GCOV) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") endif(CMAKE_COMPILE_GCOV) if (KDE4_BUILD_TESTS) # only with this macro the AKONADI_TESTS_EXPORT macro will do something add_definitions(-DCOMPILING_TESTS) add_subdirectory( tests ) endif (KDE4_BUILD_TESTS) add_definitions( -DQT_NO_CAST_FROM_ASCII ) add_definitions( -DQT_NO_CAST_TO_ASCII ) add_subdirectory( kabc ) add_subdirectory( kmime ) add_subdirectory( contact ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_QTDBUS_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KDE4_INCLUDE_DIR} ${AKONADI_INCLUDE_DIR} ${AKONADI_INCLUDE_DIR}/akonadi/private ) # libakonadi-kde set( akonadikde_LIB_SRC entity.cpp # keep it at top to not break enable-final agentbase.cpp agentfilterproxymodel.cpp agentinstance.cpp agentinstancecreatejob.cpp agentinstancemodel.cpp agentinstancewidget.cpp agentmanager.cpp agenttype.cpp agenttypemodel.cpp agenttypewidget.cpp agenttypedialog.cpp asyncselectionhandler.cpp attribute.cpp attributefactory.cpp cachepolicy.cpp cachepolicypage.cpp changerecorder.cpp collection.cpp collectioncombobox.cpp collectioncopyjob.cpp collectioncreatejob.cpp collectiondeletejob.cpp collectiondialog.cpp collectionfilterproxymodel.cpp collectiongeneralpropertiespage.cpp collectionfetchjob.cpp collectionfetchscope.cpp collectionmodel.cpp collectionmodel_p.cpp collectionmodifyjob.cpp collectionmovejob.cpp collectionpathresolver.cpp collectionpropertiesdialog.cpp collectionpropertiespage.cpp collectionquotaattribute.cpp collectionrequester.cpp collectionrightsattribute.cpp collectionselectjob.cpp collectionstatistics.cpp collectionstatisticsdelegate.cpp collectionstatisticsjob.cpp collectionstatisticsmodel.cpp collectionsync.cpp collectionview.cpp dragdropmanager.cpp control.cpp entitycache.cpp entitydisplayattribute.cpp entityhiddenattribute.cpp entitylistview.cpp entitymimetypefiltermodel.cpp entityrightsfiltermodel.cpp entitytreemodel.cpp entitytreemodel_p.cpp entitytreeview.cpp entitytreeviewstatesaver.cpp erroroverlay.cpp exception.cpp favoritecollectionsmodel.cpp firstrun.cpp flatcollectionproxymodel.cpp item.cpp itemcreatejob.cpp itemcopyjob.cpp itemdeletejob.cpp itemfetchjob.cpp itemfetchscope.cpp itemmodel.cpp itemmonitor.cpp itemmovejob.cpp itemsearchjob.cpp itemserializer.cpp itemserializerplugin.cpp itemmodifyjob.cpp itemsync.cpp itemview.cpp job.cpp linkjob.cpp - filteractionjob.cpp mimetypechecker.cpp monitor.cpp monitor_p.cpp partfetcher.cpp pastehelper.cpp preprocessorbase.cpp preprocessorbase_p.cpp protocolhelper.cpp resourcebase.cpp resourcescheduler.cpp resourceselectjob.cpp resourcesynchronizationjob.cpp searchcreatejob.cpp selectionproxymodel.cpp selftestdialog.cpp session.cpp servermanager.cpp standardactionmanager.cpp statisticsproxymodel.cpp subscriptionjob.cpp subscriptionchangeproxymodel.cpp subscriptiondialog.cpp subscriptionmodel.cpp transactionjobs.cpp transactionsequence.cpp transportresourcebase.cpp unlinkjob.cpp # Temporary until ported to Qt-plugin framework pluginloader.cpp ) # DBus interfaces and adaptors set(akonadi_xml ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.NotificationManager.xml) set_source_files_properties(${akonadi_xml} PROPERTIES INCLUDE "notificationmessage_p.h") qt4_add_dbus_interface( akonadikde_LIB_SRC ${akonadi_xml} notificationmanagerinterface ) qt4_add_dbus_interfaces( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.AgentManager.xml ) qt4_add_dbus_interfaces( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Tracer.xml ) qt4_add_dbus_interfaces( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Resource.xml resourcebase.h Akonadi::ResourceBase ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Preprocessor.xml preprocessorbase_p.h Akonadi::PreprocessorBasePrivate ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Status.xml agentbase.h Akonadi::AgentBase ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml agentbase.h Akonadi::AgentBase ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC interfaces/org.freedesktop.Akonadi.Resource.Transport.xml transportresourcebase_p.h Akonadi::TransportResourceBasePrivate ) kde4_add_ui_files( akonadikde_LIB_SRC cachepolicypage.ui collectiongeneralpropertiespage.ui subscriptiondialog.ui controlprogressindicator.ui selftestdialog.ui ) kde4_add_library( akonadi-kde SHARED ${akonadikde_LIB_SRC} ) macro_ensure_version( "4.2.0" ${KDE_VERSION} KDE_IS_AT_LEAST_42 ) target_link_libraries( akonadi-kde ${KDE4_SOLID_LIBS} ${QT_QTNETWORK_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTSQL_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${AKONADI_COMMON_LIBRARIES} ) set( AKONADI_KDE_DEPS ${KDE4_KDEUI_LIBS} ${QT_QTDBUS_LIBRARY} ${QT_QTCORE_LIBRARY} ) if(${KDE_IS_AT_LEAST_42}) target_link_libraries( akonadi-kde LINK_INTERFACE_LIBRARIES ${AKONADI_KDE_DEPS}) else(${KDE_IS_AT_LEAST_42}) target_link_libraries( akonadi-kde ${AKONADI_KDE_DEPS}) endif(${KDE_IS_AT_LEAST_42}) set_target_properties( akonadi-kde PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) install( TARGETS akonadi-kde EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} ) ########### install files ############### install( FILES akonadi_export.h agentbase.h agentfilterproxymodel.h agentinstance.h agentinstancecreatejob.h agentinstancemodel.h agentinstancewidget.h agentmanager.h agenttype.h agenttypemodel.h agenttypewidget.h agenttypedialog.h attribute.h attributefactory.h cachepolicy.h changerecorder.h collection.h collectioncombobox.h collectioncopyjob.h collectioncreatejob.h collectiondeletejob.h collectiondialog.h collectionfilterproxymodel.h collectionfetchjob.h collectionfetchscope.h collectionmodel.h collectionmodifyjob.h collectionmovejob.h collectionpropertiesdialog.h collectionpropertiespage.h collectionquotaattribute.h collectionrequester.h collectionstatisticsdelegate.h collectionstatisticsmodel.h collectionstatistics.h collectionstatisticsjob.h collectionview.h control.h entity.h entitydisplayattribute.h entityhiddenattribute.h entitylistview.h entitymimetypefiltermodel.h entityrightsfiltermodel.h entitytreemodel.h entitytreeview.h entitytreeviewstatesaver.h exception.h favoritecollectionsmodel.h item.h itemcreatejob.h itemcopyjob.h itemdeletejob.h itemfetchjob.h itemfetchscope.h itemmodel.h itemmodifyjob.h itemmonitor.h itemmovejob.h itempayloadinternals_p.h itemsearchjob.h itemserializerplugin.h itemsync.h itemview.h job.h linkjob.h - filteractionjob.h mimetypechecker.h monitor.h partfetcher.h preprocessorbase.h qtest_akonadi.h resourcebase.h resourcesynchronizationjob.h searchcreatejob.h selectionproxymodel.h session.h servermanager.h standardactionmanager.h statisticsproxymodel.h transactionjobs.h transactionsequence.h transportresourcebase.h unlinkjob.h DESTINATION ${INCLUDE_INSTALL_DIR}/akonadi COMPONENT Devel ) install( FILES collectionpathresolver_p.h DESTINATION ${INCLUDE_INSTALL_DIR}/akonadi/private COMPONENT Devel ) install( FILES kcfg2dbus.xsl DESTINATION ${DATA_INSTALL_DIR}/akonadi-kde ) diff --git a/akonadi/tests/CMakeLists.txt b/akonadi/tests/CMakeLists.txt index 1966fa627..ac12b3a83 100644 --- a/akonadi/tests/CMakeLists.txt +++ b/akonadi/tests/CMakeLists.txt @@ -1,131 +1,130 @@ if(${EXECUTABLE_OUTPUT_PATH}) set( PREVIOUS_EXEC_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH} ) else(${EXECUTABLE_OUTPUT_PATH}) set( PREVIOUS_EXEC_OUTPUT_PATH . ) endif(${EXECUTABLE_OUTPUT_PATH}) set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" ) include_directories( ${CMAKE_SOURCE_DIR}/akonadi ${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../ ${Boost_INCLUDE_DIR} ${AKONADI_INCLUDE_DIR} ${AKONADI_INCLUDE_DIR}/akonadi/private ) # add testrunner (application for managing a self-contained test # environment) add_subdirectory(testrunner) # add benchmarker add_subdirectory(benchmarker) # convenience macro to add akonadi demo application macro(add_akonadi_demo _source) set(_test ${_source}) get_filename_component(_name ${_source} NAME_WE) kde4_add_executable(${_name} TEST ${_test}) target_link_libraries(${_name} akonadi-kde akonadi-kmime ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS}) endmacro(add_akonadi_demo) # convenience macro to add akonadi qtestlib unit-tests macro(add_akonadi_test _source) set(_test ${_source}) get_filename_component(_name ${_source} NAME_WE) kde4_add_unit_test(${_name} TESTNAME akonadi-${_name} ${_test} fakesession.cpp fakemonitor.cpp fakeserver.cpp akonadieventqueue.cpp modelspy.cpp) target_link_libraries(${_name} akonadi-kde akonadi-kmime ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ${AKONADI_COMMON_LIBRARIES}) endmacro(add_akonadi_test) # convenience macro to add akonadi testrunner unit-tests macro(add_akonadi_isolated_test _source) set(_test ${_source}) get_filename_component(_name ${_source} NAME_WE) kde4_add_executable(${_name} TEST ${_test}) target_link_libraries(${_name} akonadi-kde akonadi-kmime ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ${AKONADI_COMMON_LIBRARIES}) # based on kde4_add_unit_test if (WIN32) get_target_property( _loc ${_name} LOCATION ) set(_executable ${_loc}.bat) set(_testrunner ${PREVIOUS_EXEC_OUTPUT_PATH}/akonaditest.bat) else (WIN32) set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_name}) set(_testrunner ${PREVIOUS_EXEC_OUTPUT_PATH}/akonaditest) endif (WIN32) if (UNIX) set(_executable ${_executable}.shell) set(_testrunner ${_testrunner}.shell) endif (UNIX) add_test( akonadi-mysql-db-${_name} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config-mysql-db.xml ${_executable} ) add_test( akonadi-mysql-fs-${_name} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config-mysql-fs.xml ${_executable} ) #add_test( akonadi-postgresql-fs-${_name} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config-postgresql-fs.xml ${_executable} ) #add_test( akonadi-postgresql-fs-${_name} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config-postgresql-fs.xml ${_executable} ) #add_test( akonadi-sqlite-${_name} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config-sqlite.xml ${_executable} ) endmacro(add_akonadi_isolated_test) # demo applications add_akonadi_demo(itemdumper.cpp) add_akonadi_demo(subscriber.cpp) add_akonadi_demo(headfetcher.cpp) add_akonadi_demo(agentinstancewidgettest.cpp) add_akonadi_demo(agenttypewidgettest.cpp) add_akonadi_demo(pluginloadertest.cpp) add_akonadi_demo(selftester.cpp) kde4_add_executable( akonadi-firstrun TEST ../firstrun.cpp firstrunner.cpp ) target_link_libraries( akonadi-firstrun akonadi-kde ${KDE4_KDEUI_LIBS} ) # qtestlib unit tests add_akonadi_test(imapparsertest.cpp) add_akonadi_test(imapsettest.cpp) add_akonadi_test(itemhydratest.cpp) add_akonadi_test(itemtest.cpp) add_akonadi_test(itemserializertest.cpp) add_akonadi_test(mimetypecheckertest.cpp) add_akonadi_test(protocolhelpertest.cpp) add_akonadi_test(entitytreemodeltest.cpp) add_akonadi_test(collectionutilstest.cpp) add_akonadi_test(entitydisplayattributetest.cpp) # qtestlib tests that need non-exported stuff from akonadi-kde kde4_add_unit_test(resourceschedulertest TESTNAME akonadi-resourceschedulertest resourceschedulertest.cpp ../resourcescheduler.cpp) target_link_libraries(resourceschedulertest akonadi-kde ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ${AKONADI_COMMON_LIBRARIES}) # testrunner tests add_akonadi_isolated_test(testenvironmenttest.cpp) add_akonadi_isolated_test(autoincrementtest.cpp) add_akonadi_isolated_test(attributefactorytest.cpp) add_akonadi_isolated_test(collectionjobtest.cpp) add_akonadi_isolated_test(collectionpathresolvertest.cpp) add_akonadi_isolated_test(collectionattributetest.cpp) add_akonadi_isolated_test(itemfetchtest.cpp) add_akonadi_isolated_test(itemappendtest.cpp) add_akonadi_isolated_test(itemstoretest.cpp) add_akonadi_isolated_test(itemdeletetest.cpp) add_akonadi_isolated_test(entitycachetest.cpp) add_akonadi_isolated_test(monitortest.cpp) add_akonadi_isolated_test(searchjobtest.cpp) add_akonadi_isolated_test(changerecordertest.cpp) add_akonadi_isolated_test(resourcetest.cpp) add_akonadi_isolated_test(subscriptiontest.cpp) add_akonadi_isolated_test(transactiontest.cpp) -add_akonadi_isolated_test(filteractiontest.cpp) add_akonadi_isolated_test(itemcopytest.cpp) add_akonadi_isolated_test(itemmovetest.cpp) add_akonadi_isolated_test(collectioncopytest.cpp) add_akonadi_isolated_test(collectionmovetest.cpp) add_akonadi_isolated_test(collectionsynctest.cpp) add_akonadi_isolated_test(itemsynctest.cpp) add_akonadi_isolated_test(linktest.cpp) add_akonadi_isolated_test(cachetest.cpp) add_akonadi_isolated_test(servermanagertest.cpp) add_akonadi_isolated_test(collectioncreator.cpp) add_akonadi_isolated_test(itembenchmark.cpp) diff --git a/mailtransport/CMakeLists.txt b/mailtransport/CMakeLists.txt index 5ef26a845..860ceceda 100644 --- a/mailtransport/CMakeLists.txt +++ b/mailtransport/CMakeLists.txt @@ -1,102 +1,103 @@ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" ) include_directories( ${Boost_INCLUDE_DIR} ) add_subdirectory( kconf_update ) add_subdirectory( tests ) add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII") add_definitions( -DKDE_DEFAULT_DEBUG_AREA=5324 ) add_definitions( -DUSES_DEPRECATED_MAILTRANSPORT_API ) # for transportmanager set(mailtransport_lib_srcs transport.cpp transportmanager.cpp transporttype.cpp transportcombobox.cpp transportlistview.cpp transportmanagementwidget.cpp addtransportdialog.cpp transportconfigdialog.cpp transportconfigwidget.cpp sendmailconfigwidget.cpp smtpconfigwidget.cpp + filteractionjob.cpp transportjob.cpp resourcesendjob.cpp sendmailjob.cpp smtpjob.cpp precommandjob.cpp legacydecrypt.cpp socket.cpp servertest.cpp dispatcherinterface.cpp messagequeuejob.cpp outboxactions.cpp attributeregistrar.cpp dispatchmodeattribute.cpp errorattribute.cpp sentbehaviourattribute.cpp transportattribute.cpp ) kde4_add_ui_files(mailtransport_lib_srcs sendmailsettings.ui smtpsettings.ui addtransportdialog.ui transportmanagementwidget.ui ) kde4_add_kcfg_files(mailtransport_lib_srcs transportbase.kcfgc) kde4_add_library(mailtransport SHARED ${mailtransport_lib_srcs}) target_link_libraries(mailtransport ${KDE4_KIO_LIBS} akonadi-kde akonadi-kmime kmime ) set_target_properties(mailtransport PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) install(TARGETS mailtransport EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) install(FILES mailtransport.kcfg DESTINATION ${KCFG_INSTALL_DIR}) set(mailtransport_kcm_srcs configmodule.cpp) kde4_add_plugin(kcm_mailtransport ${mailtransport_kcm_srcs}) target_link_libraries(kcm_mailtransport ${KDE4_KDEUI_LIBS} mailtransport) install(TARGETS kcm_mailtransport DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES kcm_mailtransport.desktop DESTINATION ${SERVICES_INSTALL_DIR}) -install( FILES +install( FILES mailtransport_export.h transportjob.h resourcesendjob.h sendmailjob.h smtpjob.h precommandjob.h ${CMAKE_CURRENT_BINARY_DIR}/transportbase.h transport.h transportmanager.h transporttype.h servertest.h transportcombobox.h transportconfigdialog.h transportmanagementwidget.h dispatcherinterface.h messagequeuejob.h outboxactions.h dispatchmodeattribute.h errorattribute.h sentbehaviourattribute.h transportattribute.h DESTINATION ${INCLUDE_INSTALL_DIR}/mailtransport COMPONENT Devel) diff --git a/mailtransport/dispatcherinterface.cpp b/mailtransport/dispatcherinterface.cpp index a6293b368..952354273 100644 --- a/mailtransport/dispatcherinterface.cpp +++ b/mailtransport/dispatcherinterface.cpp @@ -1,118 +1,118 @@ /* Copyright (c) 2009 Constantin Berzan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "dispatcherinterface.h" #include "outboxactions.h" #include #include #include #include #include -#include +#include "filteractionjob.h" #include using namespace Akonadi; using namespace MailTransport; /** @internal */ class MailTransport::DispatcherInterfacePrivate { public: DispatcherInterfacePrivate(); ~DispatcherInterfacePrivate(); DispatcherInterface *instance; // slots void massModifyResult( KJob *job ); }; K_GLOBAL_STATIC( DispatcherInterfacePrivate, sInstance ) DispatcherInterfacePrivate::DispatcherInterfacePrivate() : instance( new DispatcherInterface( this ) ) { } DispatcherInterfacePrivate::~DispatcherInterfacePrivate() { delete instance; } void DispatcherInterfacePrivate::massModifyResult( KJob *job ) { // Nothing to do here, really. If the job fails, the user can retry it. if( job->error() ) { kDebug() << "failed" << job->errorString(); } else { kDebug() << "succeeded."; } } DispatcherInterface::DispatcherInterface( DispatcherInterfacePrivate *dd ) : QObject(), d( dd ) { } DispatcherInterface *DispatcherInterface::self() { return sInstance->instance; } AgentInstance DispatcherInterface::dispatcherInstance() const { AgentInstance a = AgentManager::self()->instance( QLatin1String( "akonadi_maildispatcher_agent" ) ); if( !a.isValid() ) { kWarning() << "Could not get MDA instance."; } return a; } void DispatcherInterface::dispatchManually() { Collection outbox = SpecialCollections::self()->defaultCollection( SpecialCollections::Outbox ); if( !outbox.isValid() ) { kError() << "Could not access Outbox."; return; } FilterActionJob *mjob = new FilterActionJob( outbox, new SendQueuedAction, this ); connect( mjob, SIGNAL(result(KJob*)), this, SLOT(massModifyResult(KJob*)) ); } void DispatcherInterface::retryDispatching() { Collection outbox = SpecialCollections::self()->defaultCollection( SpecialCollections::Outbox ); if( !outbox.isValid() ) { kError() << "Could not access Outbox."; return; } FilterActionJob *mjob = new FilterActionJob( outbox, new ClearErrorAction, this ); connect( mjob, SIGNAL(result(KJob*)), this, SLOT(massModifyResult(KJob*)) ); } #include "dispatcherinterface.moc" diff --git a/akonadi/filteractionjob.cpp b/mailtransport/filteractionjob.cpp similarity index 97% rename from akonadi/filteractionjob.cpp rename to mailtransport/filteractionjob.cpp index 0035da938..87003c72f 100644 --- a/akonadi/filteractionjob.cpp +++ b/mailtransport/filteractionjob.cpp @@ -1,141 +1,141 @@ /* Copyright (c) 2009 Constantin Berzan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "filteractionjob.h" -#include "collection.h" -#include "itemfetchjob.h" -#include "itemfetchscope.h" +#include +#include +#include #include using namespace Akonadi; class Akonadi::FilterActionJob::Private { public: Private( FilterActionJob *qq ) : q( qq ) , functor( 0 ) { } - + ~Private() { delete functor; } FilterActionJob *q; Collection collection; Item::List items; FilterAction *functor; ItemFetchScope fetchScope; // slots: void fetchResult( KJob *job ); void traverseItems(); }; void FilterActionJob::Private::fetchResult( KJob *job ) { if ( job->error() ) { // KCompositeJob takes care of errors. return; } ItemFetchJob *fjob = dynamic_cast( job ); Q_ASSERT( fjob ); Q_ASSERT( items.isEmpty() ); items = fjob->items(); traverseItems(); } void FilterActionJob::Private::traverseItems() { Q_ASSERT( functor ); kDebug() << "Traversing" << items.count() << "items."; foreach( const Item &item, items ) { if( functor->itemAccepted( item ) ) { q->addSubjob( functor->itemAction( item ) ); kDebug() << "Added subjob for item" << item.id(); } } if( q->subjobs().isEmpty() ) { kDebug() << "No subjobs; I am done."; q->emitResult(); } else { kDebug() << "Have subjobs; calling commit()."; q->commit(); } } FilterAction::~FilterAction() { } FilterActionJob::FilterActionJob( const Item &item, FilterAction *functor, QObject *parent ) : TransactionSequence( parent ) , d( new Private( this ) ) { d->functor = functor; d->items << item; } FilterActionJob::FilterActionJob( const Item::List &items, FilterAction *functor, QObject *parent ) : TransactionSequence( parent ) , d( new Private( this ) ) { d->functor = functor; d->items = items; } FilterActionJob::FilterActionJob( const Collection &collection, FilterAction *functor, QObject *parent ) : TransactionSequence( parent ) , d( new Private( this ) ) { d->functor = functor; Q_ASSERT( collection.isValid() ); d->collection = collection; } FilterActionJob::~FilterActionJob() { delete d; } void FilterActionJob::doStart() { if( d->collection.isValid() ) { kDebug() << "Fetching collection" << d->collection.id(); ItemFetchJob *fjob = new ItemFetchJob( d->collection, this ); Q_ASSERT( d->functor ); d->fetchScope = d->functor->fetchScope(); fjob->setFetchScope( d->fetchScope ); connect( fjob, SIGNAL(result(KJob*)), this, SLOT(fetchResult(KJob*)) ); } else { d->traverseItems(); } } #include "filteractionjob.moc" diff --git a/akonadi/filteractionjob.h b/mailtransport/filteractionjob.h similarity index 98% rename from akonadi/filteractionjob.h rename to mailtransport/filteractionjob.h index e6075100a..9ae3133eb 100644 --- a/akonadi/filteractionjob.h +++ b/mailtransport/filteractionjob.h @@ -1,176 +1,176 @@ /* Copyright (c) 2009 Constantin Berzan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef AKONADI_FILTERACTIONJOB_H #define AKONADI_FILTERACTIONJOB_H -#include "item.h" -#include "transactionsequence.h" +#include +#include namespace Akonadi { class Collection; class ItemFetchScope; class Job; /** * @short Base class for a filter/action for FilterActionJob. * * Abstract class defining an interface for a filter and an action for * FilterActionJob. The virtual methods must be implemented in subclasses. * * @code * class ClearErrorAction : public Akonadi::FilterAction * { * public: * // reimpl * virtual Akonadi::ItemFetchScope fetchScope() const * { * ItemFetchScope scope; * scope.fetchFullPayload( false ); * scope.fetchAttribute(); * return scope; * } * * virtual bool itemAccepted( const Akonadi::Item &item ) const * { * return item.hasAttribute(); * } * * virtual Akonadi::Job *itemAction( const Akonadi::Item &item ) const * { * Item cp = item; * cp.removeAttribute(); * return new ItemModifyJob( cp ); * } * }; * @endcode * * @see FilterActionJob * * @author Constantin Berzan * @since 4.4 */ class AKONADI_EXPORT FilterAction { public: /** * Destroys this filter action. * * A FilterActionJob will delete its FilterAction automatically. */ virtual ~FilterAction(); /** * Returns an ItemFetchScope to use if the FilterActionJob needs * to fetch the items from a collection. * * @note The items are not fetched unless FilterActionJob is * constructed with a Collection parameter. */ virtual Akonadi::ItemFetchScope fetchScope() const = 0; /** * Returns @c true if the @p item is accepted by the filter and should be * acted upon by the FilterActionJob. */ virtual bool itemAccepted( const Akonadi::Item &item ) const = 0; /** * Returns a job to act on the @p item. * The FilterActionJob will finish when all such jobs are finished. */ virtual Akonadi::Job *itemAction( const Akonadi::Item &item ) const = 0; }; /** * @short Job to filter and apply an action on a set of items. * * This jobs filters through a set of items, and applies an action to the * items which are accepted by the filter. The filter and action * are provided by a functor class derived from FilterAction. * * For example, a MarkAsRead action/filter may be used to mark all messages * in a folder as read. * * @code * FilterActionJob *mjob = new FilterActionJob( LocalFolders::self()->outbox(), * new ClearErrorAction, this ); * connect( mjob, SIGNAL( result( KJob* ) ), this, SLOT( massModifyResult( KJob* ) ) ); * @endcode * * @see FilterAction * * @author Constantin Berzan * @since 4.4 */ class AKONADI_EXPORT FilterActionJob : public TransactionSequence { Q_OBJECT public: /** * Creates a filter action job to act on a single item. * * @param item The item to act on. The item is not re-fetched. * @param functor The FilterAction to use. * @param parent The parent object. */ FilterActionJob( const Item &item, FilterAction *functor, QObject *parent = 0 ); /** * Creates a filter action job to act on a set of items. * * @param items The items to act on. The items are not re-fetched. * @param functor The FilterAction to use. * @param parent The parent object. */ FilterActionJob( const Item::List &items, FilterAction *functor, QObject *parent = 0 ); /** * Creates a filter action job to act on items in a collection. * * @param collection The collection to act on. * The items of the collection are fetched using functor->fetchScope(). * @param functor The FilterAction to use. * @param parent The parent object. */ FilterActionJob( const Collection &collection, FilterAction *functor, QObject *parent = 0 ); /** * Destroys the filter action job. */ ~FilterActionJob(); protected: /* reimpl */ virtual void doStart(); private: //@cond PRIVATE class Private; Private *const d; Q_PRIVATE_SLOT( d, void fetchResult( KJob* ) ) //@endcond }; } // namespace Akonadi #endif // AKONADI_FILTERACTIONJOB_H diff --git a/mailtransport/tests/CMakeLists.txt b/mailtransport/tests/CMakeLists.txt index f6d8ba545..222a7364f 100644 --- a/mailtransport/tests/CMakeLists.txt +++ b/mailtransport/tests/CMakeLists.txt @@ -1,63 +1,64 @@ set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) -macro(add_akonadi_isolated_test _source) +macro(add_akonadi_isolated_test _source _path) get_filename_component(_targetName ${_source} NAME_WE) set(_srcList ${_source} ) kde4_add_executable(${_targetName} TEST ${_srcList}) target_link_libraries(${_targetName} ${QT_QTTEST_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} akonadi-kde akonadi-kmime mailtransport kmime ${KDE4_KDECORE_LIBS} ) # based on kde4_add_unit_test if (WIN32) get_target_property( _loc ${_targetName} LOCATION ) set(_executable ${_loc}.bat) else (WIN32) set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_targetName}) endif (WIN32) if (UNIX) set(_executable ${_executable}.shell) endif (UNIX) find_program(_testrunner akonaditest) - add_test( mailtransport-${_targetName} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/unittestenv/config.xml ${_executable} ) + add_test( mailtransport-${_targetName} ${_testrunner} -c ${CMAKE_CURRENT_SOURCE_DIR}/${_path}/config.xml ${_executable} ) endmacro(add_akonadi_isolated_test) # Independent executables: set(tm_srcs transportmgr.cpp) kde4_add_executable(transportmgr TEST ${tm_srcs}) target_link_libraries(transportmgr ${KDE4_KDEUI_LIBS} mailtransport) set(queuer_srcs queuer.cpp) kde4_add_executable(queuer TEST ${queuer_srcs}) target_link_libraries(queuer ${KDE4_KDEUI_LIBS} mailtransport kmime akonadi-kde) set( sendqueued_srcs sendqueued.cpp ) kde4_add_executable( sendqueued TEST ${sendqueued_srcs} ) target_link_libraries( sendqueued ${KDE4_KDEUI_LIBS} mailtransport akonadi-kde akonadi-kmime) set( clearerror_srcs clearerror.cpp ) kde4_add_executable( clearerror TEST ${clearerror_srcs} ) target_link_libraries( clearerror ${KDE4_KDEUI_LIBS} mailtransport akonadi-kde akonadi-kmime) set( abort_srcs abort.cpp ) kde4_add_executable( abort TEST ${abort_srcs} ) target_link_libraries( abort ${KDE4_KDEUI_LIBS} mailtransport akonadi-kde) # Akonadi testrunner-based tests: -add_akonadi_isolated_test( attributetest.cpp ) -add_akonadi_isolated_test( messagequeuejobtest.cpp ) +add_akonadi_isolated_test( attributetest.cpp unittestenv ) +add_akonadi_isolated_test( messagequeuejobtest.cpp unittestenv ) +add_akonadi_isolated_test( filteractiontest.cpp unittestenv_akonadi ) diff --git a/mailtransport/tests/clearerror.cpp b/mailtransport/tests/clearerror.cpp index 424c914d6..8823676a0 100644 --- a/mailtransport/tests/clearerror.cpp +++ b/mailtransport/tests/clearerror.cpp @@ -1,85 +1,85 @@ /* Copyright (c) 2009 Constantin Berzan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "clearerror.h" #include #include #include #include #include #include -#include +#include #include #include #include using namespace Akonadi; using namespace MailTransport; Runner::Runner() { Control::start(); SpecialCollectionsRequestJob *rjob = new SpecialCollectionsRequestJob( this ); rjob->requestDefaultCollection( SpecialCollections::Outbox ); connect( rjob, SIGNAL(result(KJob*)), this, SLOT(checkFolders()) ); rjob->start(); } void Runner::checkFolders() { Collection outbox = SpecialCollections::self()->defaultCollection( SpecialCollections::Outbox ); kDebug() << "Got outbox" << outbox.id(); if( !outbox.isValid() ) { kError() << "Failed to get outbox folder."; KApplication::exit( 1 ); } FilterActionJob *fjob = new FilterActionJob( outbox, new ClearErrorAction, this ); connect( fjob, SIGNAL(result(KJob*)), this, SLOT(jobResult(KJob*)) ); } void Runner::jobResult( KJob *job ) { if( job->error() ) { kDebug() << "Job error:" << job->errorString(); KApplication::exit( 2 ); } else { kDebug() << "Job success."; KApplication::exit( 0 ); } } int main( int argc, char **argv ) { KCmdLineArgs::init( argc, argv, "clearerror", 0, ki18n( "clearerror" ), "0", ki18n( "An app that re-queues failed items from the outbox" ) ); KApplication app; new Runner(); return app.exec(); } #include "clearerror.moc" diff --git a/akonadi/tests/filteractiontest.cpp b/mailtransport/tests/filteractiontest.cpp similarity index 100% rename from akonadi/tests/filteractiontest.cpp rename to mailtransport/tests/filteractiontest.cpp diff --git a/akonadi/tests/filteractiontest.h b/mailtransport/tests/filteractiontest.h similarity index 100% copy from akonadi/tests/filteractiontest.h copy to mailtransport/tests/filteractiontest.h diff --git a/mailtransport/tests/sendqueued.cpp b/mailtransport/tests/sendqueued.cpp index 69ada74b5..0b5d40b82 100644 --- a/mailtransport/tests/sendqueued.cpp +++ b/mailtransport/tests/sendqueued.cpp @@ -1,85 +1,85 @@ /* Copyright (c) 2009 Constantin Berzan This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sendqueued.h" #include #include #include #include #include #include -#include +#include #include #include #include using namespace Akonadi; using namespace MailTransport; Runner::Runner() { Control::start(); SpecialCollectionsRequestJob *rjob = new SpecialCollectionsRequestJob( this ); rjob->requestDefaultCollection( SpecialCollections::Outbox ); connect( rjob, SIGNAL(result(KJob*)), this, SLOT(checkFolders()) ); rjob->start(); } void Runner::checkFolders() { Collection outbox = SpecialCollections::self()->defaultCollection( SpecialCollections::Outbox ); kDebug() << "Got outbox" << outbox.id(); if( !outbox.isValid() ) { kError() << "Failed to get outbox folder."; KApplication::exit( 1 ); } FilterActionJob *fjob = new FilterActionJob( outbox, new SendQueuedAction, this ); connect( fjob, SIGNAL(result(KJob*)), this, SLOT(jobResult(KJob*)) ); } void Runner::jobResult( KJob *job ) { if( job->error() ) { kDebug() << "Job error:" << job->errorString(); KApplication::exit( 2 ); } else { kDebug() << "Job success."; KApplication::exit( 0 ); } } int main( int argc, char **argv ) { KCmdLineArgs::init( argc, argv, "sendqueued", 0, ki18n( "sendqueued" ), "0", ki18n( "An app that sends all queued messages" ) ); KApplication app; new Runner(); return app.exec(); } #include "sendqueued.moc" diff --git a/akonadi/tests/filteractiontest.h b/mailtransport/tests/testattribute.h similarity index 57% rename from akonadi/tests/filteractiontest.h rename to mailtransport/tests/testattribute.h index 82d041508..3ca931048 100644 --- a/akonadi/tests/filteractiontest.h +++ b/mailtransport/tests/testattribute.h @@ -1,48 +1,36 @@ /* - Copyright (c) 2009 Constantin Berzan + Copyright (c) 2008 Volker Krause This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef FILTERACTIONTEST_H -#define FILTERACTIONTEST_H +#ifndef TESTATTRIBUTE_H +#define TESTATTRIBUTE_H -#include -#include +#include -#include -#include - -class KJob; - -class FilterActionTest : public QObject +/* Attribute used for testing by various unit tests. */ +class TestAttribute : public Akonadi::Attribute { - Q_OBJECT - - private slots: - void initTestCase(); - void testMassModifyItem(); - void testMassModifyItems(); - void testMassModifyCollection(); - - private: - Akonadi::Collection createCollection( const QString &name ); - Akonadi::Item createItem( const Akonadi::Collection &col, bool accept ); - + public: + QByteArray type() const { return "EXTRA"; } + QByteArray serialized() const { return data; } + void deserialize( const QByteArray &ba ) { data = ba; } + TestAttribute* clone() const { TestAttribute* a = new TestAttribute; a->data = data; return a; } + QByteArray data; }; - #endif diff --git a/mailtransport/tests/unittestenv_akonadi/config-mysql-db.xml b/mailtransport/tests/unittestenv_akonadi/config-mysql-db.xml new file mode 100644 index 000000000..d9d053e1f --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/config-mysql-db.xml @@ -0,0 +1,9 @@ + + kdehome + xdgconfig-mysql.db + xdglocal + akonadi_knut_resource + akonadi_knut_resource + akonadi_knut_resource + true + diff --git a/mailtransport/tests/unittestenv_akonadi/config-mysql-fs.xml b/mailtransport/tests/unittestenv_akonadi/config-mysql-fs.xml new file mode 100644 index 000000000..c8e91fd6c --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/config-mysql-fs.xml @@ -0,0 +1,9 @@ + + kdehome + xdgconfig-mysql.fs + xdglocal + akonadi_knut_resource + akonadi_knut_resource + akonadi_knut_resource + true + diff --git a/mailtransport/tests/unittestenv_akonadi/config-postgresql-db.xml b/mailtransport/tests/unittestenv_akonadi/config-postgresql-db.xml new file mode 100644 index 000000000..6c5db2fb7 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/config-postgresql-db.xml @@ -0,0 +1,9 @@ + + kdehome + xdgconfig-postgresql.db + xdglocal + akonadi_knut_resource + akonadi_knut_resource + akonadi_knut_resource + true + diff --git a/mailtransport/tests/unittestenv_akonadi/config-postgresql-fs.xml b/mailtransport/tests/unittestenv_akonadi/config-postgresql-fs.xml new file mode 100644 index 000000000..4b0e3f7f2 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/config-postgresql-fs.xml @@ -0,0 +1,9 @@ + + kdehome + xdgconfig-postgresql.fs + xdglocal + akonadi_knut_resource + akonadi_knut_resource + akonadi_knut_resource + true + diff --git a/mailtransport/tests/unittestenv_akonadi/config-sqlite.xml b/mailtransport/tests/unittestenv_akonadi/config-sqlite.xml new file mode 100644 index 000000000..5f0722d52 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/config-sqlite.xml @@ -0,0 +1,9 @@ + + kdehome + xdgconfig.sqlite + xdglocal + akonadi_knut_resource + akonadi_knut_resource + akonadi_knut_resource + true + diff --git a/mailtransport/tests/unittestenv_akonadi/config.xml b/mailtransport/tests/unittestenv_akonadi/config.xml new file mode 100644 index 000000000..a2cada5a1 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/config.xml @@ -0,0 +1,9 @@ + + kdehome + xdgconfig + xdglocal + akonadi_knut_resource + akonadi_knut_resource + akonadi_knut_resource + true + diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi-firstrunrc b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi-firstrunrc new file mode 100644 index 000000000..1cac492a3 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi-firstrunrc @@ -0,0 +1,3 @@ +[ProcessedDefaults] +defaultaddressbook=done +defaultcalendar=done diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_0rc b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_0rc new file mode 100644 index 000000000..61bb2f0c6 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_0rc @@ -0,0 +1,4 @@ +[General] +DataFile[$e]=$KDEHOME/testdata-res1.xml +FileWatchingEnabled=false + diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_1rc b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_1rc new file mode 100644 index 000000000..96a9499aa --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_1rc @@ -0,0 +1,3 @@ +[General] +DataFile[$e]=$KDEHOME/testdata-res2.xml +FileWatchingEnabled=false diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_2rc b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_2rc new file mode 100644 index 000000000..4b117f01f --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/akonadi_knut_resource_2rc @@ -0,0 +1,3 @@ +[General] +DataFile[$e]=$KDEHOME/testdata-res3.xml +FileWatchingEnabled=false diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/kdebugrc b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/kdebugrc new file mode 100755 index 000000000..5cc0a6430 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/kdebugrc @@ -0,0 +1,78 @@ +[0] +AbortFatal=true +ErrorFilename[$e]=kdebug.dbg +ErrorOutput=2 +FatalFilename[$e]=kdebug.dbg +FatalOutput=2 +InfoFilename[$e]=kdebug.dbg +InfoOutput=2 +WarnFilename[$e]=kdebug.dbg +WarnOutput=2 + +[264] +AbortFatal=true +ErrorFilename[$e]=kdebug.dbg +ErrorOutput=4 +FatalFilename[$e]=kdebug.dbg +FatalOutput=4 +InfoFilename[$e]=kdebug.dbg +WarnFilename[$e]=kdebug.dbg +WarnOutput=4 + +[5250] +InfoOutput=2 + +[7009] +AbortFatal=true +ErrorFilename[$e]=kdebug.dbg +ErrorOutput=4 +FatalFilename[$e]=kdebug.dbg +FatalOutput=4 +InfoFilename[$e]=kdebug.dbg +InfoOutput=4 +WarnFilename[$e]=kdebug.dbg +WarnOutput=4 + +[7011] +AbortFatal=true +ErrorFilename[$e]=kdebug.dbg +ErrorOutput=4 +FatalFilename[$e]=kdebug.dbg +FatalOutput=4 +InfoFilename[$e]=kdebug.dbg +InfoOutput=4 +WarnFilename[$e]=kdebug.dbg +WarnOutput=4 + +[7012] +AbortFatal=true +ErrorFilename[$e]=kdebug.dbg +ErrorOutput=4 +FatalFilename[$e]=kdebug.dbg +FatalOutput=4 +InfoFilename[$e]=kdebug.dbg +InfoOutput=4 +WarnFilename[$e]=kdebug.dbg +WarnOutput=4 + +[7014] +AbortFatal=true +ErrorFilename[$e]=kdebug.dbg +ErrorOutput=0 +FatalFilename[$e]=kdebug.dbg +FatalOutput=0 +InfoFilename[$e]=kdebug.dbg +InfoOutput=0 +WarnFilename[$e]=kdebug.dbg +WarnOutput=0 + +[7021] +AbortFatal=true +ErrorFilename[$e]=kdebug.dbg +ErrorOutput=4 +FatalFilename[$e]=kdebug.dbg +FatalOutput=4 +InfoFilename[$e]=kdebug.dbg +InfoOutput=4 +WarnFilename[$e]=kdebug.dbg +WarnOutput=4 diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/kdedrc b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/kdedrc new file mode 100644 index 000000000..41d178141 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/share/config/kdedrc @@ -0,0 +1,3 @@ +[General] +CheckSycoca=false +CheckFileStamps=false diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res1.xml b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res1.xml new file mode 100644 index 000000000..484ecd129 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res1.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + testmailbody + From: <test@user.tst> + \Seen + \Flagged + \Draft + + + testmailbody1 + From: <test1@user.tst> + \Flagged + + + testmailbody2 + From: <test2@user.tst> + + + testmailbody3 + From: <test3@user.tst> + + + testmailbody4 + From: <test4@user.tst> + + + testmailbody5 + From: <test5@user.tst> + + + testmailbody6 + From: <test6@user.tst> + + + testmailbody7 + From: <test7@user.tst> + + + testmailbody8 + From: <test8@user.tst> + + + testmailbody9 + From: <test9@user.tst> + + + testmailbody10 + From: <test10@user.tst> + + + testmailbody11 + From: <test11@user.tst> + + + testmailbody12 + From: <test12@user.tst> + + + testmailbody13 + From: <test13@user.tst> + + + testmailbody14 + From: <test14@user.tst> + + + + diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res2.xml b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res2.xml new file mode 100644 index 000000000..b12f3b3af --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res2.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res3.xml b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res3.xml new file mode 100644 index 000000000..0c3b7a8c0 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata-res3.xml @@ -0,0 +1,4 @@ + + + + diff --git a/mailtransport/tests/unittestenv_akonadi/kdehome/testdata.xml b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata.xml new file mode 100644 index 000000000..35bc8d2c3 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/kdehome/testdata.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + testmailbody + From: <test@user.tst> + \Seen + \Flagged + \Draft + + + testmailbody1 + From: <test1@user.tst> + \Flagged + + + testmailbody2 + From: <test2@user.tst> + + + testmailbody3 + From: <test3@user.tst> + + + testmailbody4 + From: <test4@user.tst> + + + testmailbody5 + From: <test5@user.tst> + + + testmailbody6 + From: <test6@user.tst> + + + testmailbody7 + From: <test7@user.tst> + + + testmailbody8 + From: <test8@user.tst> + + + testmailbody9 + From: <test9@user.tst> + + + testmailbody10 + From: <test10@user.tst> + + + testmailbody11 + From: <test11@user.tst> + + + testmailbody12 + From: <test12@user.tst> + + + testmailbody13 + From: <test13@user.tst> + + + testmailbody14 + From: <test14@user.tst> + + + + + + + + + + diff --git a/mailtransport/tests/unittestenv_akonadi/xdgconfig-mysql.db/akonadi/akonadiserverrc b/mailtransport/tests/unittestenv_akonadi/xdgconfig-mysql.db/akonadi/akonadiserverrc new file mode 100644 index 000000000..fa9b2d47a --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/xdgconfig-mysql.db/akonadi/akonadiserverrc @@ -0,0 +1,5 @@ +[%General] +ExternalPayload=false + +[Search] +Manager=Dummy diff --git a/mailtransport/tests/unittestenv_akonadi/xdgconfig-mysql.fs/akonadi/akonadiserverrc b/mailtransport/tests/unittestenv_akonadi/xdgconfig-mysql.fs/akonadi/akonadiserverrc new file mode 100644 index 000000000..a7bb0c20b --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/xdgconfig-mysql.fs/akonadi/akonadiserverrc @@ -0,0 +1,6 @@ +[%General] +SizeThreshold=0 +ExternalPayload=true + +[Search] +Manager=Dummy diff --git a/mailtransport/tests/unittestenv_akonadi/xdgconfig-postgresql.db/akonadi/akonadiserverrc b/mailtransport/tests/unittestenv_akonadi/xdgconfig-postgresql.db/akonadi/akonadiserverrc new file mode 100644 index 000000000..0bd4ae1a4 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/xdgconfig-postgresql.db/akonadi/akonadiserverrc @@ -0,0 +1,15 @@ +[%General] +Driver=QPSQL +ExternalPayload=false + +[Search] +Manager=Dummy + +[QPSQL] +Name=post_table +User=user +Password=pass +Options= +StartServer=false +Host= +Port=5432 diff --git a/mailtransport/tests/unittestenv_akonadi/xdgconfig-postgresql.fs/akonadi/akonadiserverrc b/mailtransport/tests/unittestenv_akonadi/xdgconfig-postgresql.fs/akonadi/akonadiserverrc new file mode 100644 index 000000000..b14bb39c6 --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/xdgconfig-postgresql.fs/akonadi/akonadiserverrc @@ -0,0 +1,17 @@ +[%General] +Driver=QPSQL +SizeThreshold=0 +ExternalPayload=true + +[Search] +Manager=Dummy + +[QPSQL] +Name=post_table +User=user +Password=pass +Options= +StartServer=false +Host= +Port=5432 + diff --git a/mailtransport/tests/unittestenv_akonadi/xdgconfig.sqlite/akonadi/akonadiserverrc b/mailtransport/tests/unittestenv_akonadi/xdgconfig.sqlite/akonadi/akonadiserverrc new file mode 100644 index 000000000..9bb1d8c3c --- /dev/null +++ b/mailtransport/tests/unittestenv_akonadi/xdgconfig.sqlite/akonadi/akonadiserverrc @@ -0,0 +1,6 @@ +[%General] +Driver=QSQLITE + +[Debug] +Tracer=null +