diff --git a/CMakeLists.txt b/CMakeLists.txt index 790045c..3cb9f29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,85 +1,84 @@ cmake_minimum_required(VERSION 3.5) set(PIM_VERSION "5.14.40") project(kdepim-apps-lib VERSION ${PIM_VERSION}) set(KF5_MIN_VERSION "5.69.0") find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) set(LIBRARY_NAMELINK) if (POLICY CMP0053) cmake_policy(SET CMP0053 NEW) endif() include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(GenerateExportHeader) include(ECMGenerateHeaders) include(ECMGeneratePriFile) include(ECMSetupVersion) include(FeatureSummary) include(ECMQtDeclareLoggingCategory) include(ECMAddTests) set(KDEPIM_APPS_LIB_VERSION ${PIM_VERSION}) set(QT_REQUIRED_VERSION "5.12.0") set(AKONADI_VERSION "5.14.40") set(GRANTLEETHEME_LIB_VERSION "5.14.40") set(AKONADICONTACT_LIB_VERSION "5.14.40") set(LIBKLEO_LIB_VERSION "5.14.40") set(PIMCOMMON_LIB_VERSION "5.14.40") set(GRANTLEE_LIB_VERSION "5.2") find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets DBus Gui) find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5ContactEditor ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED) find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED) find_package(Grantlee5 ${GRANTLEE_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Prison ${KF5_MIN_VERSION} CONFIG REQUIRED) if(BUILD_TESTING) find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Test) add_definitions(-DBUILD_TESTING) endif() if (EXISTS "${CMAKE_SOURCE_DIR}/.git") add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600) endif() add_definitions(-DQT_NO_FOREACH) add_definitions(-DQT_NO_KEYWORDS) add_subdirectory(libfollowupreminder) -add_subdirectory(libkdepimdbusinterfaces) add_subdirectory(libsendlater) add_subdirectory(kaddressbookgrantlee) add_subdirectory(kaddressbookimportexport) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) ecm_qt_install_logging_categories( EXPORT KDEPIMAPPSLIB FILE kdepim-apps-lib.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR} ) diff --git a/libkdepimdbusinterfaces/CMakeLists.txt b/libkdepimdbusinterfaces/CMakeLists.txt deleted file mode 100644 index 0ad3cef..0000000 --- a/libkdepimdbusinterfaces/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -ecm_setup_version(PROJECT VARIABLE_PREFIX KDEPIMDBUSINTERFACES - VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kdepimdbusinterfaces_version.h" - PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KdepimDBusInterfacesConfigVersion.cmake" - SOVERSION 5 -) - -########### CMake Config Files ########### -set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KdepimDBusInterfaces") - -configure_package_config_file( - "${CMAKE_CURRENT_SOURCE_DIR}/KF5KdepimDBusInterfacesConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/KF5KdepimDBusInterfacesConfig.cmake" - INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} -) - -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/KF5KdepimDBusInterfacesConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/KF5KdepimDBusInterfacesConfigVersion.cmake" - DESTINATION "${CMAKECONFIG_INSTALL_DIR}" - COMPONENT Devel -) - -install(EXPORT KF5KdepimDBusInterfacesTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5KdepimDBusInterfacesTargets.cmake NAMESPACE KF5::) - -install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/kdepimdbusinterfaces_version.h - DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel -) - -add_subdirectory(src) - diff --git a/libkdepimdbusinterfaces/KF5KdepimDBusInterfacesConfig.cmake.in b/libkdepimdbusinterfaces/KF5KdepimDBusInterfacesConfig.cmake.in deleted file mode 100644 index 1e4afcd..0000000 --- a/libkdepimdbusinterfaces/KF5KdepimDBusInterfacesConfig.cmake.in +++ /dev/null @@ -1,3 +0,0 @@ -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/KF5KdepimDBusInterfacesTargets.cmake") diff --git a/libkdepimdbusinterfaces/src/CMakeLists.txt b/libkdepimdbusinterfaces/src/CMakeLists.txt deleted file mode 100644 index b7e5781..0000000 --- a/libkdepimdbusinterfaces/src/CMakeLists.txt +++ /dev/null @@ -1,80 +0,0 @@ - -########### next target ############### - -set(kdepimdbusinterfaces_LIB_SRCS - urihandler.cpp - reminderclient.cpp - kdepimdbusinterface_debug.cpp -) - -ecm_qt_declare_logging_category(kdepimdbusinterfaces_LIB_SRCS HEADER kdepimdbusinterface_debug.h IDENTIFIER KDEPIMDBUSINTERFACE_LOG CATEGORY_NAME org.kde.pim.kdepimdbusinterface - DESCRIPTION "kdepim-apps-lib (kdepimdbusinterface)" - OLD_CATEGORY_NAMES log_kdepimdbusinterface - EXPORT KDEPIMAPPSLIB - ) - - - -qt5_generate_dbus_interface(dbusinterfaces/kmkernel.h org.kde.kmail.kmail.xml OPTIONS -a) -qt5_add_dbus_interfaces( kdepimdbusinterfaces_LIB_SRCS dbusinterfaces/org.kde.korganizer.KOrgac.xml) -qt5_add_dbus_interfaces( kdepimdbusinterfaces_LIB_SRCS dbusinterfaces/org.kde.korganizer.Korganizer.xml) -qt5_add_dbus_interfaces( kdepimdbusinterfaces_LIB_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kmail.kmail.xml) - -add_library(KF5KdepimDBusInterfaces ${kdepimdbusinterfaces_LIB_SRCS}) -generate_export_header(KF5KdepimDBusInterfaces BASE_NAME kdepimdbusinterfaces) -add_library(KF5::KdepimDBusInterfaces ALIAS KF5KdepimDBusInterfaces) - -target_link_libraries(KF5KdepimDBusInterfaces -PUBLIC - KF5::AkonadiCore -PRIVATE - KF5::AkonadiContact - KF5::KIOWidgets - Qt5::DBus -) - -target_include_directories(KF5KdepimDBusInterfaces INTERFACE "$") - -set_target_properties(KF5KdepimDBusInterfaces PROPERTIES - VERSION ${KDEPIMDBUSINTERFACES_VERSION_STRING} - SOVERSION ${KDEPIMDBUSINTERFACES_SOVERSION} - EXPORT_NAME KdepimDBusInterfaces -) - -install(TARGETS - KF5KdepimDBusInterfaces - EXPORT KF5KdepimDBusInterfacesTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK} -) - -ecm_generate_headers(kdepimdbusinterfaces_Camelcase_HEADERS - HEADER_NAMES - ReminderClient - UriHandler - REQUIRED_HEADERS kdepimdbusinterfaces_HEADERS - PREFIX KdepimDBusInterfaces -) - -ecm_generate_pri_file(BASE_NAME KdepimDBusInterfaces - LIB_NAME KF5KdepimDBusInterfaces - DEPS "AkonadiCore" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KdepimDBusInterfaces -) - - -install(FILES - ${kdepimdbusinterfaces_Camelcase_HEADERS} - DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KdepimDBusInterfaces - COMPONENT Devel -) - -install(FILES - ${kdepimdbusinterfaces_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/kdepimdbusinterfaces_export.h - DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/kdepimdbusinterfaces - COMPONENT Devel -) - -install(FILES - ${PRI_FILENAME} - DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) - - diff --git a/libkdepimdbusinterfaces/src/dbusinterfaces/kmkernel.h b/libkdepimdbusinterfaces/src/dbusinterfaces/kmkernel.h deleted file mode 100644 index 92e4ea6..0000000 --- a/libkdepimdbusinterfaces/src/dbusinterfaces/kmkernel.h +++ /dev/null @@ -1,566 +0,0 @@ -// - -#ifndef _KMKERNEL_H -#define _KMKERNEL_H - -#include "interfaces/mailinterfaces.h" - -#include -#include -#include -#include - -#include - -#include "kmail_export.h" -#include "settings/kmailsettings.h" -#include -#include "viewer/viewer.h" -#include "progresswidget/progressmanager.h" - -#define kmkernel KMKernel::self() -#define kmconfig KMKernel::config() - -class QAbstractItemModel; -namespace Akonadi { -class Collection; -class ChangeRecorder; -class EntityTreeModel; -class EntityMimeTypeFilterModel; -} - -namespace KIO { -class Job; -} - -namespace MessageComposer { -class MessageSender; -} -namespace PimCommon { -class AutoCorrection; -class StorageServiceManager; -} - -/** The KMail namespace contains classes used for KMail. -* This is to keep them out of the way from all the other -* un-namespaced classes in libs and the rest of PIM. -*/ -namespace KMail { -class MailServiceImpl; -class UndoStack; -class KMSystemTray; -} -using KMail::MailServiceImpl; -using KMail::UndoStack; -namespace MessageComposer { -class AkonadiSender; -} - -namespace KIdentityManagement { -class Identity; -class IdentityManager; -} - -namespace MailCommon { -class Kernel; -class FolderCollection; -class FolderCollectionMonitor; -class JobScheduler; -class KMFilterDialog; -} - -class QTimer; -class KMMainWin; -class KMainWindow; -class KMMainWidget; -class ConfigureDialog; -class FolderArchiveManager; - -/** - * @short Central point of coordination in KMail - * - * The KMKernel class represents the core of KMail, where the different parts - * come together and are coordinated. It is currently also the class which exports - * KMail's main D-BUS interfaces. - * - * The kernel is responsible for creating various - * (singleton) objects such as the identity manager and the message sender. - * - * The kernel also creates an Akonadi Session, Monitor and EntityTreeModel. These - * are shared so that other objects in KMail have access to it. Having only one EntityTreeModel - * instead of many reduces the overall communication with the Akonadi server. - * - * The kernel also manages some stuff that should be factored out: - * - default collection handling, like inboxCollectionFolder() - * - job handling, like jobScheduler() - * - handling of some config settings, like wrapCol() - * - various other stuff - */ -class KMAIL_EXPORT KMKernel : public QObject, public MailCommon::IKernel, public MailCommon::ISettings, public MailCommon::IFilter -{ - Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "org.kde.kmail.kmail") - -public: - explicit KMKernel(QObject *parent = nullptr); - ~KMKernel(); - - /** - * Start of D-Bus callable stuff. The D-Bus methods need to be public slots, - * otherwise they can't be accessed. - */ -public Q_SLOTS: - - Q_SCRIPTABLE void checkMail(); - Q_SCRIPTABLE void openReader() - { - openReader(false); - } - - /** - * Enables/disables systray icon changing when mail arrives. - * With this disabled the systray icon will always be the same. - */ - Q_SCRIPTABLE void setSystrayIconNotificationsEnabled(bool enabled); - - /** - * Pauses all background jobs and does not - * allow new background jobs to be started. - */ - Q_SCRIPTABLE void pauseBackgroundJobs(); - - /** - * Resumes all background jobs and allows - * new jobs to be started. - */ - Q_SCRIPTABLE void resumeBackgroundJobs(); - - /** - * Stops all network related jobs and enter offline mode - * New network jobs cannot be started. - */ - Q_SCRIPTABLE void stopNetworkJobs(); - - /** - * Resumes all network related jobs and enter online mode - * New network jobs can be started. - */ - Q_SCRIPTABLE void resumeNetworkJobs(); - - Q_SCRIPTABLE QStringList accounts(); - - Q_SCRIPTABLE void makeResourceOnline(MessageViewer::Viewer::ResourceOnlineMode mode); - - /** - * Checks the account with the specified name for new mail. - * If the account name is empty, all accounts not excluded from manual - * mail check will be checked. - */ - Q_SCRIPTABLE void checkAccount(const QString &account); - - Q_SCRIPTABLE bool selectFolder(const QString &folder); - - Q_SCRIPTABLE bool canQueryClose(); - - Q_SCRIPTABLE bool handleCommandLine(bool noArgsOpensReader, const QStringList &args, const QString &workingDir); - - /** - * Opens a composer window and prefills it with different - * message parts. - * - * @returns The id of composer if more are opened. - * - * @param to A comma separated list of To addresses. - * @param cc A comma separated list of CC addresses. - * @param bcc A comma separated list of BCC addresses. - * @param subject The message subject. - * @param body The message body. - * @param hidden Whether the composer window shall initially be hidden. - * @param messageFile A message file that will be used as message body. - * @param attachmentPaths A list of files that will be attached to the message. - * @param customHeaders A list of custom headers. - */ - Q_SCRIPTABLE int openComposer(const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden, const QString &messageFile, - const QStringList &attachmentPaths, const QStringList &customHeaders, const QString &replyTo = QString(), const QString &inReplyTo = QString()); - - /** - * Opens a composer window and prefills it with different - * message parts. - * - * @returns The id of composer if more are opened. - * - * @param to A comma separated list of To addresses. - * @param cc A comma separated list of CC addresses. - * @param bcc A comma separated list of BCC addresses. - * @param subject The message subject. - * @param body The message body. - * @param hidden Whether the composer window shall initially be hidden. - * @param attachName The name of the attachment. - * @param attachCte The content transfer encoding of the attachment. - * @param attachData The raw data of the attachment. - * @param attachType The mime type of the attachment. - * @param attachSubType The sub mime type of the attachment. - * @param attachParamAttr The parameter attribute of the attachment. - * @param attachParamValue The parameter value of the attachment. - * @param attachContDisp The content display type of the attachment. - * @param attachCharset The charset of the attachment. - * @param identity The identity identifier which will be used as sender identity. - */ - Q_SCRIPTABLE int openComposer(const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden, const QString &attachName, - const QByteArray &attachCte, const QByteArray &attachData, const QByteArray &attachType, const QByteArray &attachSubType, const QByteArray &attachParamAttr, - const QString &attachParamValue, const QByteArray &attachContDisp, const QByteArray &attachCharset, unsigned int identity); - - /** - * Opens a composer window and prefills it with different - * message parts. - * @since 5.0 - * - * @returns The id of composer if more are opened. - * - * @param to A comma separated list of To addresses. - * @param cc A comma separated list of CC addresses. - * @param bcc A comma separated list of BCC addresses. - * @param subject The message subject. - * @param body The message body. - * @param attachName The name of the attachment. - * @param attachCte The content transfer encoding of the attachment. - * @param attachData The raw data of the attachment. - * @param attachType The mime type of the attachment. - * @param attachSubType The sub mime type of the attachment. - * @param attachParamAttr The parameter attribute of the attachment. - * @param attachParamValue The parameter value of the attachment. - * @param attachContDisp The content display type of the attachment. - * @param attachCharset The charset of the attachment. - * @param identity The identity identifier which will be used as sender identity. - */ - Q_SCRIPTABLE int openComposer(const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, const QString &attachName, const QByteArray &attachCte, - const QByteArray &attachData, const QByteArray &attachType, const QByteArray &attachSubType, const QByteArray &attachParamAttr, const QString &attachParamValue, - const QByteArray &attachContDisp, const QByteArray &attachCharset, unsigned int identity); - - /** - * Opens a composer window and prefills it with different - * message parts. - * - * @returns The DBus object path for the composer. - * - * @param to A comma separated list of To addresses. - * @param cc A comma separated list of CC addresses. - * @param bcc A comma separated list of BCC addresses. - * @param subject The message subject. - * @param body The message body. - * @param hidden Whether the composer window shall initially be hidden. - */ - Q_SCRIPTABLE QDBusObjectPath openComposer(const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, bool hidden); - - /** - * Opens a composer window and prefills it with different - * message parts. - * - * @returns The DBus object path for the composer. - * - * @param to A comma separated list of To addresses. - * @param cc A comma separated list of CC addresses. - * @param bcc A comma separated list of BCC addresses. - * @param subject The message subject. - * @param body The message body. - * @param hidden Whether the composer window shall initially be hidden. - * @param useFolderId The id of the folder whose associated identity will be used. - * @param messageFile A message file that will be used as message body. - * @param attachURL The URL to the file that will be attached to the message. - */ - Q_SCRIPTABLE QDBusObjectPath newMessage(const QString &to, const QString &cc, const QString &bcc, bool hidden, bool useFolderId, const QString &messageFile, const QString &attachURL); - - Q_SCRIPTABLE bool showMail(qint64 serialNumber); - - Q_SCRIPTABLE int viewMessage(const QString &messageFile); - - Q_SCRIPTABLE void updateConfig(); - - Q_SCRIPTABLE void showFolder(const QString &collectionId); - - Q_SCRIPTABLE void reloadFolderArchiveConfig(); - - /** - * End of D-Bus callable stuff - */ - -public: - void checkMailOnStartup(); - - /** A static helper function that asks the user - * if they want to go online. - * @return true if the user wants to go online - * @return false if the user wants to stay offline - */ - static bool askToGoOnline(); - - /** Checks if the current network state is online or offline - * @return true if the network state is offline - * @return false if the network state is online - */ - static bool isOffline(); - - /** normal control stuff */ - - static KMKernel *self(); - KSharedConfig::Ptr config() override; - void syncConfig() override; - - void init(); - void setupDBus(); - - Akonadi::ChangeRecorder *folderCollectionMonitor() const override; - - /** - * Returns the main model, which contains all folders and the items of recently opened folders. - */ - Akonadi::EntityTreeModel *entityTreeModel() const; - - /** - * Returns a model of all folders in KMail. This is basically the same as entityTreeModel(), - * but with items filtered out, the model contains only collections. - */ - Akonadi::EntityMimeTypeFilterModel *collectionModel() const override; - - void recoverDeadLetters(); - void closeAllKMailWindows(); - void cleanup(); - void quit(); - bool doSessionManagement(); - bool firstInstance() const; - void setFirstInstance(bool value); - void action(bool mailto, bool check, const QString &to, const QString &cc, const QString &bcc, const QString &subj, const QString &body, const QUrl &messageFile, const QList &attach, - const QStringList &customHeaders, const QString &replyTo, const QString &inReplyTo); - - //sets online status for akonadi accounts. true for online, false for offline - void setAccountStatus(bool); - - const QString xmlGuiInstanceName() const - { - return mXmlGuiInstance; - } - - void setXmlGuiInstanceName(const QString &instance) - { - mXmlGuiInstance = instance; - } - - UndoStack *undoStack() const - { - return the_undoStack; - } - - MessageComposer::MessageSender *msgSender() override; - - void openFilterDialog(bool createDummyFilter = true) override; - void createFilter(const QByteArray &field, const QString &value) override; - - /** return the pointer to the identity manager */ - KIdentityManagement::IdentityManager *identityManager() override; - - MailCommon::JobScheduler *jobScheduler() const override - { - return mJobScheduler; - } - - /** Expire all folders, used for the gui action */ - void expireAllFoldersNow(); - - bool firstStart() const - { - return the_firstStart; - } - - QString previousVersion() const - { - return the_previousVersion; - } - - bool shuttingDown() const - { - return the_shuttingDown; - } - - void setShuttingDown(bool flag) - { - the_shuttingDown = flag; - } - - /** Returns the full path of the user's local data directory for KMail. - The path ends with '/'. - */ - static QString localDataPath(); - - /** Returns true if we have a system tray applet. This is needed in order - * to know whether the application should be allowed to exit in case the - * last visible composer or separate message window is closed. - */ - bool haveSystemTrayApplet() const; - - QTextCodec *networkCodec() const - { - return mNetCodec; - } - - /** returns a reference to the first Mainwin or a temporary Mainwin */ - KMainWindow *mainWin(); - - /** Get first mainwidget */ - KMMainWidget *getKMMainWidget(); - - /** - * Returns a list of all currently loaded folders. Since folders are loaded async, this - * is empty at startup. - */ - Akonadi::Collection::List allFolders() const; - // - void selectCollectionFromId(const Akonadi::Collection::Id id); - - void raise(); - - void stopAgentInstance(); - - //ISettings - bool showPopupAfterDnD() override; - - bool excludeImportantMailFromExpiry() override; - - qreal closeToQuotaThreshold() override; - - Akonadi::Collection::Id lastSelectedFolder() override; - void setLastSelectedFolder(const Akonadi::Collection::Id &col) override; - - QStringList customTemplates() override; - - void checkFolderFromResources(const Akonadi::Collection::List &collectionList); - - const QAbstractItemModel *treeviewModelSelection(); - - void savePaneSelection(); - - void updatePaneTagComboBox(); - - PimCommon::AutoCorrection *composerAutoCorrection(); - - void toggleSystemTray(); - FolderArchiveManager *folderArchiveManager() const; - PimCommon::StorageServiceManager *storageServiceManager() const; - - bool allowToDebugBalooSupport() const; - -protected: - void agentInstanceBroken(const Akonadi::AgentInstance &instance); - -public Q_SLOTS: - - void updateSystemTray() override; - - /** Custom templates have changed, so all windows using them need - to regenerate their menus */ - void updatedTemplates(); - - /// Save contents of all open composer windows to ~/dead.letter - void dumpDeadLetters(); - - /** Call this slot instead of directly KConfig::sync() to - minimize the overall config writes. Calling this slot will - schedule a sync of the application config file using a timer, so - that many consecutive calls can be condensed into a single - sync, which is more efficient. */ - void slotRequestConfigSync(); - - /** - * Sync the config immediately - */ - void slotSyncConfig(); - - void slotShowConfigurationDialog(); - void slotRunBackgroundTasks(); - - void slotConfigChanged(); - -Q_SIGNALS: - void configChanged(); - void onlineStatusChanged(GlobalSettings::EnumNetworkState::type); - void customTemplatesChanged(); - - void startCheckMail(); - void endCheckMail(); - -private Q_SLOTS: - /** Updates identities when a transport has been deleted. */ - void transportRemoved(int id, const QString &name); - /** Updates identities when a transport has been renamed. */ - void transportRenamed(int id, const QString &oldName, const QString &newName); - void itemDispatchStarted(); - void instanceStatusChanged(const Akonadi::AgentInstance &); - - void akonadiStateChanged(Akonadi::ServerManager::State); - void slotProgressItemCompletedOrCanceled(KPIM::ProgressItem *item); - void slotInstanceError(const Akonadi::AgentInstance &instance, const QString &message); - void slotInstanceWarning(const Akonadi::AgentInstance &instance, const QString &message); - void slotCollectionRemoved(const Akonadi::Collection &col); - void slotDeleteIdentity(uint identity); - void slotInstanceRemoved(const Akonadi::AgentInstance &); - void slotSystemNetworkStatusChanged(bool isOnline); - void slotCollectionChanged(const Akonadi::Collection &, const QSet &set); - - void slotCheckAccount(Akonadi::ServerManager::State state); -private: - /* - * Fills a composer cWin - * - * @returns true if attached message is a valid iCal message - */ - bool fillComposer(KMail::Composer * &cWin, const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, const QString &attachName, - const QByteArray &attachCte, const QByteArray &attachData, const QByteArray &attachType, const QByteArray &attachSubType, const QByteArray &attachParamAttr, - const QString &attachParamValue, const QByteArray &attachContDisp, const QByteArray &attachCharset, unsigned int identity); - - void verifyAccount(); - void resourceGoOnLine(); - void openReader(bool onlyCheck); - QSharedPointer currentFolderCollection(); - - UndoStack *the_undoStack = nullptr; - mutable KIdentityManagement::IdentityManager *mIdentityManager = nullptr; - MessageComposer::AkonadiSender *the_msgSender = nullptr; - /** previous KMail version. If different from current, - the user has just updated. read from config */ - QString the_previousVersion; - /** is this the first start? read from config */ - bool the_firstStart; - /** are we going down? set from here */ - bool the_shuttingDown; - /** true unless kmail is closed by session management */ - bool the_firstInstance; - - KSharedConfig::Ptr mConfig; - QTextCodec *mNetCodec = nullptr; - QString mXmlGuiInstance; - ConfigureDialog *mConfigureDialog = nullptr; - - QTimer *mBackgroundTasksTimer = nullptr; - MailCommon::JobScheduler *mJobScheduler = nullptr; - // temporary mainwin - KMMainWin *mWin = nullptr; - MailServiceImpl *mMailService = nullptr; - - bool mSystemNetworkStatus; - - KMail::KMSystemTray *mSystemTray; - QHash mResourceCryptoSettingCache; - MailCommon::FolderCollectionMonitor *mFolderCollectionMonitor = nullptr; - Akonadi::EntityTreeModel *mEntityTreeModel = nullptr; - Akonadi::EntityMimeTypeFilterModel *mCollectionModel = nullptr; - - /// List of Akonadi resources that are currently being checked. - QStringList mResourcesBeingChecked; - - QPointer mFilterEditDialog; - PimCommon::AutoCorrection *mAutoCorrection = nullptr; - FolderArchiveManager *mFolderArchiveManager = nullptr; - PimCommon::StorageServiceManager *mStorageManager = nullptr; - bool mDebugBaloo; -}; - -#endif // _KMKERNEL_H diff --git a/libkdepimdbusinterfaces/src/dbusinterfaces/org.kde.korganizer.KOrgac.xml b/libkdepimdbusinterfaces/src/dbusinterfaces/org.kde.korganizer.KOrgac.xml deleted file mode 100644 index 5e3f67d..0000000 --- a/libkdepimdbusinterfaces/src/dbusinterfaces/org.kde.korganizer.KOrgac.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libkdepimdbusinterfaces/src/dbusinterfaces/org.kde.korganizer.Korganizer.xml b/libkdepimdbusinterfaces/src/dbusinterfaces/org.kde.korganizer.Korganizer.xml deleted file mode 100644 index 7f3a187..0000000 --- a/libkdepimdbusinterfaces/src/dbusinterfaces/org.kde.korganizer.Korganizer.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/libkdepimdbusinterfaces/src/reminderclient.cpp b/libkdepimdbusinterfaces/src/reminderclient.cpp deleted file mode 100644 index f63ea65..0000000 --- a/libkdepimdbusinterfaces/src/reminderclient.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - This file is part of KOrganizer. - - Copyright (c) 2003 Cornelius Schumacher - Copyright (c) 2005 David Faure - - 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 "reminderclient.h" -#include "korgacinterface.h" - -#include "kdepimdbusinterface_debug.h" - -#include - -#include -#include -#include -#include - -using namespace KPIM; - -void ReminderClient::startDaemon() -{ - QDBusInterface iface(QStringLiteral("org.kde.korgac"), QStringLiteral("/")); - if (iface.isValid()) { - // Reminder daemon already runs - return; - } - - const QString desktopFile = QStandardPaths::locate(QStandardPaths::ConfigLocation, QStringLiteral("autostart/org.kde.korgac.desktop")); - if (desktopFile.isEmpty()) { - qCWarning(KDEPIMDBUSINTERFACE_LOG) << "Couldn't find autostart/korgac.desktop!"; - } else { - QString error; - if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) != 0) { - qCWarning(KDEPIMDBUSINTERFACE_LOG) << "Failure starting korgac:" << error; - // try harder... - const QString korgacExe = QStandardPaths::findExecutable(QStringLiteral("korgac")); - QProcess::startDetached(korgacExe, QStringList()); - } - } -} - -void ReminderClient::stopDaemon() -{ - OrgKdeKorganizerKOrgacInterface interface( - QStringLiteral("org.kde.korgac"), QStringLiteral("/ac"), QDBusConnection::sessionBus()); - interface.quit(); -} - -void ReminderClient::hideDaemon() -{ - OrgKdeKorganizerKOrgacInterface interface( - QStringLiteral("org.kde.korgac"), QStringLiteral("/ac"), QDBusConnection::sessionBus()); - interface.hide(); -} - -void ReminderClient::showDaemon() -{ - OrgKdeKorganizerKOrgacInterface interface( - QStringLiteral("org.kde.korgac"), QStringLiteral("/ac"), QDBusConnection::sessionBus()); - interface.show(); -} diff --git a/libkdepimdbusinterfaces/src/reminderclient.h b/libkdepimdbusinterfaces/src/reminderclient.h deleted file mode 100644 index 434fe58..0000000 --- a/libkdepimdbusinterfaces/src/reminderclient.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - This file is part of the KOrganizer interfaces. - - Copyright (c) 2003 Cornelius Schumacher - - 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 KDEPIM_REMINDERCLIENT_H -#define KDEPIM_REMINDERCLIENT_H - -#include "kdepimdbusinterfaces_export.h" - -namespace KPIM { -/** - This namespace provides the interface for communicating with the reminder daemon. -*/ -namespace ReminderClient { -/** - Start reminder daemon. - */ -KDEPIMDBUSINTERFACES_EXPORT void startDaemon(); - -/** - Stop reminder daemon. - */ -KDEPIMDBUSINTERFACES_EXPORT void stopDaemon(); - -/** - Hide the reminder daemon. - */ -KDEPIMDBUSINTERFACES_EXPORT void hideDaemon(); - -/** - Show the reminder daemon. - */ -KDEPIMDBUSINTERFACES_EXPORT void showDaemon(); -} -} - -#endif diff --git a/libkdepimdbusinterfaces/src/urihandler.cpp b/libkdepimdbusinterfaces/src/urihandler.cpp deleted file mode 100644 index 9d10ea1..0000000 --- a/libkdepimdbusinterfaces/src/urihandler.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - This file is part of KOrganizer. - - Copyright (c) 2003 Cornelius Schumacher - Copyright (c) 2005 Rafal Rzepecki - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - As a special exception, permission is given to link this program - with any edition of Qt, and distribute the resulting executable, - without including the source code for Qt in the source distribution. -*/ - -#include "urihandler.h" -#include "kdepimdbusinterface_debug.h" -#include -#include -#include - -#include -#include -#include -#include -#include - -bool UriHandler::process(const QString &uri, const Akonadi::Item &item) -{ - qCDebug(KDEPIMDBUSINTERFACE_LOG) << uri; - - if (uri.startsWith(QLatin1String("kmail:"))) { - // make sure kmail is running or the part is shown - const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.kmail2.desktop")); - QString error; - if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) == 0) { - // parse string, show - int colon = uri.indexOf(QLatin1Char(':')); - // extract 'number' from 'kmail:/' - QString serialNumberStr = uri.mid(colon + 1); - serialNumberStr = serialNumberStr.left(serialNumberStr.indexOf(QLatin1Char('/'))); - - OrgKdeKmailKmailInterface kmailInterface(QStringLiteral("org.kde.kmail"), QStringLiteral("/KMail"), QDBusConnection::sessionBus()); - kmailInterface.showMail(serialNumberStr.toLongLong()); - return true; - } else { - qCWarning(KDEPIMDBUSINTERFACE_LOG) << "Failure starting kmail:" << error; - return false; - } - } else if (uri.startsWith(QLatin1String("mailto:"))) { - QDesktopServices::openUrl(QUrl(uri)); - return true; - } else if (uri.startsWith(QLatin1String("uid:"))) { - if (item.isValid()) { - Akonadi::ContactEditorDialog *dlg = new Akonadi::ContactEditorDialog(Akonadi::ContactEditorDialog::EditMode, (QWidget *)nullptr); - dlg->setContact(item); - dlg->setAttribute(Qt::WA_DeleteOnClose); - dlg->show(); - return true; - } else { - qCDebug(KDEPIMDBUSINTERFACE_LOG) << "Item is not valid."; - return false; - } - } else if (uri.startsWith(QLatin1String("urn:x-ical"))) { - // make sure korganizer is running or the part is shown - const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.korganizer.desktop")); - QString error; - if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) == 0) { - // we must work around QUrl breakage (it doesn't know about URNs) - const QString uid = QUrl::fromPercentEncoding(uri.toLatin1()).mid(11); - OrgKdeKorganizerKorganizerInterface korganizerIface( - QStringLiteral("org.kde.korganizer"), QStringLiteral("/Korganizer"), QDBusConnection::sessionBus()); - - return korganizerIface.showIncidence(uid); - } else { - qCWarning(KDEPIMDBUSINTERFACE_LOG) << "Failure starting korganizer:" << error; - return false; - } - } else if (uri.startsWith(QLatin1String("akonadi:"))) { - const QUrl url(uri); - const QString mimeType = QUrlQuery(url).queryItemValue(QStringLiteral("type")); - if (mimeType.toLower() == QLatin1String("message/rfc822")) { - // make sure kmail is running or the part is shown - const QString desktopFile = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("org.kde.kmail2.desktop")); - QString error; - if (KToolInvocation::startServiceByDesktopPath(desktopFile, QStringList(), &error) == 0) { - OrgKdeKmailKmailInterface kmailInterface(QStringLiteral("org.kde.kmail"), QStringLiteral("/KMail"), QDBusConnection::sessionBus()); - kmailInterface.viewMessage(uri); - return true; - } else { - qCWarning(KDEPIMDBUSINTERFACE_LOG) << "Failure starting kmail:" << error; - return false; - } - } - } else { // no special URI, let KDE handle it - new KRun(QUrl(uri), nullptr); - } - - return false; -} diff --git a/libkdepimdbusinterfaces/src/urihandler.h b/libkdepimdbusinterfaces/src/urihandler.h deleted file mode 100644 index c11d2af..0000000 --- a/libkdepimdbusinterfaces/src/urihandler.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of libkdepim. - - Copyright (c) 2003 Cornelius Schumacher - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program 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 General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - As a special exception, permission is given to link this program - with any edition of Qt, and distribute the resulting executable, - without including the source code for Qt in the source distribution. -*/ -#ifndef URIHANDLER_H -#define URIHANDLER_H - -#include "kdepimdbusinterfaces_export.h" - -#include - -class QString; - -/** URI handler. */ -class KDEPIMDBUSINTERFACES_EXPORT UriHandler -{ -public: - /** - Process URI (e.g. open mailer, open browser, open incidence viewer etc.). - @return true if handler handled the URI, otherwise false. - @param uri The URI of the link that should be handled. - */ - static bool process(const QString &uri, const Akonadi::Item &item = Akonadi::Item()); -}; - -#endif diff --git a/metainfo.yaml b/metainfo.yaml index c516c1d..1c8ae7e 100644 --- a/metainfo.yaml +++ b/metainfo.yaml @@ -1,24 +1,22 @@ description: KDE PIM application libraries tier: 3 type: solution platforms: - name: Linux portingAid: false deprecated: false libraries: - cmake: "KF5::KaddressbookGrantlee" - cmake: "KF5::KaddressbookImportExport" - cmake: "KF5::FollowupReminder" - - cmake: "KF5::KdepimDBusInterfaces" - cmake: "KF5::SendLater" public_lib: true group: kdepim irc: akonadi public_source_dirs: - kaddressbookgrantlee - kaddressbookimportexport - libfollowupreminder - - libkdepimdbusinterfaces - libsendlater