Commit cd954038 authored by Laurent Montel's avatar Laurent Montel 😁

Add parent

parent 9b47218e
...@@ -98,7 +98,7 @@ ArchiveMailWidget::~ArchiveMailWidget() ...@@ -98,7 +98,7 @@ ArchiveMailWidget::~ArchiveMailWidget()
void ArchiveMailWidget::customContextMenuRequested(const QPoint &) void ArchiveMailWidget::customContextMenuRequested(const QPoint &)
{ {
const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems(); const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems();
QMenu menu; QMenu menu(this);
menu.addAction(i18n("Add..."), this, &ArchiveMailWidget::slotAddItem); menu.addAction(i18n("Add..."), this, &ArchiveMailWidget::slotAddItem);
if (!listItems.isEmpty()) { if (!listItems.isEmpty()) {
if (listItems.count() == 1) { if (listItems.count() == 1) {
......
...@@ -192,7 +192,7 @@ void FollowUpReminderInfoWidget::customContextMenuRequested(const QPoint &pos) ...@@ -192,7 +192,7 @@ void FollowUpReminderInfoWidget::customContextMenuRequested(const QPoint &pos)
const QList<QTreeWidgetItem *> listItems = mTreeWidget->selectedItems(); const QList<QTreeWidgetItem *> listItems = mTreeWidget->selectedItems();
const int nbElementSelected = listItems.count(); const int nbElementSelected = listItems.count();
if (nbElementSelected > 0) { if (nbElementSelected > 0) {
QMenu menu; QMenu menu(this);
QAction *showMessage = nullptr; QAction *showMessage = nullptr;
FollowUpReminderInfoItem *mailItem = nullptr; FollowUpReminderInfoItem *mailItem = nullptr;
if ((nbElementSelected == 1)) { if ((nbElementSelected == 1)) {
......
...@@ -104,7 +104,7 @@ void SendLaterWidget::customContextMenuRequested(const QPoint &) ...@@ -104,7 +104,7 @@ void SendLaterWidget::customContextMenuRequested(const QPoint &)
{ {
const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems(); const QList<QTreeWidgetItem *> listItems = mWidget->treeWidget->selectedItems();
if (!listItems.isEmpty()) { if (!listItems.isEmpty()) {
QMenu menu; QMenu menu(this);
if (listItems.count() == 1) { if (listItems.count() == 1) {
menu.addAction(i18n("Send now"), this, &SendLaterWidget::slotSendNow); menu.addAction(i18n("Send now"), this, &SendLaterWidget::slotSendNow);
} }
......
...@@ -1996,7 +1996,7 @@ bool KMComposerWin::insertFromMimeData(const QMimeData *source, bool forceAttach ...@@ -1996,7 +1996,7 @@ bool KMComposerWin::insertFromMimeData(const QMimeData *source, bool forceAttach
QImage image = qvariant_cast<QImage>(source->imageData()); QImage image = qvariant_cast<QImage>(source->imageData());
QFileInfo fi(source->text()); QFileInfo fi(source->text());
QMenu menu; QMenu menu(this);
const QAction *addAsInlineImageAction = menu.addAction(i18n("Add as &Inline Image")); const QAction *addAsInlineImageAction = menu.addAction(i18n("Add as &Inline Image"));
/*const QAction *addAsAttachmentAction = */ menu.addAction(i18n("Add as &Attachment")); /*const QAction *addAsAttachmentAction = */ menu.addAction(i18n("Add as &Attachment"));
const QAction *selectedAction = menu.exec(QCursor::pos()); const QAction *selectedAction = menu.exec(QCursor::pos());
......
...@@ -2677,7 +2677,7 @@ void KMMainWidget::slotContactSearchJobForMessagePopupDone(KJob *job) ...@@ -2677,7 +2677,7 @@ void KMMainWidget::slotContactSearchJobForMessagePopupDone(KJob *job)
void KMMainWidget::showMessagePopup(const Akonadi::Item &msg, const QUrl &url, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound, void KMMainWidget::showMessagePopup(const Akonadi::Item &msg, const QUrl &url, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound,
const WebEngineViewer::WebHitTestResult &result) const WebEngineViewer::WebHitTestResult &result)
{ {
QMenu *menu = new QMenu; QMenu *menu = new QMenu(this);
bool urlMenuAdded = false; bool urlMenuAdded = false;
......
...@@ -503,7 +503,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url ...@@ -503,7 +503,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
if (!url.isEmpty()) { if (!url.isEmpty()) {
if (url.scheme() == QLatin1String("mailto")) { if (url.scheme() == QLatin1String("mailto")) {
// popup on a mailto URL // popup on a mailto URL
menu = new QMenu; menu = new QMenu(this);
menu->addAction(mReaderWin->mailToComposeAction()); menu->addAction(mReaderWin->mailToComposeAction());
if (messageHasPayload) { if (messageHasPayload) {
menu->addAction(mReaderWin->mailToReplyAction()); menu->addAction(mReaderWin->mailToReplyAction());
...@@ -529,7 +529,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url ...@@ -529,7 +529,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
urlMenuAdded = true; urlMenuAdded = true;
} else if (url.scheme() != QLatin1String("attachment")) { } else if (url.scheme() != QLatin1String("attachment")) {
// popup on a not-mailto URL // popup on a not-mailto URL
menu = new QMenu; menu = new QMenu(this);
menu->addAction(mReaderWin->urlOpenAction()); menu->addAction(mReaderWin->urlOpenAction());
menu->addAction(mReaderWin->addBookmarksAction()); menu->addAction(mReaderWin->addBookmarksAction());
menu->addAction(mReaderWin->urlSaveAsAction()); menu->addAction(mReaderWin->urlSaveAsAction());
...@@ -550,7 +550,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url ...@@ -550,7 +550,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
const QString selectedText(mReaderWin->copyText()); const QString selectedText(mReaderWin->copyText());
if (!selectedText.isEmpty()) { if (!selectedText.isEmpty()) {
if (!menu) { if (!menu) {
menu = new QMenu; menu = new QMenu(this);
} }
if (urlMenuAdded) { if (urlMenuAdded) {
menu->addSeparator(); menu->addSeparator();
...@@ -575,7 +575,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url ...@@ -575,7 +575,7 @@ void KMReaderMainWin::showMessagePopup(const Akonadi::Item &msg, const QUrl &url
} }
} else if (!urlMenuAdded) { } else if (!urlMenuAdded) {
if (!menu) { if (!menu) {
menu = new QMenu; menu = new QMenu(this);
} }
// popup somewhere else (i.e., not a URL) on the message // popup somewhere else (i.e., not a URL) on the message
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment