Commit 5ef4d08d authored by Laurent Montel's avatar Laurent Montel
Browse files

Use new connect api. Remove warning. Reorder variable in kmmainwidget.h etc

parent 8e124e5f
......@@ -39,7 +39,7 @@ private:
void slotCreateNewComposer(bool forceCursorPosition);
Akonadi::Collection mCollectionForNewMessage;
KMime::Message::Ptr mMsg;
uint mCurrentIdentity;
uint mCurrentIdentity = 0;
};
#endif // KMCOMPOSERCREATENEWCOMPOSERJOB_H
......@@ -57,10 +57,10 @@ private:
QString mCustomTemplate;
KMime::Message::Ptr mMsg;
Akonadi::Collection mCollectionForNewMessage;
uint mUoldId;
uint mUoid;
uint mUoldId = 0;
uint mUoid = 0;
KIdentityManagement::Identity mIdent;
bool mWasModified;
bool mWasModified = false;
};
#endif // KMCOMPOSERUPDATETEMPLATEJOB_H
......@@ -22,7 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kmcomposerwin.h"
#include "kconfigwidgets_version.h"
// KMail includes
#include "job/addressvalidationjob.h"
#include "kmcomposercreatenewcomposerjob.h"
......@@ -1099,8 +1099,8 @@ void KMComposerWin::setupActions(void)
actionCollection()->addAction(QStringLiteral("send_alternative_via"), actActionNowMenu);
}
connect(actActionNowMenu, SIGNAL(triggered(bool)), this,
SLOT(slotSendNow()));
connect(actActionNowMenu, &QAction::triggered, this,
&KMComposerWin::slotSendNow);
connect(actActionLaterMenu, &QAction::triggered, this,
&KMComposerWin::slotSendLater);
connect(actActionNowMenu, &KActionMenuTransport::transportSelected, this,
......@@ -1166,7 +1166,11 @@ void KMComposerWin::setupActions(void)
KStandardAction::redo(mGlobalAction, &KMComposerGlobalAction::slotRedo, actionCollection());
KStandardAction::cut(mGlobalAction, &KMComposerGlobalAction::slotCut, actionCollection());
KStandardAction::copy(mGlobalAction, &KMComposerGlobalAction::slotCopy, actionCollection());
#if KCONFIGWIDGETS_VERSION_MINOR >= 39
KStandardAction::paste(mGlobalAction, &KMComposerGlobalAction::slotPaste, actionCollection());
#else
KStandardAction::pasteText(mGlobalAction, &KMComposerGlobalAction::slotPaste, actionCollection());
#endif
mSelectAll = KStandardAction::selectAll(mGlobalAction, &KMComposerGlobalAction::slotMarkAll, actionCollection());
mFindText = KStandardAction::find(mRichTextEditorwidget, &KPIMTextEdit::RichTextEditorWidget::slotFind, actionCollection());
......@@ -1279,7 +1283,7 @@ void KMComposerWin::setupActions(void)
KStandardAction::keyBindings(this, &KMComposerWin::slotEditKeys, actionCollection());
KStandardAction::configureToolbars(this, &KMComposerWin::slotEditToolbars, actionCollection());
KStandardAction::preferences(kmkernel, SLOT(slotShowConfigurationDialog()), actionCollection());
KStandardAction::preferences(kmkernel, &KMKernel::slotShowConfigurationDialog, actionCollection());
action = new QAction(i18n("&Spellchecker..."), this);
action->setIconText(i18n("Spellchecker"));
......@@ -1315,7 +1319,7 @@ void KMComposerWin::setupActions(void)
mCryptoModuleAction = new KSelectAction(i18n("&Cryptographic Message Format"), this);
actionCollection()->addAction(QStringLiteral("options_select_crypto"), mCryptoModuleAction);
connect(mCryptoModuleAction, SIGNAL(triggered(int)), SLOT(slotSelectCryptoModule()));
connect(mCryptoModuleAction, QOverload<int>::of(&KSelectAction::triggered), this, &KMComposerWin::slotCryptoModuleSelected);
mCryptoModuleAction->setToolTip(i18n("Select a cryptographic format for this message"));
mCryptoModuleAction->setItems(listCryptoFormat);
......@@ -1912,6 +1916,11 @@ void KMComposerWin::slotInsertTextFile(KJob *job)
showErrorMessage(job);
}
void KMComposerWin::slotCryptoModuleSelected()
{
slotSelectCryptoModule(false);
}
void KMComposerWin::slotSelectCryptoModule(bool init)
{
if (!init) {
......
......@@ -306,7 +306,7 @@ private Q_SLOTS:
* Change crypto plugin to be used for signing/encrypting messages,
* or switch to built-in OpenPGP code.
*/
void slotSelectCryptoModule(bool init = false);
void slotSelectCryptoModule(bool init);
/**
* XML-GUI stuff
......@@ -531,6 +531,7 @@ private:
KeyOk,
NoKey
};
void slotCryptoModuleSelected();
void updateComposerAfterIdentityChanged(const KIdentityManagement::Identity &ident, uint uoid, bool wasModified);
......@@ -555,23 +556,24 @@ private:
QLabel *mCursorLineLabel = nullptr;
QLabel *mCursorColumnLabel = nullptr;
QLabel *mStatusbarLabel = nullptr;
bool mDone;
bool mDone = false;
KMime::Message::Ptr mMsg;
QGridLayout *mGrid = nullptr;
QString mTextSelection;
QString mCustomTemplate;
bool mLastSignActionState;
bool mLastEncryptActionState;
bool mSigningAndEncryptionExplicitlyDisabled;
bool mLastIdentityHasSigningKey;
bool mLastIdentityHasEncryptionKey;
bool mLastSignActionState = false;
bool mLastEncryptActionState = false;
bool mSigningAndEncryptionExplicitlyDisabled = false;
bool mLastIdentityHasSigningKey = false;
bool mLastIdentityHasEncryptionKey = false;
Akonadi::Collection mFolder;
long mShowHeaders;
bool mForceDisableHtml; // Completely disable any HTML. Useful when sending invitations in the
bool mForceDisableHtml = false; // Completely disable any HTML. Useful when sending invitations in the
// mail body.
int mNumHeaders;
QFont mBodyFont, mFixedFont;
QFont mBodyFont;
QFont mFixedFont;
uint mId;
TemplateContext mContext;
......@@ -630,11 +632,11 @@ private:
ExternalEditorWarning *mExternalEditorWarning = nullptr;
QTimer *mVerifyMissingAttachment = nullptr;
MailCommon::FolderRequester *mFccFolder = nullptr;
bool mPreventFccOverwrite;
bool mCheckForForgottenAttachments;
bool mWasModified;
bool mPreventFccOverwrite = false;
bool mCheckForForgottenAttachments = false;
bool mWasModified = false;
CryptoStateIndicatorWidget *mCryptoStateIndicatorWidget = nullptr;
bool mSendNowByShortcutUsed;
bool mSendNowByShortcutUsed = false;
KSplitterCollapserButton *mSnippetSplitterCollapser = nullptr;
KToggleAction *mFollowUpToggleAction = nullptr;
StatusBarLabelToggledState *mStatusBarLabelToggledOverrideMode = nullptr;
......
......@@ -28,9 +28,6 @@
CryptoStateIndicatorWidget::CryptoStateIndicatorWidget(QWidget *parent)
: QWidget(parent)
, mShowAlwaysIndicator(true)
, mIsSign(false)
, mIsEncrypted(false)
{
QHBoxLayout *hbox = new QHBoxLayout(this);
hbox->setMargin(0);
......
......@@ -38,9 +38,9 @@ private:
void updateShowAlwaysIndicator();
QLabel *mSignatureStateIndicator = nullptr;
QLabel *mEncryptionStateIndicator = nullptr;
bool mShowAlwaysIndicator;
bool mIsSign;
bool mIsEncrypted;
bool mShowAlwaysIndicator = true;
bool mIsSign = false;
bool mIsEncrypted = false;
};
#endif // CRYPTOSTATEINDICATORWIDGET_H
......@@ -127,11 +127,6 @@ public:
static void cleanup();
QAction *action(const QString &name);
KActionMenu *filterMenu() const;
KActionMenu *mailingListActionMenu() const;
QAction *editAction() const;
QAction *sendAgainAction() const;
......@@ -139,8 +134,6 @@ public:
KActionMenuTransport *sendQueueViaMenu() const;
KMail::MessageActions *messageActions() const;
/**
Returns a list of all KMMainWidgets. Warning, the list itself can be 0.
@return the list of all main widgets, or 0 if it is not yet initialized
......@@ -173,7 +166,65 @@ public:
Akonadi::Item::List currentSelection() const;
QString fullCollectionPath() const;
void initializeFilterActions();
/** Clear and create actions for marked filters */
void clearFilterActions();
/**
* Convenience function to get the action collection in a list.
*
* @return a list of action collections. The list only has one item, and
* that is the action collection of this main widget as returned
* by actionCollection().
*/
QList<KActionCollection *> actionCollections() const;
void refreshMessageListSelection();
Akonadi::StandardMailActionManager *standardMailActionManager() const;
QAction *akonadiStandardAction(Akonadi::StandardActionManager::Type type);
QAction *akonadiStandardAction(Akonadi::StandardMailActionManager::Type type);
public Q_SLOTS:
/**
Open a separate viewer window containing the specified message.
*/
void slotMessageActivated(const Akonadi::Item &);
/**
Opens mail in the internal viewer.
*/
void slotMessageSelected(const Akonadi::Item &);
void slotItemsFetchedForActivation(KMCommand *command);
void slotMessageStatusChangeRequest(const Akonadi::Item &, const Akonadi::MessageStatus &, const Akonadi::MessageStatus &);
/** Adds if not existing/removes if existing the tag identified by @p aLabel
in all selected messages */
void slotUpdateMessageTagList(const Akonadi::Tag &tag);
void slotSelectCollectionFolder(const Akonadi::Collection &col);
void slotUpdateConfig();
Q_SIGNALS:
void messagesTransfered(bool);
void captionChangeRequest(const QString &caption);
void recreateGui();
protected:
void showEvent(QShowEvent *event) override;
private:
KMail::MessageActions *messageActions() const;
KActionMenu *filterMenu() const;
KActionMenu *mailingListActionMenu() const;
QAction *editAction() const;
// Moving messages around
/**
* This will ask for a destination folder and move the currently selected
......@@ -219,60 +270,12 @@ private:
void folderSelected(const Akonadi::Collection &col);
public Q_SLOTS:
/**
Open a separate viewer window containing the specified message.
*/
void slotMessageActivated(const Akonadi::Item &);
/**
Opens mail in the internal viewer.
*/
void slotMessageSelected(const Akonadi::Item &);
void slotItemsFetchedForActivation(KMCommand *command);
void slotMessageStatusChangeRequest(const Akonadi::Item &, const Akonadi::MessageStatus &, const Akonadi::MessageStatus &);
/**
Start a timer to update message actions
*/
void startUpdateMessageActionsTimer();
/** Adds if not existing/removes if existing the tag identified by @p aLabel
in all selected messages */
void slotUpdateMessageTagList(const Akonadi::Tag &tag);
void slotSelectMoreMessageTagList();
void slotSelectCollectionFolder(const Akonadi::Collection &col);
void slotUpdateConfig();
public:
void initializeFilterActions();
/** Clear and create actions for marked filters */
void clearFilterActions();
/**
* Convenience function to get the action collection in a list.
*
* @return a list of action collections. The list only has one item, and
* that is the action collection of this main widget as returned
* by actionCollection().
*/
QList<KActionCollection *> actionCollections() const;
void refreshMessageListSelection();
Akonadi::StandardMailActionManager *standardMailActionManager() const;
QAction *akonadiStandardAction(Akonadi::StandardActionManager::Type type);
QAction *akonadiStandardAction(Akonadi::StandardMailActionManager::Type type);
Q_SIGNALS:
void messagesTransfered(bool);
void captionChangeRequest(const QString &caption);
void recreateGui();
private:
void setupActions();
void createWidgets();
void deleteWidgets();
......@@ -287,10 +290,70 @@ private:
When dealing with geometries, use this pointer
*/
KSharedConfig::Ptr config();
protected:
void showEvent(QShowEvent *event) override;
void checkAkonadiServerManagerState();
void updateHtmlMenuEntry();
void updateMoveAction(const Akonadi::CollectionStatistics &statistic);
void updateMoveAction(bool hasUnreadMails);
void updateAllToTrashAction(int statistics);
/** Get override character encoding. */
QString overrideEncoding() const;
void moveMessageSelected(MessageList::Core::MessageItemSetReference ref, const Akonadi::Collection &dest, bool confirmOnDeletion = true);
void copyMessageSelected(const Akonadi::Item::List &selectMsg, const Akonadi::Collection &dest);
/**
* Move the messages referenced by the specified set to trash.
* The set parameter must not be null and the ownership is passed
* to this function.
*/
void trashMessageSelected(MessageList::Core::MessageItemSetReference ref);
/**
* Set the status of the messages referenced by the specified set, eventually toggling it.
* The set parameter must not be null and the ownership is passed to this function.
*/
void setMessageSetStatus(const Akonadi::Item::List &select, const Akonadi::MessageStatus &status, bool toggle);
/**
* Toggles a tag for the messages referenced by the specified set.
* The set parameter must not be null and the ownership is passed to this function.
*/
void toggleMessageSetTag(const Akonadi::Item::List &select, const Akonadi::Tag &tag);
/**
* This applies setMessageSetStatus() on the current thread.
*/
void setCurrentThreadStatus(const Akonadi::MessageStatus &status, bool toggle);
void applyFilters(const Akonadi::Item::List &selectedMessages);
void applyFilters(const Akonadi::Collection::List &selectedCols);
void applyFilter(const Akonadi::Collection::List &selectedCols, const QString &filter);
/**
* Internal helper that creates the folder selection dialog used for the
* move and copy to folder actions on demand. Only folders where items can
* be added are listed.
*/
MailCommon::FolderSelectionDialog *moveOrCopyToDialog();
/**
* Internal helper that creates the folder selection dialog used for
* jumping to folders, or adding them as favourites. All folders are listed.
*/
MailCommon::FolderSelectionDialog *selectFromAllFoldersDialog();
/**
* Internal helper that applies the current settings so the
* favorite folder view.
*/
void refreshFavoriteFoldersViewProperties();
void openFilterDialog(const QByteArray &field, const QString &value);
void showMessagePopup(const Akonadi::Item &msg, const QUrl &aUrl, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound,
const WebEngineViewer::WebHitTestResult &result);
private Q_SLOTS:
void updateFileMenu();
......@@ -416,72 +479,7 @@ private Q_SLOTS:
void slotCreateAddressBookContact();
void slotOpenRecentMsg(const QUrl &url);
private:
void checkAkonadiServerManagerState();
void updateHtmlMenuEntry();
void updateMoveAction(const Akonadi::CollectionStatistics &statistic);
void updateMoveAction(bool hasUnreadMails);
void updateAllToTrashAction(int statistics);
/** Get override character encoding. */
QString overrideEncoding() const;
void moveMessageSelected(MessageList::Core::MessageItemSetReference ref, const Akonadi::Collection &dest, bool confirmOnDeletion = true);
void copyMessageSelected(const Akonadi::Item::List &selectMsg, const Akonadi::Collection &dest);
/**
* Move the messages referenced by the specified set to trash.
* The set parameter must not be null and the ownership is passed
* to this function.
*/
void trashMessageSelected(MessageList::Core::MessageItemSetReference ref);
/**
* Set the status of the messages referenced by the specified set, eventually toggling it.
* The set parameter must not be null and the ownership is passed to this function.
*/
void setMessageSetStatus(const Akonadi::Item::List &select, const Akonadi::MessageStatus &status, bool toggle);
/**
* Toggles a tag for the messages referenced by the specified set.
* The set parameter must not be null and the ownership is passed to this function.
*/
void toggleMessageSetTag(const Akonadi::Item::List &select, const Akonadi::Tag &tag);
/**
* This applies setMessageSetStatus() on the current thread.
*/
void setCurrentThreadStatus(const Akonadi::MessageStatus &status, bool toggle);
void applyFilters(const Akonadi::Item::List &selectedMessages);
void applyFilters(const Akonadi::Collection::List &selectedCols);
void applyFilter(const Akonadi::Collection::List &selectedCols, const QString &filter);
/**
* Internal helper that creates the folder selection dialog used for the
* move and copy to folder actions on demand. Only folders where items can
* be added are listed.
*/
MailCommon::FolderSelectionDialog *moveOrCopyToDialog();
/**
* Internal helper that creates the folder selection dialog used for
* jumping to folders, or adding them as favourites. All folders are listed.
*/
MailCommon::FolderSelectionDialog *selectFromAllFoldersDialog();
/**
* Internal helper that applies the current settings so the
* favorite folder view.
*/
void refreshFavoriteFoldersViewProperties();
void openFilterDialog(const QByteArray &field, const QString &value);
void showMessagePopup(const Akonadi::Item &msg, const QUrl &aUrl, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound,
const WebEngineViewer::WebHitTestResult &result);
private Q_SLOTS:
void slotMoveMessageToTrash();
/**
* Called when a "move to trash" operation is completed
......
Supports Markdown
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