diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a3c63852..d8221761a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,158 +1,158 @@ cmake_minimum_required(VERSION 3.5) set(KDEPIM_VERSION_NUMBER "5.11.40") project(kmail VERSION ${KDEPIM_VERSION_NUMBER}) include(CheckIncludeFiles) if (POLICY CMP0063) cmake_policy(SET CMP0063 NEW) endif() set(KF5_MIN_VERSION "5.58.0") find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) include(ECMInstallIcons) include(ECMSetupVersion) include(ECMAddTests) include(GenerateExportHeader) include(ECMGenerateHeaders) include(FeatureSummary) include(CheckFunctionExists) include(ECMGeneratePriFile) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMAddAppIcon) include(ECMQtDeclareLoggingCategory) # Do NOT add quote set(KDEPIM_DEV_VERSION alpha) # add an extra space if(DEFINED KDEPIM_DEV_VERSION) set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}") endif() set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}") set(AKONADI_MIMELIB_VERSION "5.11.40") set(AKONADI_CONTACT_VERSION "5.11.40") set(KCONTACTS_LIB_VERSION "5.11.40") set(KCALENDARCORE_LIB_VERSION "5.11.40") set(CALENDARUTILS_LIB_VERSION "5.11.40") set(IDENTITYMANAGEMENT_LIB_VERSION "5.11.41") set(KLDAP_LIB_VERSION "5.11.40") set(KMAILTRANSPORT_LIB_VERSION "5.11.40") set(KONTACTINTERFACE_LIB_VERSION "5.11.40") set(KMIME_LIB_VERSION "5.11.40") set(KPIMTEXTEDIT_LIB_VERSION "5.11.40") set(AKONADI_VERSION "5.11.40") set(KTNEF_LIB_VERSION "5.11.40") set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}") set(KDEPIM_LIB_SOVERSION "5") set(QT_REQUIRED_VERSION "5.10.0") option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE) option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE) find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets) set(LIBGRAVATAR_VERSION_LIB "5.11.40") -set(MAILCOMMON_LIB_VERSION_LIB "5.11.41") +set(MAILCOMMON_LIB_VERSION_LIB "5.11.42") set(KDEPIM_APPS_LIB_VERSION_LIB "5.11.40") set(MESSAGELIB_LIB_VERSION_LIB "5.11.42") set(LIBKLEO_LIB_VERSION_LIB "5.11.40") set(PIMCOMMON_LIB_VERSION_LIB "5.11.43") set(LIBKDEPIM_LIB_VERSION_LIB "5.11.40") set(LIBKSIEVE_LIB_VERSION_LIB "5.11.40") find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5AkonadiSearch "5.11.40" CONFIG REQUIRED) set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi") set(GPGMEPP_LIB_VERSION "1.11.1") find_package(Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED) # Find KF5 package find_package(KF5Bookmarks ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Crash ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED) find_package(KF5GuiAddons ${KF5_MIN_VERSION} REQUIRED) find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5ItemViews ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5JobWidgets ${KF5_MIN_VERSION} REQUIRED) find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5NotifyConfig ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Parts ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5Sonnet ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED) find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED) # Find KdepimLibs Package find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED) find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED) find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED) find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED) find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED) find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED) find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED) find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED) find_package(KF5FollowupReminder ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5Gravatar ${LIBGRAVATAR_VERSION_LIB} CONFIG REQUIRED) find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5LibKSieve ${LIBKSIEVE_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5MessageCore ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5MessageComposer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5MessageList ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5SendLater ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED) find_package(KF5Tnef ${KTNEF_LIB_VERSION} CONFIG REQUIRED) find_package(MailTransportDBusService CONFIG REQUIRED) configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h ) include_directories(${kmail_SOURCE_DIR} ${kmail_BINARY_DIR}) configure_file(kmail-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmail-version.h @ONLY) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) add_definitions(-DQT_NO_FOREACH) set(CMAKE_CXX_STANDARD 14) add_subdirectory(src) add_subdirectory(agents) add_subdirectory(ktnef) install( FILES kmail.renamecategories kmail.categories DESTINATION ${KDE_INSTALL_CONFDIR} ) add_subdirectory(doc) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/tag/tagactionmanager.cpp b/src/tag/tagactionmanager.cpp index fb761623c..3e0e027cf 100644 --- a/src/tag/tagactionmanager.cpp +++ b/src/tag/tagactionmanager.cpp @@ -1,345 +1,345 @@ /* Copyright 2010 Thomas McGuire Copyright 2011-2019 Laurent Montel 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) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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, see . */ #include "tagactionmanager.h" #include "messageactions.h" #include "MailCommon/AddTagDialog" #include #include #include #include #include #include #include #include #include #include #include "kmail_debug.h" #include #include #include #include using namespace KMail; static int s_numberMaxTag = 10; TagActionManager::TagActionManager(QObject *parent, KActionCollection *actionCollection, MessageActions *messageActions, KXMLGUIClient *guiClient) : QObject(parent) , mActionCollection(actionCollection) , mMessageActions(messageActions) , mGUIClient(guiClient) , mMonitor(new Akonadi::Monitor(this)) { mMessageActions->messageStatusMenu()->menu()->addSeparator(); mMonitor->setObjectName(QStringLiteral("TagActionManagerMonitor")); mMonitor->setTypeMonitored(Akonadi::Monitor::Tags); mMonitor->tagFetchScope().fetchAttribute(); connect(mMonitor, &Akonadi::Monitor::tagAdded, this, &TagActionManager::onTagAdded); connect(mMonitor, &Akonadi::Monitor::tagRemoved, this, &TagActionManager::onTagRemoved); connect(mMonitor, &Akonadi::Monitor::tagChanged, this, &TagActionManager::onTagChanged); } TagActionManager::~TagActionManager() { } void TagActionManager::clearActions() { //Remove the tag actions from the toolbar if (!mToolbarActions.isEmpty()) { if (mGUIClient->factory()) { mGUIClient->unplugActionList(QStringLiteral("toolbar_messagetag_actions")); } mToolbarActions.clear(); } //Remove the tag actions from the status menu and the action collection, //then delete them. for (KToggleAction *action : qAsConst(mTagActions)) { mMessageActions->messageStatusMenu()->removeAction(action); // This removes and deletes the action at the same time mActionCollection->removeAction(action); } if (mSeparatorMoreAction) { mMessageActions->messageStatusMenu()->removeAction(mSeparatorMoreAction); } if (mSeparatorNewTagAction) { mMessageActions->messageStatusMenu()->removeAction(mSeparatorNewTagAction); } if (mNewTagAction) { mMessageActions->messageStatusMenu()->removeAction(mNewTagAction); } if (mMoreAction) { mMessageActions->messageStatusMenu()->removeAction(mMoreAction); } mTagActions.clear(); } void TagActionManager::createTagAction(const MailCommon::Tag::Ptr &tag, bool addToMenu) { QString cleanName(i18n("Message Tag: %1", tag->tagName)); cleanName.replace(QLatin1Char('&'), QStringLiteral("&&")); KToggleAction *const tagAction = new KToggleAction(QIcon::fromTheme(tag->iconName), cleanName, this); tagAction->setIconText(tag->name()); tagAction->setChecked(tag->id() == mNewTagId); mActionCollection->addAction(tag->name(), tagAction); mActionCollection->setDefaultShortcut(tagAction, QKeySequence(tag->shortcut)); const QString tagName = QString::number(tag->tag().id()); connect(tagAction, &KToggleAction::triggered, this, [this, tagName] { onSignalMapped(tagName); }); // The shortcut configuration is done in the config dialog. // The shortcut set in the shortcut dialog would not be saved back to // the tag descriptions correctly. mActionCollection->setShortcutsConfigurable(tagAction, false); mTagActions.insert(tag->id(), tagAction); if (addToMenu) { mMessageActions->messageStatusMenu()->menu()->addAction(tagAction); } if (tag->inToolbar) { mToolbarActions.append(tagAction); } } void TagActionManager::createActions() { if (mTagFetchInProgress) { return; } if (mTags.isEmpty()) { mTagFetchInProgress = true; Akonadi::TagFetchJob *fetchJob = new Akonadi::TagFetchJob(this); fetchJob->fetchScope().fetchAttribute(); connect(fetchJob, &Akonadi::TagFetchJob::result, this, &TagActionManager::finishedTagListing); } else { mTagFetchInProgress = false; createTagActions(mTags); } } void TagActionManager::finishedTagListing(KJob *job) { if (job->error()) { qCWarning(KMAIL_LOG) << job->errorString(); } Akonadi::TagFetchJob *fetchJob = static_cast(job); const Akonadi::Tag::List lstTags = fetchJob->tags(); for (const Akonadi::Tag &result : lstTags) { mTags.append(MailCommon::Tag::fromAkonadi(result)); } mTagFetchInProgress = false; std::sort(mTags.begin(), mTags.end(), MailCommon::Tag::compare); createTagActions(mTags); } void TagActionManager::onSignalMapped(const QString &tag) { Q_EMIT tagActionTriggered(Akonadi::Tag(tag.toLongLong())); } -void TagActionManager::createTagActions(const QList &tags) +void TagActionManager::createTagActions(const QVector &tags) { clearActions(); // Create a action for each tag and plug it into various places int i = 0; bool needToAddMoreAction = false; const int numberOfTag(tags.size()); //It is assumed the tags are sorted for (const MailCommon::Tag::Ptr &tag : tags) { if (i < s_numberMaxTag) { createTagAction(tag, true); } else { if (tag->inToolbar || !tag->shortcut.isEmpty()) { createTagAction(tag, false); } if (i == s_numberMaxTag && i < numberOfTag) { needToAddMoreAction = true; } } ++i; } if (!mSeparatorNewTagAction) { mSeparatorNewTagAction = new QAction(this); mSeparatorNewTagAction->setSeparator(true); } mMessageActions->messageStatusMenu()->menu()->addAction(mSeparatorNewTagAction); if (!mNewTagAction) { mNewTagAction = new QAction(i18n("Add new tag..."), this); connect(mNewTagAction, &QAction::triggered, this, &TagActionManager::newTagActionClicked); } mMessageActions->messageStatusMenu()->menu()->addAction(mNewTagAction); if (needToAddMoreAction) { if (!mSeparatorMoreAction) { mSeparatorMoreAction = new QAction(this); mSeparatorMoreAction->setSeparator(true); } mMessageActions->messageStatusMenu()->menu()->addAction(mSeparatorMoreAction); if (!mMoreAction) { mMoreAction = new QAction(i18n("More..."), this); connect(mMoreAction, &QAction::triggered, this, &TagActionManager::tagMoreActionClicked); } mMessageActions->messageStatusMenu()->menu()->addAction(mMoreAction); } if (!mToolbarActions.isEmpty() && mGUIClient->factory()) { mGUIClient->plugActionList(QStringLiteral("toolbar_messagetag_actions"), mToolbarActions); } } void TagActionManager::updateActionStates(int numberOfSelectedMessages, const Akonadi::Item &selectedItem) { mNewTagId = -1; QMap::const_iterator it = mTagActions.constBegin(); QMap::const_iterator end = mTagActions.constEnd(); if (numberOfSelectedMessages >= 1) { Q_ASSERT(selectedItem.isValid()); for (; it != end; ++it) { //FIXME Not very performant tag label retrieval QString label(i18n("Tag not Found")); for (const MailCommon::Tag::Ptr &tag : qAsConst(mTags)) { if (tag->id() == it.key()) { label = tag->name(); break; } } it.value()->setEnabled(true); if (numberOfSelectedMessages == 1) { const bool hasTag = selectedItem.hasTag(Akonadi::Tag(it.key())); it.value()->setChecked(hasTag); it.value()->setText(i18n("Message Tag: %1", label)); } else { it.value()->setChecked(false); it.value()->setText(i18n("Toggle Message Tag: %1", label)); } } } else { for (; it != end; ++it) { it.value()->setEnabled(false); } } } void TagActionManager::onTagAdded(const Akonadi::Tag &akonadiTag) { const QList checked = checkedTags(); clearActions(); mTags.append(MailCommon::Tag::fromAkonadi(akonadiTag)); std::sort(mTags.begin(), mTags.end(), MailCommon::Tag::compare); createTagActions(mTags); checkTags(checked); } void TagActionManager::onTagRemoved(const Akonadi::Tag &akonadiTag) { for (const MailCommon::Tag::Ptr &tag : qAsConst(mTags)) { if (tag->id() == akonadiTag.id()) { mTags.removeAll(tag); break; } } fillTagList(); } void TagActionManager::onTagChanged(const Akonadi::Tag &akonadiTag) { for (const MailCommon::Tag::Ptr &tag : qAsConst(mTags)) { if (tag->id() == akonadiTag.id()) { mTags.removeAll(tag); break; } } mTags.append(MailCommon::Tag::fromAkonadi(akonadiTag)); fillTagList(); } void TagActionManager::fillTagList() { const QList checked = checkedTags(); clearActions(); std::sort(mTags.begin(), mTags.end(), MailCommon::Tag::compare); createTagActions(mTags); checkTags(checked); } void TagActionManager::newTagActionClicked() { QPointer dialog = new MailCommon::AddTagDialog(QList() << mActionCollection, nullptr); dialog->setTags(mTags); if (dialog->exec() == QDialog::Accepted) { mNewTagId = dialog->tag().id(); // Assign tag to all selected items right away Q_EMIT tagActionTriggered(dialog->tag()); } delete dialog; } void TagActionManager::checkTags(const QList &tags) { for (const qint64 id : tags) { if (mTagActions.contains(id)) { mTagActions[id]->setChecked(true); } } } QList TagActionManager::checkedTags() const { QMap::const_iterator it = mTagActions.constBegin(); QMap::const_iterator end = mTagActions.constEnd(); QList checked; for (; it != end; ++it) { if (it.value()->isChecked()) { checked << it.key(); } } return checked; } diff --git a/src/tag/tagactionmanager.h b/src/tag/tagactionmanager.h index 80b5b4903..4351775e8 100644 --- a/src/tag/tagactionmanager.h +++ b/src/tag/tagactionmanager.h @@ -1,144 +1,144 @@ /* Copyright 2010 Thomas McGuire Copyright 2011-2019 Laurent Montel 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) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. 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, see . */ #ifndef TAGACTIONMANAGER_H #define TAGACTIONMANAGER_H #include "kmail_export.h" #include "mailcommon/tag.h" #include - +#include class KJob; class KActionCollection; class KXMLGUIClient; class KToggleAction; class QAction; namespace Akonadi { class Item; class Monitor; class Tag; } namespace KMail { class MessageActions; /** * Creates actions related to the existing Akonadi tags and plugs them into the GUI. * * The tag manager reads all tags from Akonadi and adds each to the action collection * and to the message status menu. * For tags that should be in the toolbar, it plugs the action list * toolbar_messagetag_actions. * * The actions are automatically updated when a Akonadi tag changes. */ class KMAIL_EXPORT TagActionManager : public QObject { Q_OBJECT public: /** * Does not take ownership of the action collection, the GUI client or the message actions. * Does not yet create the actions. * * @param parent The parent QObject. * @param actionCollection: Each tag action is added here * @param messageActions: Each action is added to the message status menu * @param guiClient: The action list with the toolbar action is plugged here */ TagActionManager(QObject *parent, KActionCollection *actionCollection, MessageActions *messageActions, KXMLGUIClient *guiClient); ~TagActionManager(); /** * Removes all actions from the GUI again */ void clearActions(); /** * Creates and plugs all tag actions */ void createActions(); /** * Updates the state of the toggle actions of all tags. * The state of the action depends on the number of selected messages, for example * all actions are disabled when no message is selected. * * This function is async * * @param numberOfSelectedMessages The number of selected messages * @param selectedItem if exactly one item is selected, it should be passed here */ void updateActionStates(int numberOfSelectedMessages, const Akonadi::Item &selectedItem); Q_SIGNALS: /** * Emitted when one of the tagging actions was triggered. The user of this class * should connect to this signal and change the tags of the messages */ void tagActionTriggered(const Akonadi::Tag &tag); /** * Emitted when we want to select more action */ void tagMoreActionClicked(); private: Q_DISABLE_COPY(TagActionManager) void finishedTagListing(KJob *job); void newTagActionClicked(); void onSignalMapped(const QString &tag); void onTagAdded(const Akonadi::Tag &); void onTagRemoved(const Akonadi::Tag &); void onTagChanged(const Akonadi::Tag &); void fillTagList(); void createTagAction(const MailCommon::Tag::Ptr &tag, bool addToMenu); - void createTagActions(const QList &); + void createTagActions(const QVector &); void checkTags(const QList &tags); QList checkedTags() const; KActionCollection *mActionCollection = nullptr; MessageActions *mMessageActions = nullptr; KXMLGUIClient *mGUIClient = nullptr; QAction *mSeparatorMoreAction = nullptr; QAction *mSeparatorNewTagAction = nullptr; QAction *mMoreAction = nullptr; QAction *mNewTagAction = nullptr; // Maps the id of a tag to the action of a tag. // Contains all existing tags QMap mTagActions; // The actions of all tags that are in the toolbar QList mToolbarActions; // A sorted list of all tags - QList mTags; + QVector mTags; // Uri of a newly created tag qint64 mNewTagId = -1; bool mTagFetchInProgress = false; Akonadi::Monitor *mMonitor = nullptr; }; } #endif diff --git a/src/tag/tagselectdialog.h b/src/tag/tagselectdialog.h index cebb04dc9..08dfcf10a 100644 --- a/src/tag/tagselectdialog.h +++ b/src/tag/tagselectdialog.h @@ -1,58 +1,59 @@ /* Copyright (C) 2011-2019 Montel Laurent 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; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef TAGSELECTDIALOG_H #define TAGSELECTDIALOG_H #include +#include #include #include #include "MailCommon/Tag" class QListWidget; class KActionCollection; class TagSelectDialog : public QDialog { Q_OBJECT public: explicit TagSelectDialog(QWidget *parent, int numberOfSelectedMessages, const Akonadi::Item &selectedItem); ~TagSelectDialog(); Akonadi::Tag::List selectedTag() const; void setActionCollection(const QList &actionCollectionList); private: void slotAddNewTag(); void slotTagsFetched(KJob *); void writeConfig(); void readConfig(); void createTagList(bool updateList); enum ItemType { UrlTag = Qt::UserRole + 1 }; int mNumberOfSelectedMessages = -1; Akonadi::Item mSelectedItem; Akonadi::Tag::List mCurrentSelectedTags; - QList mTagList; + QVector mTagList; QList mActionCollectionList; QListWidget *mListTag = nullptr; }; #endif /* TAGSELECTDIALOG_H */