Commit a129a9e1 authored by Bertjan Broeksema's avatar Bertjan Broeksema
Browse files

Enable the notes plugin for running in the AgentServer. Needed to

extract the AKONADI_AGENT_FACTORY for ical into a seperate file
in order to avoid duplicate qt_plugin_instance definition.

svn path=/trunk/KDE/kdepim/runtime/; revision=1187114
parent 697fbb65
......@@ -15,6 +15,7 @@ set( icalresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
icalresourcebase.cpp
icalresource.cpp
icalresourceplugin.cpp
)
install( FILES icalresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
......
......@@ -20,16 +20,12 @@
#include "icalresource.h"
#include <akonadi/agentfactory.h>
#include <kcalcore/memorycalendar.h>
#include <kcalcore/freebusy.h>
#include <kdebug.h>
#include <klocale.h>
#include <QtCore/QtPlugin>
using namespace Akonadi;
using namespace KCalCore;
......@@ -151,6 +147,5 @@ QString ICalResource::mimeType( const IncidenceBase::Ptr &incidence ) const
return incidence->mimeType();
}
AKONADI_AGENT_FACTORY( ICalResource, akonadi_ical_resource );
#include "icalresource.moc"
/*
Copyright (c) 2010 Bertjan Broeksema <broeksema@kde.org>
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 "icalresource.h"
#include <akonadi/agentfactory.h>
#include <QtCore/QtPlugin>
/** We need to put this in a separate file because the notes plugin inherits the
ical plugin and we'd get a multiple definition of `qt_plugin_instance'
if we put the line below in icalresource.cpp. Now we can compile it only for
the ical resource
*/
AKONADI_AGENT_FACTORY( ICalResource, akonadi_ical_resource );
......@@ -26,8 +26,8 @@ qt4_add_dbus_adaptor(notesresource_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.Akonadi.Notes.Settings.xml settings.h Settings
)
kde4_add_executable(akonadi_notes_resource ${notesresource_SRCS})
kde4_add_plugin(akonadi_notes_resource ${notesresource_SRCS})
target_link_libraries(akonadi_notes_resource ${KDEPIMLIBS_AKONADI_LIBS} ${QT_QTDBUS_LIBRARY} ${KDE4_KIO_LIBS} ${KDEPIMLIBS_KCALCORE_LIBS})
install(TARGETS akonadi_notes_resource ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS akonadi_notes_resource DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -20,6 +20,8 @@
#include "notesresource.h"
#include "settingsadaptor.h"
#include <akonadi/agentfactory.h>
#include <kcalcore/incidence.h>
#include <kglobal.h>
......@@ -55,6 +57,6 @@ QString NotesResource::mimeType( const KCalCore::IncidenceBase::Ptr & ) const
return sNotesType;
}
AKONADI_RESOURCE_MAIN( NotesResource )
AKONADI_AGENT_FACTORY( NotesResource, akonadi_notes_resource )
#include "notesresource.moc"
......@@ -109,4 +109,4 @@ Icon=view-pim-notes
X-Akonadi-MimeTypes=application/x-vnd.kde.notes
X-Akonadi-Capabilities=Resource
X-Akonadi-Identifier=akonadi_notes_resource
#X-Akonadi-LaunchMethod=AgentServer
X-Akonadi-LaunchMethod=AgentServer
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