Commit 2c05b91c authored by Laurent Montel's avatar Laurent Montel 😁

Create lib. Fix translate

parent 2c708c4f
......@@ -95,6 +95,8 @@ find_package(KF5PimUtils ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mbox ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimTextEdit ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Imap ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
#Boost
# Don't use BoostConfig.cmake
......
......@@ -25,6 +25,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${migration_SOURCE_DIR}")
find_package(KF5PimUtils ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimTextEdit ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Imap ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
endif()
add_definitions( -DQT_NO_CAST_FROM_ASCII )
......
......@@ -8,8 +8,6 @@ set(kmail-migrator_srcs
localfolderscollectionmigrator.cpp
main.cpp
${MIGRATION_AKONADI_SHARED_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/../../resources/shared/collectionannotationsattribute.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../resources/shared/createandsettagsjob.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../resources/mixedmaildir/mixedmaildirstore.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../resources/mixedmaildir/mixedmaildir_debug.cpp
)
......@@ -56,6 +54,7 @@ target_link_libraries(kmail-migrator
akonadi-filestore
maildir
kmindexreader
akonadi-singlefileresource
)
install(TARGETS kmail-migrator ${INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -38,9 +38,10 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${resources_SOURCE_DIR}")
find_package(KF5MailTransport ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Imap ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
endif()
find_package(KF5Imap ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiCalendar ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mbox ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
......@@ -70,8 +71,8 @@ find_package(LibKFbAPI 1.0 QUIET CONFIG)
set_package_properties(LibKFbAPI PROPERTIES DESCRIPTION "A library to access Facebook services" URL "http://projects.kde.org/libkfbapi" TYPE OPTIONAL PURPOSE "LibKFbAPI is required to build Akonadi resources to access Facebook's contacts, events, notes and posts" )
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/shared
${CMAKE_CURRENT_BINARY_DIR}/shared
${CMAKE_CURRENT_SOURCE_DIR}/shared/singlefileresource/
${CMAKE_CURRENT_BINARY_DIR}/shared/singlefileresource/
${CMAKE_CURRENT_SOURCE_DIR}/folderarchivesettings/
)
......@@ -102,33 +103,6 @@ endmacro( akonadi_add_resourcetest )
#add_definitions( -DQT_NO_CAST_FROM_ASCII )
#add_definitions( -DQT_NO_CAST_TO_ASCII )
set( AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/shared/singlefileresourcebase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/shared/singlefileresourceconfigdialogbase.cpp
)
if (KDEPIM_MOBILE_UI)
set( AKONADI_SINGLEFILERESOURCE_SHARED_UI
${CMAKE_CURRENT_SOURCE_DIR}/shared/singlefileresourceconfigdialog_mobile.ui
${CMAKE_CURRENT_SOURCE_DIR}/shared/singlefileresourceconfigdialog.ui
)
else ()
set( AKONADI_SINGLEFILERESOURCE_SHARED_UI
${CMAKE_CURRENT_SOURCE_DIR}/shared/singlefileresourceconfigdialog_desktop.ui
${CMAKE_CURRENT_SOURCE_DIR}/shared/singlefileresourceconfigdialog.ui
)
endif ()
set( AKONADI_COLLECTIONATTRIBUTES_SHARED_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/shared/collectionannotationsattribute.cpp
${CMAKE_CURRENT_SOURCE_DIR}/shared/collectionflagsattribute.cpp
)
set( AKONADI_IMAPATTRIBUTES_SHARED_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/shared/imapaclattribute.cpp
${CMAKE_CURRENT_SOURCE_DIR}/shared/imapquotaattribute.cpp
)
add_subdirectory( akonotes )
add_subdirectory( kalarm )
add_subdirectory( contacts )
......
......@@ -15,7 +15,6 @@ add_subdirectory( autotests )
add_definitions( -DSETTINGS_NAMESPACE=Akonadi_ICal_Resource )
set( icalresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
shared/icalresourcebase.cpp
shared/icalresource.cpp
icalresourcefactory.cpp
......@@ -23,7 +22,6 @@ set( icalresource_SRCS
install( FILES icalresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
ki18n_wrap_ui(icalresource_SRCS ${AKONADI_SINGLEFILERESOURCE_SHARED_UI})
kconfig_add_kcfg_files(icalresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/icalresource.kcfg org.kde.Akonadi.ICal.Settings)
qt5_add_dbus_adaptor(icalresource_SRCS
......@@ -38,6 +36,6 @@ if (Q_WS_MAC)
set_target_properties(akonadi_ical_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi ICal Resource")
endif ()
target_link_libraries(akonadi_ical_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase)
target_link_libraries(akonadi_ical_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase akonadi-singlefileresource)
install(TARGETS akonadi_ical_resource DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -13,7 +13,6 @@ include_directories(
add_definitions( -DSETTINGS_NAMESPACE=Akonadi_Aknotes_Resource )
set( notesresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
../shared/icalresourcebase.cpp
../shared/icalresource.cpp
notesresource.cpp
......@@ -22,7 +21,6 @@ set( notesresource_SRCS
install( FILES notesresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
ki18n_wrap_ui(notesresource_SRCS ${AKONADI_SINGLEFILERESOURCE_SHARED_UI})
kconfig_add_kcfg_files(notesresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/notesresource.kcfg org.kde.Akonadi.Notes.Settings)
qt5_add_dbus_adaptor(notesresource_SRCS
......@@ -31,6 +29,6 @@ qt5_add_dbus_adaptor(notesresource_SRCS
add_library(akonadi_notes_resource MODULE ${notesresource_SRCS})
target_link_libraries(akonadi_notes_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase)
target_link_libraries(akonadi_notes_resource KF5::AkonadiCore KF5::KIOCore KF5::CalendarCore KF5::AkonadiAgentBase akonadi-singlefileresource)
install(TARGETS akonadi_notes_resource DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -10,7 +10,7 @@ include_directories(
set( icaldirresource_SRCS
icaldirresource.cpp
../shared/dirsettingsdialog.cpp
dirsettingsdialog.cpp
)
ki18n_wrap_ui(icaldirresource_SRCS settingsdialog.ui)
......
......@@ -22,7 +22,7 @@
#include "icaldirresource.h"
#include "settingsadaptor.h"
#include "../shared/dirsettingsdialog.h"
#include "dirsettingsdialog.h"
#include <changerecorder.h>
#include <entitydisplayattribute.h>
......
......@@ -45,8 +45,6 @@ set( imapresource_LIB_SRCS
imapidlemanager.cpp
resourcestate.cpp
resource_imap_debug.cpp
${AKONADI_COLLECTIONATTRIBUTES_SHARED_SOURCES}
${AKONADI_IMAPATTRIBUTES_SHARED_SOURCES}
)
......@@ -103,7 +101,7 @@ if (Q_WS_MAC)
set_target_properties(akonadi_imap_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi IMAP Resource")
endif ()
target_link_libraries(akonadi_imap_resource KF5::AkonadiCore KF5::Imap KF5::MailTransport KF5::KIOCore KF5::Mime KF5::AkonadiMime KF5::PimIdentities imapresource folderarchivesettings KF5::KDELibs4Support)
target_link_libraries(akonadi_imap_resource KF5::AkonadiCore KF5::Imap KF5::MailTransport KF5::KIOCore KF5::Mime KF5::AkonadiMime KF5::PimIdentities imapresource folderarchivesettings KF5::KDELibs4Support akonadi-singlefileresource)
if (RUNTIME_PLUGINS_STATIC)
target_link_libraries(akonadi_imap_resource akonadi_serializer_mail)
......
......@@ -22,7 +22,7 @@ if(KIMAPTEST_INCLUDE_DIR AND KIMAPTEST_LIBRARY)
ecm_mark_as_test(imap-${_testname})
target_link_libraries(${_testname}
KF5::Imap Qt5::Gui Qt5::Core ${KIMAPTEST_LIBRARY} Qt5::Test imapresource)
KF5::Imap Qt5::Gui Qt5::Core ${KIMAPTEST_LIBRARY} Qt5::Test imapresource akonadi-singlefileresource)
add_definitions(-DTEST_DATA="\\"${CMAKE_CURRENT_SOURCE_DIR}\\"")
ENDFOREACH(_testname)
ENDMACRO(IMAP_RESOURCE_UNIT_TESTS)
......
......@@ -11,7 +11,6 @@ include_directories(
add_definitions(-DSETTINGS_NAMESPACE=Akonadi_KAlarm_Resource)
set(kalarmresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/../../ical/shared/icalresourcebase.cpp
kalarmresource.cpp
kalarmresourcefactory.cpp
......@@ -21,7 +20,7 @@ set(kalarmresource_SRCS
install(FILES kalarmresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents")
ki18n_wrap_ui(kalarmresource_SRCS ../shared/alarmtyperadiowidget.ui ${AKONADI_SINGLEFILERESOURCE_SHARED_UI})
ki18n_wrap_ui(kalarmresource_SRCS ../shared/alarmtyperadiowidget.ui)
kconfig_add_kcfg_files(kalarmresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kalarmresource.kcfg org.kde.Akonadi.KAlarm.Settings)
qt5_add_dbus_adaptor(kalarmresource_SRCS
......@@ -42,6 +41,7 @@ target_link_libraries(akonadi_kalarm_resource
KF5::CalendarCore
KF5::KIOCore
KF5::AkonadiAgentBase
akonadi-singlefileresource
)
install(TARGETS akonadi_kalarm_resource DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -11,13 +11,11 @@ add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_kdeaccounts_resource\")
set( kdeaccountsresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
kdeaccountsresource.cpp
)
install( FILES kdeaccountsresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
ki18n_wrap_ui(kdeaccountsresource_SRCS ${AKONADI_SINGLEFILERESOURCE_SHARED_UI})
kconfig_add_kcfg_files(kdeaccountsresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kdeaccountsresource.kcfg org.kde.Akonadi.KDEAccounts.Settings)
qt5_add_dbus_adaptor(kdeaccountsresource_SRCS
......@@ -32,6 +30,6 @@ if (Q_WS_MAC)
set_target_properties(akonadi_kdeaccounts_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi KDEAccounts Resource")
endif ()
target_link_libraries(akonadi_kdeaccounts_resource KF5::AkonadiCore KF5::Abc KF5::KIOCore KF5::AkonadiAgentBase)
target_link_libraries(akonadi_kdeaccounts_resource KF5::AkonadiCore KF5::Abc KF5::KIOCore KF5::AkonadiAgentBase akonadi-singlefileresource)
install(TARGETS akonadi_kdeaccounts_resource ${INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -5,7 +5,6 @@ add_subdirectory(wizard)
add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_mbox_resource\")
set( mboxresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
compactpage.cpp
lockmethodpage.cpp
deleteditemsattribute.cpp
......@@ -16,7 +15,6 @@ set( mboxresource_SRCS
install( FILES mboxresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
ki18n_wrap_ui(mboxresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_UI}
compactpage.ui
lockfilepage.ui
)
......@@ -34,6 +32,6 @@ if (Q_WS_MAC)
set_target_properties(akonadi_mbox_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi Mbox Resource")
endif ()
target_link_libraries(akonadi_mbox_resource KF5::Mbox KF5::AkonadiCore KF5::AkonadiMime KF5::KIOCore KF5::Mime KF5::AkonadiAgentBase)
target_link_libraries(akonadi_mbox_resource KF5::Mbox KF5::AkonadiCore KF5::AkonadiMime KF5::KIOCore KF5::Mime KF5::AkonadiAgentBase akonadi-singlefileresource)
install(TARGETS akonadi_mbox_resource DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -21,7 +21,6 @@ set( mixedmaildirresource_SRCS
mixedmaildirresource.cpp
mixedmaildirstore.cpp
retrieveitemsjob.cpp
../shared/createandsettagsjob.cpp
mixedmaildir_debug.cpp
)
......@@ -56,6 +55,7 @@ target_link_libraries(akonadi_mixedmaildir_resource
KF5::Mime
KF5::PimUtils
KF5::AkonadiAgentBase
akonadi-singlefileresource
)
install(TARGETS akonadi_mixedmaildir_resource ${INSTALL_TARGETS_DEFAULT_ARGS})
......
add_subdirectory(filestore)
add_subdirectory(autotests)
add_subdirectory(singlefileresource)
project(akonadi-singlefileresource)
add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_singlefile_resource\")
set( AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES
singlefileresourcebase.cpp
singlefileresourceconfigdialogbase.cpp
)
if (KDEPIM_MOBILE_UI)
set( AKONADI_SINGLEFILERESOURCE_SHARED_UI
singlefileresourceconfigdialog_mobile.ui
singlefileresourceconfigdialog.ui
)
else ()
set( AKONADI_SINGLEFILERESOURCE_SHARED_UI
singlefileresourceconfigdialog_desktop.ui
singlefileresourceconfigdialog.ui
)
endif ()
set( AKONADI_COLLECTIONATTRIBUTES_SHARED_SOURCES
collectionannotationsattribute.cpp
collectionflagsattribute.cpp
)
set( AKONADI_IMAPATTRIBUTES_SHARED_SOURCES
imapaclattribute.cpp
imapquotaattribute.cpp
)
set(akonadi-singlefileresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
${AKONADI_COLLECTIONATTRIBUTES_SHARED_SOURCES}
${AKONADI_IMAPATTRIBUTES_SHARED_SOURCES}
createandsettagsjob.cpp
)
ki18n_wrap_ui(akonadi-singlefileresource_SRCS ${AKONADI_SINGLEFILERESOURCE_SHARED_UI} settingsdialog.ui)
add_library(akonadi-singlefileresource ${LIBRARY_TYPE} ${akonadi-singlefileresource_SRCS} )
generate_export_header(akonadi-singlefileresource BASE_NAME akonadi-singlefileresource)
target_link_libraries(akonadi-singlefileresource
KF5::AkonadiCore
KF5::AkonadiAgentBase
KF5::KIOCore
KF5::Imap
)
set_target_properties(akonadi-singlefileresource PROPERTIES VERSION ${KDEPIMRUNTIME_LIB_VERSION} SOVERSION ${KDEPIMRUNTIME_LIB_SOVERSION} )
install(TARGETS akonadi-singlefileresource ${INSTALL_TARGETS_DEFAULT_ARGS})
add_subdirectory(autotests)
......@@ -21,12 +21,12 @@
#define AKONADI_COLLECTIONANNOTATIONSATTRIBUTE_H
#include <attribute.h>
#include "akonadi-singlefileresource_export.h"
#include <QtCore/QMap>
namespace Akonadi {
class CollectionAnnotationsAttribute : public Akonadi::Attribute
class AKONADI_SINGLEFILERESOURCE_EXPORT CollectionAnnotationsAttribute : public Akonadi::Attribute
{
public:
CollectionAnnotationsAttribute();
......
......@@ -21,10 +21,11 @@
#define AKONADI_COLLECTIONFLAGSATTRIBUTE_H
#include <attribute.h>
#include "akonadi-singlefileresource_export.h"
namespace Akonadi {
class CollectionFlagsAttribute : public Akonadi::Attribute
class AKONADI_SINGLEFILERESOURCE_EXPORT CollectionFlagsAttribute : public Akonadi::Attribute
{
public:
explicit CollectionFlagsAttribute( const QList<QByteArray> &flags = QList<QByteArray>() );
......
......@@ -22,8 +22,9 @@
#include <KJob>
#include <item.h>
#include <tag.h>
#include "akonadi-singlefileresource_export.h"
class CreateAndSetTagsJob : public KJob
class AKONADI_SINGLEFILERESOURCE_EXPORT CreateAndSetTagsJob : public KJob
{
Q_OBJECT
public:
......
......@@ -20,6 +20,7 @@
#ifndef GET_CREDENTIALS_JOB_H
#define GET_CREDENTIALS_JOB_H
#include "akonadi-singlefileresource_export.h"
#include <kjob.h>
#include <Accounts/Account>
......@@ -33,7 +34,7 @@ namespace SignOn {
class Error;
};
class GetCredentialsJob : public KJob
class AKONADI_SINGLEFILERESOURCE_EXPORT GetCredentialsJob : public KJob
{
Q_OBJECT
public:
......
......@@ -20,6 +20,7 @@
#ifndef AKONADI_IMAPACLATTRIBUTE_H
#define AKONADI_IMAPACLATTRIBUTE_H
#include "akonadi-singlefileresource_export.h"
#include <attribute.h>
#include <QtCore/QMap>
......@@ -28,7 +29,7 @@
namespace Akonadi {
class ImapAclAttribute : public Akonadi::Attribute
class AKONADI_SINGLEFILERESOURCE_EXPORT ImapAclAttribute : public Akonadi::Attribute
{
public:
ImapAclAttribute();
......
......@@ -20,13 +20,14 @@
#ifndef AKONADI_IMAPQUOTAATTRIBUTE_H
#define AKONADI_IMAPQUOTAATTRIBUTE_H
#include "akonadi-singlefileresource_export.h"
#include <attribute.h>
#include <QtCore/QMap>
namespace Akonadi {
class ImapQuotaAttribute : public Akonadi::Attribute
class AKONADI_SINGLEFILERESOURCE_EXPORT ImapQuotaAttribute : public Akonadi::Attribute
{
public:
ImapQuotaAttribute();
......
......@@ -22,6 +22,7 @@
#ifndef AKONADI_SINGLEFILERESOURCE_H
#define AKONADI_SINGLEFILERESOURCE_H
#include "akonadi-singlefileresource_export.h"
#include "singlefileresourcebase.h"
#include "singlefileresourceconfigdialog.h"
......@@ -45,7 +46,7 @@ namespace Akonadi
* Base class for single file based resources.
*/
template <typename Settings>
class SingleFileResource : public SingleFileResourceBase
class AKONADI_SINGLEFILERESOURCE_EXPORT SingleFileResource : public SingleFileResourceBase
{
public:
SingleFileResource( const QString &id )
......
......@@ -20,6 +20,7 @@
#ifndef AKONADI_SINGLEFILERESOURCEBASE_H
#define AKONADI_SINGLEFILERESOURCEBASE_H
#include "akonadi-singlefileresource_export.h"
#include <resourcebase.h>
#include <KUrl>
......@@ -38,7 +39,7 @@ namespace Akonadi
* Base class for single file based resources.
* @see SingleFileResource
*/
class SingleFileResourceBase : public ResourceBase, public AgentBase::Observer
class AKONADI_SINGLEFILERESOURCE_EXPORT SingleFileResourceBase : public ResourceBase, public AgentBase::Observer
{
Q_OBJECT
public:
......
......@@ -21,6 +21,7 @@
#ifndef AKONADI_SINGLEFILERESOURCECONFIGDIALOG_H
#define AKONADI_SINGLEFILERESOURCECONFIGDIALOG_H
#include "akonadi-singlefileresource_export.h"
#include "singlefileresourceconfigdialogbase.h"
#include <KConfigDialogManager>
......@@ -31,7 +32,7 @@ namespace Akonadi {
* Configuration dialog for single file resources.
*/
template <typename Settings>
class SingleFileResourceConfigDialog : public SingleFileResourceConfigDialogBase
class AKONADI_SINGLEFILERESOURCE_EXPORT SingleFileResourceConfigDialog : public SingleFileResourceConfigDialogBase
{
Settings *mSettings;
......
......@@ -22,6 +22,8 @@
#ifndef AKONADI_SINGLEFILERESOURCECONFIGDIALOGBASE_H
#define AKONADI_SINGLEFILERESOURCECONFIGDIALOGBASE_H
#include "akonadi-singlefileresource_export.h"
#ifdef KDEPIM_MOBILE_UI
#include "ui_singlefileresourceconfigdialog_mobile.h"
#else
......@@ -45,7 +47,7 @@ class SingleFileValidatingWidget;
* Base class for the configuration dialog for single file based resources.
* @see SingleFileResourceConfigDialog
*/
class SingleFileResourceConfigDialogBase : public KDialog
class AKONADI_SINGLEFILERESOURCE_EXPORT SingleFileResourceConfigDialogBase : public KDialog
{
Q_OBJECT
public:
......@@ -119,7 +121,7 @@ class SingleFileResourceConfigDialogBase : public KDialog
* Derived classes must implement validate() and emit changed() when
* appropriate.
*/
class SingleFileValidatingWidget : public QWidget
class AKONADI_SINGLEFILERESOURCE_EXPORT SingleFileValidatingWidget : public QWidget
{
Q_OBJECT
public:
......
......@@ -4,14 +4,12 @@ add_subdirectory( autotests )
########### next target ###############
set( vcardresource_SRCS
${AKONADI_SINGLEFILERESOURCE_SHARED_SOURCES}
vcardresource.cpp
vcardresourcefactory.cpp
)
install( FILES vcardresource.desktop DESTINATION "${CMAKE_INSTALL_PREFIX}/share/akonadi/agents" )
ki18n_wrap_ui(vcardresource_SRCS ${AKONADI_SINGLEFILERESOURCE_SHARED_UI})
kconfig_add_kcfg_files(vcardresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/vcardresource.kcfg org.kde.Akonadi.VCard.Settings)
qt5_add_dbus_adaptor(vcardresource_SRCS
......@@ -28,7 +26,7 @@ if (Q_WS_MAC)
set_target_properties(akonadi_vcard_resource PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "KDE Akonadi VCard Resource")
endif ()
target_link_libraries(akonadi_vcard_resource KF5::AkonadiCore KF5::KIOCore KF5::AkonadiAgentBase KF5::Abc)
target_link_libraries(akonadi_vcard_resource KF5::AkonadiCore KF5::KIOCore KF5::AkonadiAgentBase KF5::Abc akonadi-singlefileresource)
install(TARGETS akonadi_vcard_resource DESTINATION ${PLUGIN_INSTALL_DIR})
......@@ -10,10 +10,9 @@ include_directories(
set( vcarddirresource_SRCS
vcarddirresource.cpp
../shared/dirsettingsdialog.cpp
dirsettingsdialog.cpp
)
ki18n_wrap_ui(vcarddirresource_SRCS settingsdialog.ui)
kconfig_add_kcfg_files(vcarddirresource_SRCS settings.kcfgc)
kcfg_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/vcarddirresource.kcfg org.kde.Akonadi.VCardDirectory.Settings)
qt5_add_dbus_adaptor(vcarddirresource_SRCS
......
/*
Copyright (c) 2009 Tobias Koenig <tokoe@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 "dirsettingsdialog.h"
#include "settings.h"
#include <KConfigDialogManager>
#include <KWindowSystem>
#include <KLocalizedString>
#include <QUrl>
#include <QTimer>
#include <QDialogButtonBox>
#include <KConfigGroup>
#include <QPushButton>
#include <QVBoxLayout>
using namespace Akonadi;
SettingsDialog::SettingsDialog( WId windowId )
: QDialog()
{
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
ui.setupUi(mainWidget);
ui.kcfg_Path->setMode( KFile::LocalOnly | KFile::Directory );
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));